Initial Das OS 0.1.0: Void Linux live ISO with Xfce
- xbps-src templates: das-theme (adw-gtk3-based GTK themes, generated xfwm4 frames, wallpapers, logo), das-settings (Xfce, panel, LightDM defaults in /etc/xdg/das), adw-gtk3 and font-jetbrains-mono - void-mklive profile in live/: packages, runit services, rootfs overlay, Ukrainian locale, live user with autologin - Void builder container, build scripts, QEMU runner and Makefile - Bilingual README with screenshots Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Executable
+76
@@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env bash
|
||||
# Boots a Das OS ISO in QEMU (KVM when available).
|
||||
#
|
||||
# Usage: scripts/run-qemu.sh [--bios] [--disk] [path/to/image.iso]
|
||||
# --bios boot with legacy BIOS instead of UEFI
|
||||
# --disk attach out/qemu/disk.qcow2 (20 GB, created on first use) to test installing
|
||||
# Without a path the newest ISO in out/iso is used.
|
||||
set -euo pipefail
|
||||
|
||||
root=$(cd "$(dirname "$0")/.." && pwd)
|
||||
state=$root/out/qemu
|
||||
firmware=uefi
|
||||
disk=false
|
||||
iso=""
|
||||
|
||||
die() {
|
||||
echo "run-qemu: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--bios) firmware=bios ;;
|
||||
--disk) disk=true ;;
|
||||
-h | --help)
|
||||
sed -n '2,8s/^# \{0,1\}//p' "$0"
|
||||
exit 0
|
||||
;;
|
||||
-*) die "unknown option: $arg" ;;
|
||||
*) iso=$arg ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -z $iso ]]; then
|
||||
iso=$(ls -t "$root"/out/iso/*.iso 2>/dev/null | head -n 1) || true
|
||||
fi
|
||||
[[ -n $iso && -f $iso ]] || die "no ISO found, run 'make iso' first"
|
||||
|
||||
args=(
|
||||
-machine q35 -smp 4 -m 4096
|
||||
-device virtio-vga -display gtk,zoom-to-fit=on
|
||||
-device virtio-net-pci,netdev=net0 -netdev user,id=net0
|
||||
-device qemu-xhci -device usb-tablet
|
||||
-cdrom "$iso" -boot order=d
|
||||
)
|
||||
|
||||
if [[ -w /dev/kvm ]]; then
|
||||
args+=(-accel kvm -cpu host)
|
||||
else
|
||||
echo "run-qemu: /dev/kvm is not accessible, falling back to slow emulation" >&2
|
||||
args+=(-accel tcg -cpu max)
|
||||
fi
|
||||
|
||||
mkdir -p "$state"
|
||||
|
||||
if [[ $firmware == uefi ]]; then
|
||||
code=""
|
||||
# Debian/Ubuntu/Mint, then Arch, then Fedora file names
|
||||
for candidate in /usr/share/OVMF/OVMF_CODE_4M.fd /usr/share/edk2/x64/OVMF_CODE.4m.fd /usr/share/edk2/ovmf/OVMF_CODE.fd; do
|
||||
[[ -f $candidate ]] && code=$candidate && break
|
||||
done
|
||||
[[ -n $code ]] || die "UEFI firmware (OVMF) not found, install the ovmf package or use --bios"
|
||||
vars_template=$(dirname "$code")/$(basename "$code" | sed 's/CODE/VARS/')
|
||||
[[ -f $state/OVMF_VARS.fd ]] || cp "$vars_template" "$state/OVMF_VARS.fd"
|
||||
args+=(
|
||||
-drive "if=pflash,format=raw,readonly=on,file=$code"
|
||||
-drive "if=pflash,format=raw,file=$state/OVMF_VARS.fd"
|
||||
)
|
||||
fi
|
||||
|
||||
if [[ $disk == true ]]; then
|
||||
[[ -f $state/disk.qcow2 ]] || qemu-img create -f qcow2 "$state/disk.qcow2" 20G
|
||||
args+=(-drive "file=$state/disk.qcow2,if=virtio,format=qcow2")
|
||||
fi
|
||||
|
||||
exec qemu-system-x86_64 "${args[@]}"
|
||||
Reference in New Issue
Block a user