[Clfs-support] libraries for booting temporary system

Alexander Roalter alexander at roalter.it
Sun Jul 19 03:45:31 PDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joe Ciccone wrote:
> Alexander Roalter wrote:
>> after compiling the temporary system (SVN, for pure64 x86_64) and
>> booting it I got the error
>>
>> Kernel panic: no init found. Try passing init= option to kernel...
>>
>> looking into it (and comparing with my host system), /sbin/init is
>> linked shared, while my original init (opensuse 11.0) is linked static.
>> So contrary to ch. 7.5 I changed the src/Makefile in sysvinit-2.86 the
>> line LDFLAGS=-s to LDFLAGS=-s -static
>>
>> then I got a static init, and the system booted up until the shell
>> should have been started with the error: /bin/sh: No such file or
>> directory
>>
>> The problem is: all the files in /bin don't know where to look for the
>> libraries, which are located in /tools/lib, and not in /lib.
>>
>> So if I copy all files from /tools/lib to lib, everything works and I
>> get the login prompt and I also can log in...
>>
>> Now, since this is not described in the book, what has to be done that
>> the executable from the temporary system know how to find their
>> libraries? I would assume one could use ld.so.cache and set up the
>> search path to /tools/lib, but nothing of this kind is done...
>>
>> Any suggestions?
> It shoulds like you're linking against host libraries, init does not
> have to be static. My first guess would be that you did not compile gcc
> final cross (2nd gcc build) with the specs patch. This would leave your
> system attached to /lib/ld.so instead of /tools/lib/ld.so which is gone
> once you chroot/boot. You can verify this by running readelf -l
> /tools/bin/sh | grep interpreter

as expected, it returns

clfs:~$ readelf -l /tools/bin/bash | grep interpreter
      [Requesting program interpreter: /lib/ld-linux-x86-64.so.2]

which is bad.
On building GCC in chapter 6.9, even gcc-build/gcc/g++ shows the same
behavior:

clfs:~/sources/gcc-build$ readelf -l ./g++ | grep interpreter
      [Requesting program interpreter: /lib/ld-linux-x86-64.so.2]

so the modified startfile SPEC, that should look first in /tools/lib
seems not to have influenced the build... Is there something where one
can see which spec file is used?



Cheers,
Alex
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkpi+UoACgkQ1J0MF2u394yrAQCdEppDX9kM8NnpMVbab7NPuNB3
lPoAn2El76y7YYKKMWmT9cxHl2Islzlm
=0wRv
-----END PGP SIGNATURE-----



More information about the Clfs-support mailing list