Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2673c613d9 | ||
|
|
d6e4060d56 | ||
|
|
100a41f7fd | ||
|
|
f9be60b24b | ||
|
|
222a742daf | ||
|
|
9900e63bd4 | ||
|
|
3559b2bc9d |
No files matched your search
@@ -42,6 +42,14 @@ if [[ -z "${BUILD_VERSION-}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# A version that already numbers its candidate (4.0.2rc2) is the complete
|
||||
# artifact name; the bare -rc suffix exists only for an unnumbered candidate.
|
||||
# Without this, every candidate of a train uploads over the same
|
||||
# omarchy-X.Y.Z-rc.iso and testers cannot tell which rc they are holding.
|
||||
if [[ $BUILD_VERSION == *rc* ]]; then
|
||||
RELEASE_SUFFIX=""
|
||||
fi
|
||||
|
||||
BUILD_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..")
|
||||
BUILD_RELEASE_PATH="$BUILD_ROOT/release"
|
||||
|
||||
|
||||
+32
-28
@@ -202,6 +202,11 @@ start_vm() {
|
||||
local disk="$1" serial="$2"
|
||||
shift 2
|
||||
|
||||
# A viewer that resizes the guest display breaks the console driving: OCR
|
||||
# cannot read the shrunken font, and a resize during early boot can wedge
|
||||
# virtio-gpu before the system comes up.
|
||||
log "Watch (do not resize): vncviewer -RemoteResize=0 127.0.0.1:5905"
|
||||
|
||||
qemu-system-x86_64 \
|
||||
-cpu host -enable-kvm -machine q35,accel=kvm \
|
||||
-smp "$(nproc)" \
|
||||
@@ -885,40 +890,39 @@ EOF
|
||||
(cd "$BASE_DIR/www" && exec python3 -m http.server "$HTTP_PORT" --bind 127.0.0.1 >/dev/null 2>&1) &
|
||||
HTTP_PID=$!
|
||||
|
||||
local waited=0
|
||||
while true; do
|
||||
# Type the login blind: a VNC viewer that resizes the framebuffer makes the
|
||||
# console font unreadable to OCR, and the real gate is SSH coming up anyway.
|
||||
# Getty re-prompts after a failed login, so a whole-sequence retry recovers
|
||||
# from typing before the prompt was ready.
|
||||
sleep 15 # give first boot time to reach getty
|
||||
local attempt
|
||||
for attempt in 1 2 3; do
|
||||
press ctrl-alt-f3
|
||||
sleep 8
|
||||
press ret # settle a half-typed prompt from a previous attempt
|
||||
sleep 2
|
||||
type_text "$GUEST_USER"
|
||||
capture_console "success-first-boot-03-console-username"
|
||||
press ret
|
||||
sleep 3
|
||||
type_text "$GUEST_PASSWORD"
|
||||
press ret
|
||||
sleep 4
|
||||
ocr_screen | grep -qi "login:" && break
|
||||
((waited += 8))
|
||||
type_text "curl -fsS http://10.0.2.2:$HTTP_PORT/bootstrap -o /tmp/bs && bash /tmp/bs"
|
||||
capture_console "success-first-boot-05-bootstrap-command"
|
||||
press ret
|
||||
|
||||
if ((waited >= 300)); then
|
||||
capture_console "failure-first-boot-console-timeout"
|
||||
echo "Timed out waiting for a console login prompt" >&2
|
||||
return 1
|
||||
if wait_for_ssh 120 "failure-first-boot-ssh-timeout-$attempt"; then
|
||||
capture_console "success-first-boot-06-bootstrap-complete"
|
||||
kill "$HTTP_PID" 2>/dev/null || true
|
||||
HTTP_PID=""
|
||||
press ctrl-alt-f1
|
||||
return 0
|
||||
fi
|
||||
sleep 4
|
||||
done
|
||||
|
||||
type_text "$GUEST_USER"
|
||||
capture_console "success-first-boot-03-console-username"
|
||||
press ret
|
||||
wait_for_screen "Password" 60
|
||||
type_text "$GUEST_PASSWORD"
|
||||
capture_console "success-first-boot-04-console-password"
|
||||
press ret
|
||||
sleep 3
|
||||
|
||||
type_text "curl -fsS http://10.0.2.2:$HTTP_PORT/bootstrap -o /tmp/bs && bash /tmp/bs"
|
||||
capture_console "success-first-boot-05-bootstrap-command"
|
||||
press ret
|
||||
|
||||
wait_for_ssh 360 "failure-first-boot-ssh-timeout"
|
||||
capture_console "success-first-boot-06-bootstrap-complete"
|
||||
|
||||
kill "$HTTP_PID" 2>/dev/null || true
|
||||
HTTP_PID=""
|
||||
press ctrl-alt-f1
|
||||
echo "Console bootstrap did not produce SSH access after 3 attempts" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
# Get a freshly booted system to a running Hyprland session, typing at the
|
||||
|
||||
Executable
+101
@@ -0,0 +1,101 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Stop the VM a `omarchy-iso-test --keep-running` run left behind: graceful
|
||||
# guest poweroff over SSH first, escalating to TERM then KILL. The base image
|
||||
# is untouched either way; only the throwaway run overlay is affected.
|
||||
#
|
||||
# Usage: omarchy-iso-test-stop [--kill] [--port PORT]
|
||||
#
|
||||
# --kill Skip the graceful poweroff and kill the VM immediately
|
||||
# --port PORT Host port forwarded to guest SSH (default 2222)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
|
||||
GUEST_USER="omarchy"
|
||||
GUEST_PASSWORD="omarchy"
|
||||
SSH_PORT=2222
|
||||
GRACEFUL=true
|
||||
|
||||
while (($#)); do
|
||||
case "$1" in
|
||||
--kill) GRACEFUL=false ;;
|
||||
--port) SSH_PORT="$2"; shift ;;
|
||||
-h | --help)
|
||||
sed -n '3,10p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'
|
||||
exit 0
|
||||
;;
|
||||
*) echo "Unknown option: $1" >&2; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# The newest run dir whose qemu is still alive is the VM to stop.
|
||||
PID=""
|
||||
PIDFILE=""
|
||||
while IFS= read -r candidate; do
|
||||
pid=$(<"$candidate")
|
||||
if kill -0 "$pid" 2>/dev/null; then
|
||||
PID="$pid"
|
||||
PIDFILE="$candidate"
|
||||
break
|
||||
fi
|
||||
done < <(ls -t "$REPO_DIR"/test-runs/*/runs/*/qemu.pid 2>/dev/null)
|
||||
|
||||
if [[ -z $PID ]]; then
|
||||
echo "No running omarchy-iso-test VM found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BASE_DIR="$(dirname "$(dirname "$(dirname "$PIDFILE")")")"
|
||||
SSH_KEY="$BASE_DIR/id_ed25519"
|
||||
|
||||
# A harness that is still driving this VM dies with it; make sure that is
|
||||
# what the caller wants before pulling anything down.
|
||||
if [[ -t 0 ]]; then
|
||||
if pgrep -f "bin/omarchy-iso-test .*\.iso" >/dev/null; then
|
||||
echo "Warning: an omarchy-iso-test run appears to be in progress."
|
||||
fi
|
||||
if ! gum confirm "Stop test VM (pid $PID, ${PIDFILE#$REPO_DIR/})?"; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Stopping test VM (pid $PID, ${PIDFILE#$REPO_DIR/})"
|
||||
|
||||
if $GRACEFUL && [[ -f $SSH_KEY ]]; then
|
||||
ssh -i "$SSH_KEY" -p "$SSH_PORT" \
|
||||
-o BatchMode=yes \
|
||||
-o IdentitiesOnly=yes \
|
||||
-o StrictHostKeyChecking=no \
|
||||
-o UserKnownHostsFile=/dev/null \
|
||||
-o ConnectTimeout=5 \
|
||||
-o LogLevel=ERROR \
|
||||
"$GUEST_USER@127.0.0.1" \
|
||||
"echo $GUEST_PASSWORD | sudo -S systemctl poweroff" >/dev/null 2>&1 || true
|
||||
|
||||
waited=0
|
||||
while kill -0 "$PID" 2>/dev/null && ((waited < 15)); do
|
||||
sleep 1
|
||||
((waited += 1))
|
||||
done
|
||||
fi
|
||||
|
||||
if kill -0 "$PID" 2>/dev/null; then
|
||||
kill "$PID" 2>/dev/null || true
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
if kill -0 "$PID" 2>/dev/null; then
|
||||
kill -9 "$PID" 2>/dev/null || true
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
if kill -0 "$PID" 2>/dev/null; then
|
||||
echo "VM (pid $PID) refused to die." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "VM stopped; port $SSH_PORT is free."
|
||||
@@ -122,7 +122,7 @@ greeter() {
|
||||
printf '\033[%d;1H' "$logo_row"
|
||||
gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "$(<"$LOGO_PATH")"
|
||||
|
||||
tagline="Beautiful, Modern & Opinionated Linux by DHH"
|
||||
tagline="Beautiful, Fun & Agentic Linux by DHH"
|
||||
tpad=$(((cols - ${#tagline}) / 2)); (( tpad < 0 )) && tpad=0
|
||||
printf '\033[%d;%dH%s' "$tagline_row" "$((tpad + 1))" "$tagline"
|
||||
|
||||
|
||||
Reference in new issue
Block a user