#!/bin/sh # /etc/inittab # # Copyright (C) 2009 Edutech <cuiqingwei@gmail.com> # # Note: BusyBox init doesn't support runlevels. The runlevels field is # completely ignored by BusyBox init. If you want runlevels, use # sysvinit. # # Format for each entry: <id>:<runlevels>:<action>:<process> # # id == tty to run on, or empty for /dev/console # runlevels == ignored # action == one of sysinit, respawn, askfirst, wait, and once # process == program to run # now run any rc scripts ::sysinit:/etc/init.d/rcS # 不需要设置登录验证 #console::respawn:-/bin/sh # 需要设置登录验证 Put a getty on the serial port ttyS0::askfirst:/sbin/getty -L ttyS0 115200 vt100 # Logging #null::respawn:/sbin/syslogd -n -m 0 #null::respawn:/sbin/klogd -n # ctrl+alt+del restart ::ctrlaltdel:/sbin/reboot # restart init process ::restart:/sbin/init # Stuff to do before rebooting #null::shutdown:/usr/bin/killall klogd #null::shutdown:/usr/bin/killall syslogd null::shutdown:/bin/umount -a -r null::shutdown:/sbin/swapoff -a # by: cuiqingwei 20120913
cd /home/at91sam9/mdk9261/rootfs/jffs2 touch etc/shadow
4.编译busybox
1 2 3 4 5
cd /home/at91sam9/mdk9261/rootfs wget http://busybox.net/downloads/busybox-1.19.4.tar.bz2 tar -xjvf busybox-1.19.4.tar.bz2 cd busybox-1.19.4 gedit Makefile
修改下面两行 ARCH ?= arm CROSS_COMPILE ?=/opt/arm-2007q1/bin/arm-none-linux-gnueabi- (这个视你的交叉编译工具所在路径而定)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
make menuconfig (或 make xconfig)
Busybox Settings --->
Build Options ---> | +-------------------------------------------------------------------------+ | | | [*] Build BusyBox as a static binary (no shared libs) | | | | [ ] Force NOMMU build | | | | [*] Build with Large File Support (for accessing files > 2 GB) | | | | () Cross Compiler prefix | | | | () Additional CFLAGS | |
miscutils/ubi_tools.c:63:26: error: mtd/ubi-user.h: No such file or directory miscutils/ubi_tools.c: In function'ubi_tools_main': miscutils/ubi_tools.c:133: error: 'UBI_DEV_NUM_AUTO' undeclared (first use in this function) miscutils/ubi_tools.c:133: error: (Each undeclared identifier is reported only once miscutils/ubi_tools.c:133: error: for each function it appears in.) miscutils/ubi_tools.c:134: error: 'UBI_VOL_NUM_AUTO' undeclared (first use in this function) miscutils/ubi_tools.c:153: error: storage size of 'req' isn't known miscutils/ubi_tools.c:161: error: 'UBI_IOCATT' undeclared (first use in this function) miscutils/ubi_tools.c:153: warning: unused variable 'req' miscutils/ubi_tools.c:167: error: 'UBI_IOCDET' undeclared (first use in this function) miscutils/ubi_tools.c:170: error: storage size of 'req' isn't known miscutils/ubi_tools.c:177: error: 'UBI_MAX_VOLUME_NAME' undeclared (first use in this function) miscutils/ubi_tools.c:184: error: 'UBI_STATIC_VOLUME' undeclared (first use in this function) miscutils/ubi_tools.c:186: error: 'UBI_DYNAMIC_VOLUME' undeclared (first use in this function) miscutils/ubi_tools.c:195: error: 'UBI_IOCMKVOL' undeclared (first use in this function) miscutils/ubi_tools.c:170: warning: unused variable 'req' miscutils/ubi_tools.c:201: error: 'UBI_IOCRMVOL' undeclared (first use in this function) miscutils/ubi_tools.c:204: error: storage size of 'req' isn't known miscutils/ubi_tools.c:214: error: 'UBI_IOCRSVOL' undeclared (first use in this function) miscutils/ubi_tools.c:204: warning: unused variable 'req' miscutils/ubi_tools.c:222: error: 'UBI_IOCVOLUP' undeclared (first use in this function) make[1]: *** [miscutils/ubi_tools.o] Error 1 make: *** [miscutils] Error 2
cd /opt/arm-2007q1/arm-none-linux-gnueabi/libc/lib cp -arfv * /home/at91sam9/mdk9261/rootfs/jffs2/lib/
6.制作jffs2根文件系统映像
1 2 3 4 5
cd /home/at91sam9/mdk9261/rootfs wget ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-1.1.0.tar.bz2 tar -xvjf mtd-utils-1.1.0.tar.bz2 cd mtd-utils-1.1.0 make