Fix volume issues by mounting a dir

Extract a pre-existing image there if one doesn't already exist
This commit is contained in:
Luke Childs 2019-12-14 00:20:22 +07:00
parent e5ecf4cf75
commit 151aa1f623
2 changed files with 27 additions and 23 deletions

23
entrypoint.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/sh
image_path="/data/filesystem.img"
zip_path="/filesystem.zip"
if [ ! -e $image_path ] && [ -e $zip_path ]; then
unzip $zip_path
mv *.img $image_path
fi
exec qemu-system-arm \
-M versatilepb \
-cpu arm1176 \
-m 256M \
-hda /data/filesystem.img \
-net nic \
-net user,hostfwd=tcp::5022-:22 \
-dtb /root/qemu-rpi-kernel/versatile-pb.dtb \
-kernel /root/qemu-rpi-kernel/kernel-qemu-4.19.50-buster \
-append "root=/dev/sda2 panic=1" \
-no-reboot \
-display none \
-serial mon:stdio