Reputation: 101
I build an embedded linux with YOCTO for the KARO TX6S-8035 target. I use the Mfgtools-TX6-2018-01 tool to flash images into the board but when i boot the device i have the following error: Kernel panic - not syncing: Requested init /linuxrc failed (error -2). How can i fix this?
Here is the result of printenv from U-BOOT: printenv
And the serial output from the board:
serial output
Upvotes: 4
Views: 5460
Reputation: 21
Kernel panic - not syncing: Requested init /linuxrc failed (error -2)
In my case, I create initrd with busybox. /linuxrc execute error, because of it can't find the dynamic library.
execute below script after mount the initrd
file linuxrc
Fix-Option1:
copy library to initrd.
mkdir -p $WORKSPACE/initrd
mount $WORKSPACE/ramdisk.img $WORKSPACE/initrd -t ext2 -o loop=/dev/loop0
pushd $WORKSPACE/initrd/
cp -rf /opt/buildtools/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/libc/lib ./
cp -rf /opt/buildtools/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/aarch64-none-linux-gnu/libc/lib64 ./
aarch64-none-linux-gnu-strip $WORKSPACE/initrd/lib/*
aarch64-none-linux-gnu-strip $WORKSPACE/initrd/lib64/*
aarch64-none-linux-gnu-strip $WORKSPACE/initrd/bin/busybox
popd
umount $WORKSPACE/initrd
gzip -9 $WORKSPACE/ramdisk.img
Fix-Option2:
build busybox statically.
make -j16 -C $WORKSPACE/$BUSYBOX ARCH="arm64" LDFLAGS="--static" CROSS_COMPILE="aarch64-none-linux-gnu-" install
Upvotes: 2
Reputation: 5866
The kernel is looking for the init program and cannot find it. Most likely your image is corrupt. More info here: What is linuxrc purpose and is it needed in the rootfs?
I would try:
Also, I do not know what setup you are using, but I would look at the FSL Community BSP. There is a good chance others are building for that platform.
Upvotes: 1