define-alpine/qemu.sh

17 lines
494 B
Bash
Raw Normal View History

2022-06-18 00:06:19 +00:00
#!/bin/sh
if test "$NOGRAPHIC" = true; then
append="console=ttyS0"
qemuappend="-nographic"
fi
2022-06-18 15:05:18 +00:00
qemu-img create -f qcow2 tmp.qcow2 1G
mkfs.ext4 tmp.qcow2
sudo chown root:$(id -u) -R boot/ && sudo chmod g+rw -R boot/
2022-06-18 00:06:19 +00:00
qemu-system-x86_64 -enable-kvm -m 2048 \
-drive file=image.squashfs,media=disk \
2022-06-18 15:05:18 +00:00
-drive file=tmp.qcow2,media=disk \
2022-06-18 00:06:19 +00:00
-kernel boot/vmlinuz-virt -initrd boot/initramfs-virt \
2022-06-18 15:05:18 +00:00
-append "root=/dev/sda rootfstype=squashfs modules=ext4 init=/sbin/runit-init $append" $qemuappend