2009年9月2日 星期三

* busybox : /bin/sh : app not found

建立好的Busybox,我build 其他的application(alsa-utils) 出現 -/bin/sh : aplay not found
後來發現需要copy tools chain /lib 和 /libc to embedded root file system 當中

* How to build busybox

#make menuconfig ARCH=arm CROSS_COMPILE=arm-none-linux-
Select
Location:
x -> Busybox Settings
x -> Build Options
x -> Build shared libbusybox (BUILD_LIBBUSYBOX [=y])

#make ARCH=arm CROSS_COMPILE=arm-none-linux-
#make install ARCH=arm CROSS_COMPILE=arm-none-linux-
Then, copy them into system rootfs
#sudo cp -dpR _install/* /work/nfs

*Create rootfs
#mkdir bin dev etc home lib mnt proc root sbin tmp usr var sys
#mkdir usr/bin usr/sbin
# mkdir mnt tmp var
# chmod 1777 tmp
# mkdir var/lib var/lock var/log var/run var/tmp
# chmod 1777 var/tmp

*make device node
./dev
#sudo mknod -m 600 dev/console c 5 1
#sudo mknod -m 666 dev/null c 1 3

* Create /etc/init.d/rcS

* Copy toolchain libc......xxx files into /lib in rootfs
ld-2.5.so libc.so.6 libgcc_s.so.1 libnss_dns-2.5.so
libnss_nisplus-2.5.so librt.so.1 ld-linux.so.3 libcidn-2.5.so
libm-2.5.so libnss_dns.so.2 libnss_nisplus.so.2 libthread_db-1.0.so libBrokenLocale-2.5.so libcidn.so.1 libm.so.6 libnss_files-2.5.so libpcprofile.so libthread_db.so.1 libBrokenLocale.so.1 libcrypt-2.5.so libmemusage.so libnss_files.so.2 libpthread-2.5.so libutil-2.5.so libSegFault.so libcrypt.so.1 libnsl-2.5.so libnss_hesiod-2.5.so libpthread.so.0 libutil.so.1 libanl-2.5.so libdl-2.5.so libnsl.so.1 libnss_hesiod.so.2 libresolv-2.5.so libanl.so.1 libdl.so.2 libnss_compat-2.5.so libnss_nis-2.5.so libresolv.so.2 libc-2.5.so libgcc_s.so libnss_compat.so.2 libnss_nis.so.2 librt-2.5.so

*Change busybox mode
#chmod 4755 ./bin/buxybox

之前遇到兩個問題
1. busybox : -/bin/sh :app not found
2. init= not found when using Build shared libbusybox configuration
結果都是需要 copy toolchain 相關的 ./libxxx.so.x 到 filesystem

弄了好幾天才搞定ㄟ

reference:

http://www.lupaworld.com/home/space-345712-do-blog-id-128444.html

http://blog.chinaunix.net/u2/70445/showart_1150301.html

沒有留言:

張貼留言