[Clfs-support] libraries for booting temporary system

Joe Ciccone jciccone at gmail.com
Sat Jul 18 17:49:32 PDT 2009


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




More information about the Clfs-support mailing list