detached 588105a

refactor(vm): skeleton argument parsing for QEMU profile launcher

commit
588105a62fa013773c3c0561ee8310f040128ec6
author
brice · · 2026-02-27 04:36 UTC
parent
bea76ec
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +20 -12
M test/vm/start-qemu-installed.sh +20 -12
@@ -1,16 +1,24 @@
11 #!/bin/bash
2-# Start installed Arch system in QEMU with UEFI support and SSH access
2+# Start installed Arch system in QEMU with realistic hardware profile
3+# Usage: ./start-qemu-installed.sh [--profile desktop|laptop] [--secure-boot on|off] [--ssh-port PORT]
4+set -euo pipefail
35
4-# Get test directory
56 TEST_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
67
7-qemu-system-x86_64 \
8- -enable-kvm \
9- -m 2048 \
10- -smp 2 \
11- -bios /usr/share/edk2/x64/OVMF.4m.fd \
12- -drive file="$TEST_DIR/arch-test.qcow2",format=qcow2,if=virtio \
13- -display gtk \
14- -vga virtio \
15- -net nic,model=virtio \
16- -net user,hostfwd=tcp::2222-:22
8+PROFILE="desktop"
9+SECURE_BOOT="off"
10+SSH_PORT="2222"
11+
12+while [[ $# -gt 0 ]]; do
13+ case "$1" in
14+ --profile) PROFILE="$2"; shift 2 ;;
15+ --secure-boot) SECURE_BOOT="$2"; shift 2 ;;
16+ --ssh-port) SSH_PORT="$2"; shift 2 ;;
17+ *) echo "Unknown flag: $1"; exit 1 ;;
18+ esac
19+done
20+
21+source "$TEST_DIR/lib/qemu-profile.sh"
22+build_qemu_args "$PROFILE" "$SECURE_BOOT" "$SSH_PORT" "$TEST_DIR"
23+
24+exec qemu-system-x86_64 "${QEMU_ARGS[@]}"
@@ -1,16 +1,24 @@
1 #!/bin/bash1 #!/bin/bash
2-# Start installed Arch system in QEMU with UEFI support and SSH access2+# Start installed Arch system in QEMU with realistic hardware profile
3+# Usage: ./start-qemu-installed.sh [--profile desktop|laptop] [--secure-boot on|off] [--ssh-port PORT]
4+set -euo pipefail
3 5
4-# Get test directory
5 TEST_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"6 TEST_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6 7
7-qemu-system-x86_64 \8+PROFILE="desktop"
8- -enable-kvm \9+SECURE_BOOT="off"
9- -m 2048 \10+SSH_PORT="2222"
10- -smp 2 \11+
11- -bios /usr/share/edk2/x64/OVMF.4m.fd \12+while [[ $# -gt 0 ]]; do
12- -drive file="$TEST_DIR/arch-test.qcow2",format=qcow2,if=virtio \13+ case "$1" in
13- -display gtk \14+ --profile) PROFILE="$2"; shift 2 ;;
14- -vga virtio \15+ --secure-boot) SECURE_BOOT="$2"; shift 2 ;;
15- -net nic,model=virtio \16+ --ssh-port) SSH_PORT="$2"; shift 2 ;;
16- -net user,hostfwd=tcp::2222-:2217+ *) echo "Unknown flag: $1"; exit 1 ;;
18+ esac
19+done
20+
21+source "$TEST_DIR/lib/qemu-profile.sh"
22+build_qemu_args "$PROFILE" "$SECURE_BOOT" "$SSH_PORT" "$TEST_DIR"
23+
24+exec qemu-system-x86_64 "${QEMU_ARGS[@]}"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close