Cramfs Making method

Source: Internet
Author: User
Tags bz2 mkdir
Cramfs Making Method

1. Compile Cramfs production tool Mkcramfs

A. Extract cramfs-1.1.tar.bz2, create cramfs-1.1 folder

B. Use a terminal to enter the cramfs-1.1 folder, run make, compile Cramfs tools

C. Compile and generate Mkcramfs and cramfsck two tools to copy the two tools to the/usr/bin directory.

2. Compile BusyBox

A. Extract busybox-1.20.2.tar.bz2, create busybox-1.20.2 folder

B. Using terminals to enter the busybox-1.20.2 folder

C. Modify the Cross_compile in the makefile file as the corresponding compiler, such as

Cross_compile? =/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-

D. Input make Target_arch=arm compile busybox in terminal

E. Enter the make install installation BusyBox after compilation completes, and the installed directory defaults to the./_install folder, we just need the Bin,sbin,usr folder

3. Making Cramfs

A. Create a rootfs directory to copy the compiled BusyBox folder bin,sbin,usr to the Rootfs directory

B. Creating a Dev,etc,home,lib,mnt,opt,proc,root,sys,tmp,var directory under the Rootfs directory

C. Create a LINUXRC file under the Rootfs directory, such as the LINUXRC file under ROOTFS-2012-10-13-0003.TAR.BZ2 and modify its properties: chmod 775

D. Enter the Rootfs/dev directory and execute: Mknod console C 5 1 and Mknod null C 1 3 to create device nodes. (such as using a file system in a compressed package, you need to do this)

E. Enter the Rootfs/dev directory, create Fstab,inittab,profile,init.d/rcs and other documents, related content reference rootfs-2012-10-13-0003.tar.bz2

F. Enter the ROOTFS/USR directory, create etc folders, function user profiles, create rc.local,profile,profile.org files, related content reference rootfs-2012-10-13-0003.tar.bz2

G. Access to the Rootfs directory, the implementation of Mkcramfs Rootfs ROOTFS.CRAMFS production and file system, after the completion of the Rootfs.cramfs file

4. Download and run Cramfs

A. Cramfs burn to SMDK development Rootfs space, restart the Development Board, see the following information to indicate that the root file system loaded successfully

vfs:mounted Root (Cramfs filesystem) readonly.

Freeing Init memory:252k

Processing ETC/INIT.D/RC. S

Mount All

*************************************

Rootfs by Cramfs

*************************************

Please press Enter to activate this console.

Note: You need to configure the startup parameters when compiling the kernel:

Boot options->default Kernel command string:

Root=/dev/mtdblock2 Rootfstype=cramfs INIT=/LINUXRC console=ttysac0,115200

Attachment: Contents of related documents

ROOTFS/LINUXRC file

#!/bin/bash
echo "Mount/etc as Ramfs"
/bin/mount-n-T Ramfs ramfs/etc
/bin/cp-a/mnt/etc/*/etc

echo "Re-create The/etc/mtab entries"
# Re-create The/etc/mtab Entries
#/bin/mount-f-T Cramfs-o REMOUNT,RO/DEV/MTDBLOCK/2/
/bin/mount-t Ramfs ramfs/tmp

Exec/sbin/init

Rootfs/etc/fstab file

NONE/PROC proc Defaults 0 0
None/tmp Ramfs Defaults 0 0
Mdev/dev Ramfs Defaults 0 0
Sysfs/sys Sysfs Defaults 0 0

Rootfs/etc/inittab file

# This is run the except when booting
:: Sysinit:/etc/init.d/rcs

# Start an ' Askfirst ' shell on the console
#::askfirst:-/bin/bash
Ttysac0::askfirst:/bin/bash

# Stuff to did when restarting the INIT process
:: Restart:/sbin/init

#::once:/sbin/raja.sh
#::respawn:/sbin/iom

:: once:/usr/etc/rc.local

# Stuff to do before rebooting
:: Ctrlaltdel:/sbin/reboot
:: Shutdown:/bin/umount-a-R

Rootfs/etc/profiel file

#/etc/profile:system-wide. profile file for the Bourne shells

echo "Processing/etc/profile"
# No-op

# Set Search Library Path
Ld_library_path=/lib:/usr/lib
Export Ld_library_path

# Set User Path
Path=/bin:/sbin:/usr/bin:/usr/sbin
Export PATH

# Set PS1
#export ps1= "[$USER @linux]\\$"
#echo

Rootfs/etc/init.d/rcs file

#! /bin/bash
echo "Processing ETC/INIT.D/RC. S

#hostname ${hostname}

echo "Mount All"
/bin/mount-an

/bin/mknod/dev/console C 5 1
/bin/mknod/dev/null C 1 3
/BIN/MKNOD/DEV/TTYSAC0 C 204 64
/BIN/MKNOD/DEV/TTYSAC1 C 204 65
/BIN/MKNOD/DEV/TTYSAC2 C 204 66
/BIN/MKNOD/DEV/TTYSAC3 C 204 67
/bin/mkdir/dev/pts
/bin/mkdir/dev/shm
/bin/mkdir/dev/video
/bin/mknod/dev/video/codec C 81 12
/bin/mknod/dev/video/preview C 81 13


#echo "Starting Mdev ..."
#/bin/echo/sbin/mdev > Proc/sys/kernel/hotplug
#mdev-S
#/sbin/udevd--daemon
#/sbin/udevadm Trigger

Ln-s/dev/ts0/dev/ts

rootfs/usr/etc/rc.local file

#!/bin/bash
./usr/etc/profile

/sbin/ifconfig Lo 127.0.0.1 up
#/sbin/ifconfig eth0 192.168.2.12 netmask 255.255.255.0 up
#/sbin/inetd
#/usr/sbin/makelinks

/bin/mkdir/tmp/udisk
/bin/mkdir/tmp/sd
/bin/mkdir/tmp/photo

#source/.BASHRC

#export qws_display=transformed:rot90
#/bin/cp-rf/qtopia/qtopia-free-1.7.0/elfin/*/tmp/
#cd/tmp
#/qtopia/qtopia-free-1.7.0/bin/qpe-qws&
#/bin/apm

Rootfs/usr/etc/profile file

display=unix:0.0
Path=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
#QWS_KEYBOARD =tty
Lang=c
Home=/tmp
Kmod=/lib/modules/2.4.19-rmk4-pxa2
Export PATH qtdir linuettedir qws_keyboard LANG home DISPLAY kdedir kmod

rootfs/usr/etc/profile.org file

 #!/bin/sh
display=unix:0.0
path=/bin:/sbin:/usr/bin:/usr/sbin:/mnt
Ld_library_path=/usr/home :/lib:/usr/lib:
#QWS_KEYBOARD =tty
LANG=ZH_CN
home=/usr/home
Export PATH ld_library_path LANG home

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.