19 lines
593 B
Bash
Executable File
19 lines
593 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if test "$NOGRAPHIC" = true; then
|
|
append="console=ttyS0"
|
|
qemuappend="-nographic"
|
|
fi
|
|
|
|
fallocate --length 1G tmp.ext4
|
|
mkfs.ext4 -F tmp.ext4
|
|
|
|
sudo chown root:$(id -u) -R boot/ && sudo chmod g+rw -R boot/
|
|
qemu-system-x86_64 -enable-kvm -m 2048 \
|
|
-drive file=image.squashfs,media=disk,format=raw \
|
|
-drive file=tmp.ext4,media=disk,format=raw \
|
|
-net nic,model=virtio-net-pci \
|
|
-net user,hostfwd=tcp:10.69.0.2:8080-:80 \
|
|
-kernel boot/vmlinuz-virt -initrd boot/initramfs-virt \
|
|
-append "root=/dev/sda rootfstype=squashfs modules=ext4 quiet init=/sbin/runit-init $append" $qemuappend
|