Note 1: Linux-126.96.36.199 and Linux-188.8.131.52 can use the same file system (major parts are same, the only difference is the driver module). The explaination in this tutorial is using 184.108.40.206 as an example.
Note 2. Suggest to do tut 12 first, and then come back to do this tuturial.
11.1 Build the frame
Create a directory "root_220.127.116.11" under "/opt/EmbedSky/". Copy the compiled directories from busybox "bin", "sbin","usr" and "linuxrc" to "root_18.104.22.168".
Also need to create "dev","etc","home","lib","mnt","opt","proc"¡¢"root","sys","tmp","var" and "web".
Also create a "lib" and "share" under the exsisting "usr".
Use the following commands:
#mkdir -p /opt/EmbedSky/root_22.214.171.124
#cp -rf /opt/EmbedSky/busybox-1.13.0/_install/* .
#mkdir -p dev etc home/sky lib mnt/udisk mnt/sd opt proc root sys tmp usr/lib usr/share var
11.2 Add new contents
We suggest you do the the following contents manually so you can get familar with the important concepts. If you choose you can also copy the exisiting one from the ported file system from
The contents under "dev" will be automatically created by the system by calling "mdev" when kernel finished loading file system.
However, "mdev" is calling "init" to boot. Before using mdev to create "dev", init will need "/dev/console" and "/dev/null". So we need to statically create these two device files when build the file system:
#mknod console c 5 1
#mknod null c 1 3
If we don't create these two device files, during booting, the file system will report "Warning: unable to open an initial console."
This warning message comes from line 778 int_post() in the kernel file "init/main.c".
It's used to store system config files. The frequent used files are stored under "etc/".
Note: The mentioned files can be copied from the file system we provided. You can also use vi or gedit command to create them, and type the corresponding contents. The mentioned directories also need to be created.
fstab:Specify the file systems that need to be mounted.
inittab:config files for init process.
shadow:This file is used by "passwd" to create password.
profile:Config file of user enviroment.
mdev.conf:Starting from 2.6.18, linux stops using devfs, and use udev (mdev is simplied version of udev). mdev.conf can be blank or edit according to some rules. Here we add the scripts used to automatically mount SD and USB flash drive.
resolv.conf:It's used to DNS information. DNS is needed when excess extra net.
The frequent used directories:
init.d:the starting file directory. There are one "rcS" file under this directory, it is used to store the booting config and the automatically started processes.
sysconfig:In the file system we provides, there is one file named "HOSTNAME". The content of this file is: EmbedSky£¬ That's why we will see "[root@EmbedSky /]" in the file system.
rc.d:It's used to store some automatically called scrips in our file system.
boa:a directory only in our file system, used to store the config script of web server.
Now we list the contents of each files under "etc/".
Note: If you want to build a brand new file system, you need to create these files.
# device mount-point type options dump fsck order
proc /proc proc defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev tmpfs defaults 0 0
var /dev tmpfs defaults 0 0
ramfs /dev ramfs defaults 0 0
inittab: please refer to the "examples/inittab" under the busybox directory.
::shutdown:/bin/umount -a -r
Note 1:The red part in the reference files in busybox is ttySAC0, but we use tq2440_serial as device name in the serial driver for s3c24xx.(in Linux-126.96.36.199 kernel source file "drivers/serial/s3c2410.c", line 949, in Linux-
188.8.131.52 kenerl source file "drivers/serial/samsung.c" line 888, we change it to tq2440_serial. We then use seerial 0 as control console, so we use tq2440_serial0.
Note 2: we need to change inittab to executable, recommended to use 777. Command: #chmod 777 inittab.
The content is blank.
Comment: This file is used by passwd.
Note: the red part is the encrypted password. The method to get it to do run set password in a built filesystem (your host) using "passwd sky", and open this file, then you will see this content.
# Ash profile
# vim: syntax=sh
# No core files by default
#ulimit -S -c 0 > /dev/null 2>&1
PS1='[u@h W]# '
export USER LOGNAME PS1 PATH