Re: linuxrc, initrd and shared libraries
- From: Douglas Mayne <doug@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 25 Aug 2006 21:24:26 -0600
On Fri, 25 Aug 2006 23:19:26 +0200, Jiri Skiskibowski wrote:
Hi,The initrd must be complete enough to act as a root filesystem. Any
I am trying to set up an inital ramdisk which contains a linuxrc script. A
test version of this linuxrc looks like this:
-------------------- linuxrc --------------------
#!/bin/sh
#
# $Id: linuxrc,v 1.11 2004/04/26 12:04:46 herbert Exp $
export PATH=/sbin:/bin
export LD_LIBRARY_PATH=/lib:/lib/tls
mount
-------------------------------------------------
The mount command ends up with this error:
./linuxrc: 3 mount: not found
The mount command needs these libraires:
ldd /bin/mount
libc.so.6 => /lib/tls/libc.so.6 (0xb7ea6000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fe0000)
My initrd contains these files:
vdr:~# ls -l /mnt/bin
total 361
-rwxr-xr-x 1 root root 86616 Jan 1 1970 awk
-rwxr-xr-x 1 root root 16504 Jan 1 1970 cat
-rwxr-xr-x 1 root root 83960 Jan 1 1970 dash
-rwxr-xr-x 1 root root 28588 Jan 1 1970 dd
-rwxr-xr-x 1 root root 75 Jan 1 1970 echo
-rwxr-xr-x 1 root root 19180 Jan 1 1970 mknod
-rwsr-xr-x 1 root root 76888 Jan 1 1970 mount
lrwxrwxrwx 1 root root 4 Jan 1 1970 sh -> dash
-rwsr-xr-x 1 root root 39960 Jan 1 1970 umount
-rwxr-xr-x 1 root root 13848 Jan 1 1970 uname
vdr:~# ls -l /mnt/etc/
total 2
-rw-r--r-- 1 root root 584 Jan 1 1970 ld.so.cache
drwxr-xr-x 1 root root 44 Jan 1 1970 modprobe.d
-rw-r--r-- 1 root root 0 Jan 1 1970 mtab
vdr:~# ls -l /mnt/lib/
total 229
-rwxr-xr-x 1 root root 90248 Jan 1 1970 ld-linux.so.2
-rw-r--r-- 1 root root 23504 Jan 1 1970 libblkid.so.1
-rw-r--r-- 1 root root 5900 Jan 1 1970 libcom_err.so.2
-rw-r--r-- 1 root root 16720 Jan 1 1970 libe2p.so.2
-rw-r--r-- 1 root root 86564 Jan 1 1970 libext2fs.so.2
-rw-r--r-- 1 root root 9128 Jan 1 1970 libuuid.so.1
drwxr-xr-x 1 root root 24 Jan 1 1970 modules
drwxr-xr-x 1 root root 48 Jan 1 1970 tls
vdr:~# ls -l /mnt/lib/tls
total 1357
-rwxr-xr-x 1 root root 1254468 Jan 1 1970 libc.so.6
-rw-r--r-- 1 root root 134496 Jan 1 1970 libm.so.6
All this is done with Debian 3.1 and Kernel 2.6.17.8
What is wrong with my initrd?
Thanks,
Jiri
commands which will be issued, need to be available and have no broken
library links. One simple way to test an initrd is to chroot to it. If
there are no errors and you can issue commands, then you can try booting
using it. But if that fails, you will need to fix broken links,
probably by adding libraries. Another quick way of building a more
complete initrd is by compiling and using busybox.
This example corrects one common mistake, bad library dependancies.
Assume you have an initrd mounted on loopback at /mnt/initrd-test
# ldconfig -r /mnt/initrd-test
# cd /mnt/initrd-test
# chroot .
:
:
:
# exit
--
Douglas Mayne
.
- References:
- linuxrc, initrd and shared libraries
- From: Jiri Skiskibowski
- linuxrc, initrd and shared libraries
- Prev by Date: Re: linuxrc, initrd and shared libraries
- Next by Date: Re: Blank text in Flash
- Previous by thread: Re: linuxrc, initrd and shared libraries
- Index(es):
Relevant Pages
|