VFS: Mounted root (cramfs filesystem) readonly. Freeing init memory: 124K cramfs: bad compressed blocksize 989432407 cramfs: bad compressed blocksize 4274059297 Failed to execute /linuxrc. Attempting defaults... Kernel panic - not syncing: No init found. Try passing init= option to kernel. |
#ARCH ?= $(SUBARCH) #CROSS_COMPILE ?= ARCH := arm CROSS_COMPILE := $HOME/toolchain/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux-gnu/bin/arm-linux-gnu- |
//#if ENABLE_STATIC && defined(__GLIBC__) && !defined(__UCLIBC__) #if 0 #warning Static linking against glibc produces buggy executables #warning (glibc does not cope well with ld --gc-sections). #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 #warning Note that glibc is unsuitable for static linking anyway. #warning If you still want to do it, remove -Wl,--gc-sections #warning from scripts/trylink and remove this warning. #error Aborting compilation. #endif |
applets/applets.c:15:2: warning: #warning Static linking against glibc produces buggy executables applets/applets.c:16:2: warning: #warning (glibc does not cope well with ld --gc-sections). applets/applets.c:17:2: warning: #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 applets/applets.c:18:2: warning: #warning Note that glibc is unsuitable for static linking anyway. applets/applets.c:19:2: warning: #warning If you still want to do it, remove -Wl,--gc-sections applets/applets.c:20:2: warning: #warning from scripts/trylink and remove this warning. applets/applets.c:21:2: #error Aborting compilation. make[1]: *** [applets/applets.o] 错误 1 make: *** [applets] 错误 2 |
$ make defconfig |
$ make menuconfig |
$ make xconfig |
$ make install |
-------------------------------------------------- You will probably need to make your busybox binary setuid root to ensure all configured applets will work properly. -------------------------------------------------- |
drwxr-xr-x 5 wang wang 4096 2008-09-10 17:32 . drwxr-xr-x 32 wang wang 4096 2008-09-10 17:32 .. drwxr-xr-x 2 wang wang 4096 2008-09-10 17:32 bin lrwxrwxrwx 1 wang wang 11 2008-09-10 17:32 linuxrc -> bin/busybox drwxr-xr-x 2 wang wang 4096 2008-09-10 17:32 sbin drwxr-xr-x 4 wang wang 4096 2008-09-10 17:32 usr |
$ chmod 4755 ./_install/bin/busybox |
$ rm ./_install/linuxrc |
$ tar cvf 1.tar ./install/ |
$ mkdir /opt/rootfs $ cd /opt/rootfs $ mkdir bin dev etc home lib mnt proc sbin sys tmp var usr $ mkdir etc/init.d |
$ vim linuxrc |
#!/bin/sh echo "mount /etc as ramfs" /bin/mount -f -t cramfs -o remount,ro /dev/bon/2 / /bin/mount -t ramfs ramfs /var /bin/mkdir -p /var/tmp /bin/mkdir -p /var/run /bin/mkdir -p /var/log /bin/mkdir -p /var/lock /bin/mkdir -p /var/empty #/bin/mount -t usbdevfs none /proc/bus/usb exec /sbin/init |
$ chmod 775 linuxrc |
$ vim etc/init.d/rcS |
#!/bin/sh # mount all filesystem defined in "fstab" echo "#mount all......." /bin/mount -a |
$ chmod 775 etc/init.d/rcS |
$ vim etc/inittab |
# This is run first except when booting ::sysinit:/etc/init.d/rcS # Start an "askfirst" shell on the console #::askfirst:-/bin/bash ::askfirst:-/bin/sh # Stuff to do when restarting the init process ::restart:/sbin/init # Stuff to do before rebooting ::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount -a -r |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |