Files
omarchy-iso/bin/omarchy-iso-boot
T
Ryan HughesandDavid Heinemeier Hansson f4b6222c1c Preserve firmware with reuse + use local pacman cache if you have it (#28)
* Keep firmware vars too if we run as reuse

* Leverage local cache for faster builds if we have it

* Convenience

* Also set the URL

* Normally do want boot

---------

Co-authored-by: David Heinemeier Hansson <david@hey.com>
2025-08-30 08:37:37 +02:00

36 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "Usage: omarchy-iso-boot [release/omarchy.iso] [reuse]"
exit 1
fi
if ! pacman -Q qemu-full >/dev/null || ! pacman -Q edk2-ovmf >/dev/null; then
sudo pacman -S --noconfirm --needed --quiet qemu-full edk2-ovmf
fi
DISK="/tmp/omarchy-iso-boot.qcow2"
if [[ ! -f $DISK || $2 != "reuse" ]]; then
qemu-img create -f qcow2 "$DISK" 20G
cp /usr/share/edk2/x64/OVMF_VARS.4m.fd /tmp/OVMF_VARS.4m.fd
fi
# Boot from ISO before we've installed, then boot from drive after
qemu-system-x86_64 \
-cpu host -enable-kvm -machine q35,accel=kvm \
-smp "$(nproc)" \
-m 8192 \
-drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd \
-drive if=pflash,format=raw,file=/tmp/OVMF_VARS.4m.fd \
-drive file="$DISK",format=qcow2,if=none,id=drive0 \
-device virtio-blk-pci,drive=drive0,bootindex=1 \
-drive file="$1",media=cdrom,if=none,format=raw,id=cdrom0 \
-device ide-cd,drive=cdrom0,bootindex=2 \
-device virtio-vga-gl \
-display gtk,gl=on \
-usb -device usb-tablet \
-netdev user,id=net0 \
-device virtio-net-pci,netdev=net0