--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: grub error: "libm.so.6: cannot open shared object file: No such file or directory"
- From: Giuseppe Sacco <eppesuig@debian.org>
- Date: Thu, 21 Apr 2011 15:29:03 +0200
- Message-id: <1303392543.5696.27.camel@scarafaggio>
Package: initramfs-tools
Version: 0.98.8
Severity: important
Hi all,
I am trying to setup a 64 bit machine with Debian squeeze. After the
installation complete (this is a special crafted installation with mixed
32bit and 64bit executables) the machine cannot boot anymore.
The bootloader is grub-pc. It starts, then load kernel and initrd,
uncompress initrd and tries to run the shell. This is where it fails
giving the error "libm.so.6: cannot open shared object file: No such
file or directory".
I booted via a cdrom (debian 6.0 live rescue amd64), mounted all volumes
in /mnt (and subdirs) and chroot'ed into it.
Then, I went to /boot and uncompress the initrd image. This is what I
can see:
root@debian:/boot/f# ls -l
total 36
drwxr-xr-x 2 root root 4096 Apr 21 15:07 bin
drwxr-xr-x 3 root root 4096 Apr 21 14:28 conf
drwxr-xr-x 5 root root 4096 Apr 21 14:28 etc
-rwxr-xr-x 1 root root 5955 Apr 21 14:28 init
drwxr-xr-x 4 root root 4096 Apr 21 14:28 lib
drwxr-xr-x 2 root root 4096 Apr 21 14:28 lib64
drwxr-xr-x 2 root root 4096 Apr 21 14:28 sbin
drwxr-xr-x 6 root root 4096 Apr 21 14:28 scripts
root@debian:/boot/f# ldd bin/sh
linux-vdso.so.1 => (0x00007ffff936d000)
libm.so.6 => /lib64/libm.so.6 (0x00007f0146f8b000)
libc.so.6 => /lib64/libc.so.6 (0x00007f0146c2a000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0147213000)
root@debian:/boot/f# ls -l /lib64/libm.so.6 /lib64/libc.so.6 /lib64/ld-linux-x86-64.so.2
lrwxrwxrwx 1 root root 12 Apr 19 18:57 /lib64/ld-linux-x86-64.so.2 -> ld-2.11.2.so
lrwxrwxrwx 1 root root 14 Apr 19 18:57 /lib64/libc.so.6 -> libc-2.11.2.so
lrwxrwxrwx 1 root root 14 Apr 19 18:57 /lib64/libm.so.6 -> libm-2.11.2.so
root@debian:/boot/f# ls -l lib64/libm.so.6 lib64/libc.so.6 lib64/ld-linux-x86-64.so.2
-rwxr-xr-x 1 root root 128744 Apr 21 14:28 lib64/ld-linux-x86-64.so.2
-rwxr-xr-x 1 root root 1432968 Apr 21 14:28 lib64/libc.so.6
-rw-r--r-- 1 root root 530736 Apr 21 14:28 lib64/libm.so.6
root@debian:/boot/f# bin/sh
BusyBox v1.17.1 (Debian 1:1.17.1-8) built-in shell (ash)
Enter 'help' for a list of built-in commands.
/boot/f # exit
root@debian:/boot/f# chroot . bin/sh
bin/sh: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory
root@debian:/boot/f# chroot . lib64/ld-linux-x86-64.so.2 bin/sh
bin/sh: error while loading shared libraries: libm.so.6: cannot open shared object file: No such file or directory
root@debian:/boot/f# file bin/sh lib64/libm.so.6
bin/sh: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped
lib64/libm.so.6: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
root@debian:/boot/f# diff /lib64/libc-2.11.2.so lib64/libc.so.6
root@debian:/boot/f# diff /lib64/libm-2.11.2.so lib64/libm.so.6
As you may see all program work correctly. I may even run busybox on the
main system, but if I try to run it inside the initramfs image then it
fails.
I tried to create the initrd image from scratch but it does not solve
the problem. The command I used is:
root@debian:/boot/f# update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.img-2.6.32-5-amd64
W: Possible missing firmware /lib/firmware/tigon/tg3_tso5.bin for module tg3
W: Possible missing firmware /lib/firmware/tigon/tg3_tso.bin for module tg3
W: Possible missing firmware /lib/firmware/tigon/tg3.bin for module tg3
Any hints on what to do next?
I thank you very much,
Giuseppe
--- End Message ---
--- Begin Message ---
- To: Ben Hutchings <ben@decadent.org.uk>
- Cc: 623584-done@bugs.debian.org
- Subject: Re: Bug#623584: initramfs-tools create a wrong directory tree
- From: Giuseppe Sacco <eppesuig@debian.org>
- Date: Wed, 27 Apr 2011 11:24:32 +0200
- Message-id: <1303896272.6044.20.camel@scarafaggio>
- In-reply-to: <1303482914.4129.39.camel@localhost>
- References: <1303457811.4695.23.camel@scarafaggio> <1303482914.4129.39.camel@localhost>
Hi Ben,
thanks for helping on this bug report.
On ven, 2011-04-22 at 15:35 +0100, Ben Hutchings wrote:
> On Fri, 2011-04-22 at 09:36 +0200, Giuseppe Sacco wrote:
> > Hi,
> > I made a few tests on this report and I found that the loader is not
> > looking at the right directories. Please have a look at this:
> [...]
> > Please note that on both system (outside of chroot) /lib64 is a link
> > to /lib.
>
> I think that's normal; however /lib should be higher up the library
> search path than /lib64.
>
> What does 'ldd /bin/sh' say in the running system?
root@debian:/# ls -l /bin/sh /bin/busybox
-rwxr-xr-x 1 root root 516440 15 nov 16.22 /bin/busybox
lrwxrwxrwx 1 root root 4 19 apr 18.58 /bin/sh -> dash
root@debian:/# ldd /bin/busybox
linux-vdso.so.1 => (0x00007fffbb92a000)
libm.so.6 => /lib64/libm.so.6 (0x00007f1f1a81c000)
libc.so.6 => /lib64/libc.so.6 (0x00007f1f1a4bb000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1f1aaa4000)
root@debian:/# ldd /bin/dash
linux-vdso.so.1 => (0x00007fff028dd000)
libc.so.6 => /lib64/libc.so.6 (0x00007f121dc5c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f121dfc3000)
but this was the real problem. When I saw this, I run ldconfig manually,
and now ldd works as expected (and initramfs-tools also):
root@debian:/etc/ld.so.conf.d# ldd /bin/busybox
linux-vdso.so.1 => (0x00007fff663ff000)
libm.so.6 => /lib/libm.so.6 (0x00007f71bfebc000)
libc.so.6 => /lib/libc.so.6 (0x00007f71bfb5b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f71c0143000)
Bye,
Giuseppe
--- End Message ---