mdev.conf:
sd[a-z]*[0-9] 0:0 0660 @(mount -t vfat -o iocharset=cp936 /dev/$MDEV /mnt/udisk)
sd[a-z]*[0-9] 0:0 0660 *(umount /mnt/udisk)
mmcblk[0-9]*p[0-9] 0:0 0660 @(mount -t vfat -o iocharset=cp936 /dev/$MDEV /mnt/sd)
mmcblk[0-9]*p[0-9] 0:0 0660 *(umount /mnt/sd)
Note 1: The added contents are used to realize two functsion: when SD and or USB flash drive are inserted, they are automatically mounted to /mnt/.
Comment 1: The default is simplified Chinese. If you want to use traditional Chinese, please change iocharset=cp936 to iocharset=utf8.
Comment 2: For some SD or USB flash drive. For example, USB flash drive, when inserted, it will show up as sda1 under /dev. But some special USB flash drive will show up as sda, i.e, no digits (no partition information).
The special SD will show up as mmcblk0, not mmcblk0p1. If this happens, we need to change the script as sd[a-z]* or mmcblk[0-9]*£¬Please do this according to the situation, otherwise, you may not able to read SD and USB flash drive.
Note 2: For more configuration of mdev.conf, please refer to “docs/mdev.txt” under busybox.
resolv.conf:
It is used to save DNS setting.
nameserver 202.96.128.86
init.d/rcS:
If you want to automatically run some processes during boot up, this is the place to add.
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
runlevel=S
prevlevel=N
umask 022
export PATH runlevel prevlevel
# Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
#
mount -a
mkdir /dev/pts
mount -t devpts devpts /dev/pts
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s
mkdir -p /var/lock
/bin/hostname -F /etc/sysconfig/HOSTNAME
Note 1: The red portion is about the use of mdev, please refer to “docs/mdev.txt” under busybox.
Note 2: We also need to change rcS to executable. Command: #chmod 777 rcS¡£
rc.d/init.d/httpd£º
#!/bin/sh
base=boa
# See how we were called.
case “$1” in
start)
/sbin/$base
;;
stop)
pid=`/bin/pidof $base`
if [ -n “$pid” ]; then
kill -9 $pid
fi
;;
esac
exit 0
boa/boa.conf:
blank, for the origin of this file, please refer to port of web server.
sysconfig/HOSTNAME:
EmbedSky
For now, we will add these contents under “etc”.
“home” directory:
The directory used to store users’ files. Here, we create a user directory named “sky”. Do you still remember that there is a user named “sky” in the previously mentioned “passwd” file? It corresponds to this ‘sky’ directory.
Note: “sky” directorty needs to be changed to 777. Otherwise, when use ftp to send data, it will report that this directory can’t be accessed. Suggested comment£º#chmod 777 home/sky.
“lib” directory:
The directory used to store the frequently used library files. The way to get the library files (if extract from EABI-4.3.3 cross compiler):
#cd /opt/EmbedSky/root_2.6.30.4
#cp -f /opt/EmbedSky/4.3.3/arm-none-linux-gnueabi/libc/armv4t/usr/lib/*.so* lib -a
#rm -f lib/libwv* lib/libuniconf*
The following lists the steps used to extract the library from cross compiler 3.4.5:
#cd /opt/EmbedSky/root_2.6.30.4
#cp -f /opt/EmbedSky/crosstools_3.4.5_softfloat/gcc-3.4.5-glibc-2.3.6/arm-linux/arm-linux/lib/*.so* lib -a
#rm -f lib/libwv* lib/libuniconf*
Here we copied the frequently used libraries. If need special library, please copy from the corresponding directory. Above, we delete PPP dial library, it needs 8MB, and normally is not used.
Note: In the file system we provide, all *.so* under “lib/” are selected in the above steps. It’s suggested for the beginners to directly copy these files from the file system we provide.
“mnt” directory:
This directory is normally used to mount USB flash drives and other devices. We create two directories “udisk” and “sd”, which are used to mount USB flash drive and SD.
“opt” directory:
We use it to store the Qt related directories.
“proc”directory (default to blank):
It is used to provide some directories and emulated file system.
“root” directory:
Directory of user “root”.
“sys” directory (default to blank):
mdev may create some files under it.
“tmp” directory (default to blank):
It’s used to store the temporary files.
“var” directory (default to blank):
It’s used to store the temporary files.
“web” directory:
It’s used to store web server related files, and suggested to copy from the file system we provide.
“usr/bin/”directory:
Copy the files used to do serial port file transfer from the file system we provided (for example, root_2.6.30.4_TQ2440). The command is as follows:
#rm -f /opt/EmbedSky/root_2.6.30.4/usr/bin/rx
#cd /opt/EmbedSky/root_2.6.30.4_TQ2440/usr/bin
#cp -f rb rx rz sb sx sz /opt/EmbedSky/root_2.6.30.4/usr/bin/
Herein rz and sz commands are used to receive and send files using super terminal’s zmodem. In the eval board’s serial control console:
$rz
Then right click zmodem and you can send file to development board.
$sz filename
Then the development board can send file to PC.
Until now, the framework of the file system are almost done. Next step is to build yaffs file system, and build it into yaffs file system image. The commands are as follows:
#cd /opt/EmbedSky
#mkyaffsimage_2 root_2.6.30.4 root_2.6.30.4.bin
Note: please note the space within the command. For 64MB Nand flash file system, please use: mkyaffsimage_2 It is under “/usr/local/sbin/”. For 128MB Nand Flash file system, please user: mkyaffs2image. It is under “/usr/local/sbin/”.
Then we can copy the image root_2.6.30.4.bin, and burn to the development board.
Note: Because file “etc/inittab” depends on the serial port settings, it’s recommended to do TUT 12 first, and then burn the images of kernel and file system.
Finally, we will get something like:
Leave a Reply
You must be logged in to post a comment.