1

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
HotSauce
  • 23
  • 4
  • 1
    Try reconfiguring your kernel to include runtime debugging capability such as detecting soft/hard lockups and hung tasks. Enable a watchdog timer. Have you been able to validate your **Busybox** executable? FWIW your script can produce a viable initramfs. I got it to work on a real SBC, although my **/dev** has a devtmpfs, and my **Busybox** was not statically linked so **/lib** has a linker and two shared libraries. All the executables came from a Buildroot project, so all were known to be good. – sawdust May 14 '23 at 20:54
  • Hi @sawdust thank you for your fantastic response and apologies for the late reply. I have done all as you suggested, I am still having the same issue however and I am going to take it to a lower level and try debug through the hardware – HotSauce May 24 '23 at 09:31

0 Answers0