From 384045c2fd5a056163b215713ebacd770eb2ad55 Mon Sep 17 00:00:00 2001 From: Softer Date: Wed, 3 Jun 2026 17:02:37 +0300 Subject: [PATCH] Move dev VM script to test_tooling/dev_vm/, update paths and README --- .gitignore | 2 +- README.md | 18 +++++++++++++++++ .../dev_vm}/derive_packages.py | 0 {scripts => test_tooling/dev_vm}/dev_vm.sh | 20 +++++++++---------- 4 files changed, 29 insertions(+), 11 deletions(-) rename {scripts => test_tooling/dev_vm}/derive_packages.py (100%) rename {scripts => test_tooling/dev_vm}/dev_vm.sh (93%) diff --git a/.gitignore b/.gitignore index 0d3c150a..cef909bf 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ SAFETY_LOCK **/**.egg* **/**.sh !archinstall/locales/locales_generator.sh -!scripts/dev_vm.sh +!test_tooling/dev_vm/dev_vm.sh **/**.egg-info/ **/**build/ **/**src/ diff --git a/README.md b/README.md index 4e6847f4..414cbab2 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,24 @@ replace the archinstall version with a newer one and execute the subsequent step rare case it will not work is if the source has introduced any new dependencies that are not installed yet - Installing the branch version with `pip install --break-system-packages .` and `archinstall` +## Developer VM (recommended for contributors) + +The fastest way to iterate on archinstall is the dev VM script in `test_tooling/dev_vm/`. +It builds a minimal Arch ISO with runtime deps pre-installed, then launches QEMU with the +project source mounted read-only via 9p - edit code on the host, run `archinstall` in the +guest immediately, no rebuild needed. + +```shell +./test_tooling/dev_vm/dev_vm.sh # first run builds ISO, then boots +./test_tooling/dev_vm/dev_vm.sh rebuild # force rebuild ISO +./test_tooling/dev_vm/dev_vm.sh boot # boot from installed disk (no ISO) +./test_tooling/dev_vm/dev_vm.sh --bios # legacy BIOS mode +./test_tooling/dev_vm/dev_vm.sh -h # all options +``` + +Requires an Arch-based host with `qemu-base` installed. See the script header for details +on 9p shares, log streaming, and env overrides. + ## Without a Live ISO Image To test this without a live ISO, the simplest approach is to use a local image and create a loop device.
diff --git a/scripts/derive_packages.py b/test_tooling/dev_vm/derive_packages.py similarity index 100% rename from scripts/derive_packages.py rename to test_tooling/dev_vm/derive_packages.py diff --git a/scripts/dev_vm.sh b/test_tooling/dev_vm/dev_vm.sh similarity index 93% rename from scripts/dev_vm.sh rename to test_tooling/dev_vm/dev_vm.sh index 0d1cad06..8d43bcbc 100755 --- a/scripts/dev_vm.sh +++ b/test_tooling/dev_vm/dev_vm.sh @@ -18,22 +18,22 @@ # archinstall wrapper around `python -m archinstall`; clears the # log directory on every invocation # -# Run from the project root or from inside scripts/ - both work, the script -# resolves the project root from its own location. +# Run from the project root or from inside test_tooling/dev_vm/ - both work, +# the script resolves the project root from its own location. # # Usage (from project root): -# ./scripts/dev_vm.sh - build ISO if missing, fresh disk, boot -# ./scripts/dev_vm.sh rebuild | r - force rebuild ISO, fresh disk, boot -# ./scripts/dev_vm.sh keep | k - reuse disk, boot ISO -# ./scripts/dev_vm.sh boot | b - boot from installed disk (no ISO) -# ./scripts/dev_vm.sh clean | c - remove disk, NVRAM, ISO, logs -# ./scripts/dev_vm.sh -h - show this help +# ./test_tooling/dev_vm/dev_vm.sh - build ISO if missing, fresh disk, boot +# ./test_tooling/dev_vm/dev_vm.sh rebuild | r - force rebuild ISO, fresh disk, boot +# ./test_tooling/dev_vm/dev_vm.sh keep | k - reuse disk, boot ISO +# ./test_tooling/dev_vm/dev_vm.sh boot | b - boot from installed disk (no ISO) +# ./test_tooling/dev_vm/dev_vm.sh clean | c - remove disk, NVRAM, ISO, logs +# ./test_tooling/dev_vm/dev_vm.sh -h - show this help # # Firmware mode (default is UEFI 64-bit): # --bios - legacy BIOS boot (SeaBIOS, no OVMF) # # Flag can be combined with a command: -# ./scripts/dev_vm.sh --bios rebuild +# ./test_tooling/dev_vm/dev_vm.sh --bios rebuild # # Env overrides: # SCREEN_W, SCREEN_H - virtio-vga resolution (default 1280x720) @@ -44,7 +44,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +PROJECT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)" DEV_DIR="$PROJECT_DIR/.dev" CONFIGS_DIR="$DEV_DIR/configs" LOGS_DIR="$DEV_DIR/logs"