From fe7e74d567537d39020c22fad573b77aed2aa017 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 22 Apr 2025 16:09:23 +0200 Subject: bin: Force a busybox path when running QEMU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running QEMU/RISC-V, force the user to provide the `BUSYBOX_SRC` environment variable. This variable points to the path where busybox has been built. This way the path to the initramfs is not hardcoded. Moreover, this allows us to rebuilt the initramfs every time the `run-riscv-qemu.sh` is called, which in turn brings some consistency to the process. Plus, this opens the door for allowing files to be passed into a new `/home` directory for the current user. This way, someone can just statically compile a binary via cross compilation, and then run it in isolation with QEMU/RISC-V. Last but not least, also update the .bashrc file with a value for `BUSYBOX_SRC` on my system. Signed-off-by: Miquel Sabaté Solà --- .bashrc | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.bashrc') diff --git a/.bashrc b/.bashrc index 76ff96a..3c75c5e 100644 --- a/.bashrc +++ b/.bashrc @@ -168,6 +168,10 @@ if [ "$(uname -m)" != "riscv64" ]; then export CROSS_COMPILE=riscv64-suse-linux- fi +# I have built a local busybox so I can generate an initramfs for various +# hacking thingies, let's reference it into an environment variable. +export BUSYBOX_SRC="$HOME/src/busybox/1.36.1" + ## # Lastly I had some problems with the GPG agent recently. So I copied a solution # from https://github.com/jessfraz/dotfiles -- cgit v1.2.3