What is the first steps in diagnosing a hanging init?

335 Views Asked by At

Context:
I aim to boot a busybox environment on a simulated Rocket-cored SoC using litex_sim, through the use of OpenSBI+linux. Upon reaching the point where the init process is started, the application hangs. See below:

[    6.463240] Run /init as init process
[    6.463707]   with arguments:
[    6.463986]     /init
[    6.464259]   with environment:
[    6.464525]     HOME=/
[    6.464768]     TERM=linux

If anyone is keen to replicate:

  • Litex: 3ab7ebe5367f716a2103d17086934bb999649063
  • OpenSBI:2868f26131308ff345382084681ea89c5b0159f1
  • [Linux][https://github.com/litex-hub/linux.git/]: (branch: litex-rebase) 68cfb31f2488bc8320e5b6cb5d131205870e5d9b
  • Busybox: v1.36.0
  • riscv64-unknown-elf-gcc: v12.1.0

Current configuration: Busybox suite within initramfs which is embedded into kernel image. OpenSBI in fw_payload which contains kernel image.

Script to build initramfs:

#!/bin/bash
rm -rf initramfs
rm -rf initramfs.cpio
mkdir initramfs
pushd initramfs
mkdir -p bin sbin lib etc dev home proc sys tmp mnt nfs root \
          usr/bin usr/sbin usr/lib
sudo mknod -m 622 dev/console c 5 1
sudo mknod -m 622 dev/tty0 c 4 0
cp ../busybox_git/busybox bin/
ln -s bin/busybox ./init
cat > etc/inittab <<- "EOT"
::sysinit:/bin/busybox mount -t proc proc /proc
::sysinit:/bin/busybox mount -t devtmpfs devtmpfs /dev
::sysinit:/bin/busybox mount -t tmpfs tmpfs /tmp
::sysinit:/bin/busybox mount -t sysfs sysfs /sys
::sysinit:/bin/busybox --install -s
/dev/console::sysinit:-/bin/ash
EOT
fakeroot <<- "EOT"
find . | cpio -H newc -o > ../initramfs.cpio
EOT
popd
0

There are 0 best solutions below