[yocto] [prelink-cross] /sbin/init not working after prelink-cross
Denton Gentry
denton.gentry at gmail.com
Sat Nov 7 09:08:03 PST 2015
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
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