hi,
i'm trying build a minimal rootfs with busybox/uClibc. i took the following files/links from ELDK-uClibc-4.1 (arm-linux) and put them into /lib of the target:
-rwxr-xr-x 1 root root 24044 2007-04-13 12:32 ld-uClibc-0.9.27.so lrwxrwxrwx 1 root root 19 2007-04-13 11:03 ld-uClibc.so.0 -> ld- uClibc-0.9.27.so
-rw-r--r-- 1 root root 10968 2007-04-13 12:30 libcrypt-0.9.27.so lrwxrwxrwx 1 root root 13 2007-04-13 11:03 libcrypt.so ->
libcrypt.so.0 lrwxrwxrwx 1 root root 18 2007-04-13 11:03 libcrypt.so.0 ->
libcrypt-0.9.27.so lrwxrwxrwx 1 root root 9 2007-04-13 11:03 libc.so -> libc.so.0 lrwxrwxrwx 1 root root 19 2007-04-13 11:03 libc.so.0 ->
libuClibc-0.9.27.so
-rw-r--r-- 1 root root 44540 2007-04-13 12:31 libgcc_s.so.1
-rw-r--r-- 1 root root 81512 2007-04-13 12:30 libm-0.9.27.so lrwxrwxrwx 1 root root 9 2007-04-13 11:03 libm.so -> libm.so.0 lrwxrwxrwx 1 root root 14 2007-04-13 11:03 libm.so.0 ->
libm-0.9.27.so
-rw-r--r-- 1 root root 309984 2007-04-13 12:30 libuClibc-0.9.27.so
/bin contains busybox (also from ELDK) and the sh symlink:
-rwxr-xr-x 1 root root 555364 2007-04-13 13:05 busybox lrwxrwxrwx 1 root root 7 2007-04-13 12:16 sh -> busybox
further there is /dev/console and /etc/init.d/rcS
linux complains about the file format of libc when trying to start init:
VFS: Mounted root (jffs2 filesystem). Mounted devfs on /dev Freeing init memory: 100K /bin/sh: '/lib/libc.so.0' is not an ELF file /bin/sh: '/lib/libc.so.0' is not an ELF file /bin/sh: can't load library 'libc.so.0' Kernel panic - not syncing: Attempted to kill init!
according to the output of 'file' and 'readelf' libc.so (or at least the file it indirectly links to (is and ELF file:
file libuClibc-0.9.27.so libuClibc-0.9.27.so: ELF 32-bit LSB shared object, ARM, version 1, stripped
readelf -h libc.so ELF Header: Magic: 7f 45 4c 46 01 01 01 61 00 00 00 00 00 00 00 00 Class: ELF32 ...
digging in the ELDK files i found arm/lib/ldscripts/ and copied it to / lib of the target
VFS: Mounted root (jffs2 filesystem). Mounted devfs on /dev Freeing init memory: 100K Argh. Special inode #24 with mode 0xa1ff had more than one node /bin/sh: can't load library 'libm.so.0' Kernel panic - not syncing: Attempted to kill init!
any idea what this special inode message is about?
in the first attempt to copy ldscripts to /lib i commited an error and copied it to the targets / instead, with the surprising result that it worked:
VFS: Mounted root (jffs2 filesystem). Mounted devfs on /dev Freeing init memory: 100K
Please press Enter to activate this console. :/>
though i'm now able to boot the system i'm quite confused about this behaviour and would like to understand it (and if possible not being obliged to have ldscripts in /), could anyone please give me an explication?
thanks in advance
Matthias