[yocto] [prelink-cross] /sbin/init not working after prelink-cross

Mark Hatle mark.hatle at windriver.com
Sat Nov 7 12:06:15 PST 2015


On 11/7/15 11:08 AM, Denton Gentry wrote:
> I'm attempting to use prelink-cross on two different platforms, both
> of which run into the same symptoms. The two platforms are:
>     + ARM, Linux 3.2, glibc
>     + MIPS, Linux 4.1, uclibc

As far as I am aware, the prelinker does not work with uClibc at all.  So I'm
not surprised if the MIPS case breaks.

Do you know if it has worked at all in the past with uClibc?

As for ARM, what version of glibc is being used, and which ARM core is the
system targeting?

I believe that the ARM & glibc issues were resolved.  So you may have found a
new unknown issues.

If you are able to, I'd suggesting building the prelink-cross branch on the
target system, (autoreconf -if ; configure ; make) and then run the 'make
testsuite' and see if you get any errors.  (You should get 3 skips and the rest
pass.  If not, then something in your configuration may be causing a problem.)

The other thing to look into on ARM, since it appears you are likely using older
versions of the tools, would be to try an older version of the prelinker and see
if that works.  If it does, we can attempt to go through the patches and
identify what triggered the failure mode on your machine.

Please open a defect for the glibc case in the yoctoproject bugzilla, make sure
the component in the prelinker -- and as as much information as you can about
your configuration.  (If I can find a way to reproduce it, I'm more likely to be
able to figure out the issue as well.)

--Mark


> I'm using sysvinit 2.88 on both.
> I'm using prelink-cross-20151030_cross.
> 
> 
> My prelink command is:
> prelink --verbose --config-file /etc/prelink.conf --cache-file
> /etc/prelink.cache --root=./target/
> --ld-library-path=/lib:/usr/lib:/usr/local/lib:/chrome/lib:/chrome
> --all
> 
> The uclibc system adds "--dynamic-linker=/lib/ld-uClibc.so.0" to the
> prelink command.
> 
> 
> If /sbin/init is statically linked, the kernel is able to run
> /sbin/init but init cannot run any processes:
> 
> [   10.035122] Mounted root='/dev/mtdblock13' (verity)
> [   10.052350] Looking for init in rootfs.  To bypass this, use init=/bin/sh
> [   10.059559] Trying '/rootfs/sbin/init'
> INIT: version 2.88 booting
> INIT: Entering runlevel: 1
> INIT: Id "S0" respawning too fast: disabled for 5 minutes
> INIT: Id "USB0" respawning too fast: disabled for 5 minutes
> INIT: no more processes left in this runlevel
> 
> 
> If /sbin/init is dynamically linked, the kernel panics when it tries
> to run init:
> 
> [   10.066521] Mounted root='/dev/mtdblock13' (verity)
> [   10.082536] Looking for init in rootfs.  To bypass this, use init=/bin/sh
> [   10.089509] Trying '/rootfs/sbin/init'
> [   10.228603] Kernel panic - not syncing: Attempted to kill init!
> [   10.234639] [<840111e1>] (unwind_backtrace+0x1/0x8c) from
> [<842cee3d>] (panic+0x5d/0x134)
> [   10.242879] [<842cee3d>] (panic+0x5d/0x134) from [<84029dc5>]
> (do_exit+0x239/0x538)
> [   10.250570] [<84029dc5>] (do_exit+0x239/0x538) from [<8402a12d>]
> (do_group_exit+0x4d/0x70)
> [   10.258889] [<8402a12d>] (do_group_exit+0x4d/0x70) from
> [<84033c9d>] (get_signal_to_deliver+0x379/0x40c)
> [   10.268429] [<84033c9d>] (get_signal_to_deliver+0x379/0x40c) from
> [<8400ee01>] (do_signal+0x38d/0x3c0)
> [   10.277790] [<8400ee01>] (do_signal+0x38d/0x3c0) from [<8400f027>]
> (do_notify_resume+0xf/0x28)
> [   10.286457] [<8400f027>] (do_notify_resume+0xf/0x28) from
> [<8400caed>] (work_pending+0x23/0x26)
> [   10.295204] CPU1: stopping
> [   10.297935] [<840111e1>] (unwind_backtrace+0x1/0x8c) from
> [<8401088d>] (handle_IPI+0xcd/0x104)
> [   10.306583] [<8401088d>] (handle_IPI+0xcd/0x104) from [<8400c553>]
> (__irq_svc+0x33/0xb8)
> [   10.314708] [<8400c553>] (__irq_svc+0x33/0xb8) from [<8400d5e8>]
> (default_idle+0x18/0x1c)
> [   10.322921] [<8400d5e8>] (default_idle+0x18/0x1c) from [<8400d6c5>]
> (cpu_idle+0x61/0x94)
> [   10.331045] [<8400d6c5>] (cpu_idle+0x61/0x94) from [<042cb779>] (0x42cb779)
> [   10.338036] Rebooting in 3 seconds..
> 
> 
> This makes it look like the dynamic linker cannot handle prelinked
> binaries. However if I only prelink a single binary (plus the
> libraries it depends on), the prelinked binary is able to run without
> issue.
> 
> I'm hoping these symptoms will look familiar to someone, before I go
> dig into the kernel's handling of /sbin/init to try to figure out why
> it fails.
> 




More information about the yocto mailing list