Skip to content

Commit 291c83d

Browse files
committed
M9.R.38.2: clean automated-install driver for fresh-qcow2 G2 evidence
The M9.R.37 install driver (_m9r37_install_diag.sh) deliberately killed the installer mid-run with SIGABRT after collecting strace + kernelstack diagnostic traces -- appropriate for a wedge investigation but not for a clean install/boot evidence run. _m9r38_install.sh is the simple non-diagnostic counterpart: * Boots the freshly rebuilt ISO on a fresh 32 GB qcow2. * Logs in as root/reproos on ttyS0 after the live boot settles. * Invokes /usr/bin/reproos-installer-launcher.sh --automated /etc/reproos/auto-config.toml in the FOREGROUND (no DIAG mode, no detach, no SIGABRT injection) and captures INSTALLER_RC. * After install completes, dumps /mnt/boot/grub/grub.cfg + lists the ESP root so we can byte-confirm M9.R.37.8 (linux /vmlinuz + initrd /initrd.img) landed in the on-disk grub.cfg. * Powers off cleanly. * 900s timeout (vs M9.R.37's 600s) -- generous headroom for the 6-phase install path without rushing the auto-config flow. The disk image lands at /tmp/m9r38_install.qcow2 so the G3 boot driver (_m9r37_boot_installed.sh) can pick it up directly via DISK= override.
1 parent 4825350 commit 291c83d

1 file changed

Lines changed: 90 additions & 0 deletions

File tree

_m9r38_install.sh

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env bash
2+
# M9.R.38.2 — clean install run on a fresh qcow2 disk.
3+
#
4+
# Boots the freshly-rebuilt ISO with M9.R.37.7 + M9.R.37.8 + M9.R.38.1
5+
# fixes, runs the installer in --automated mode, and waits for the
6+
# installer to complete cleanly (not the M9.R.37 diagnostic-wedge
7+
# pattern that killed the installer mid-run). Captures full serial
8+
# transcript.
9+
set -uo pipefail
10+
ISO="${ISO:-/opt/repro/reprobuild/recipes/reproos-iso/build/reproos.iso}"
11+
DISK="${DISK:-/tmp/m9r38_install.qcow2}"
12+
INSTALL_LOG="${INSTALL_LOG:-/tmp/m9r38_install.log}"
13+
INSTALL_TIMEOUT="${INSTALL_TIMEOUT:-900}"
14+
15+
[ -f "$ISO" ] || { echo "ISO $ISO does not exist" >&2; exit 2; }
16+
17+
OVMF_FW="$(find /nix/store -maxdepth 5 -path '*OVMF*/FV/OVMF_CODE.fd' 2>/dev/null | head -1)"
18+
[ -n "$OVMF_FW" ] || { echo "No OVMF firmware in /nix/store" >&2; exit 2; }
19+
OVMF_DIR="$(dirname "$OVMF_FW")"
20+
OVMF_CODE="$OVMF_DIR/OVMF_CODE.fd"
21+
22+
INSTALL_VARS=/tmp/m9r38_install_ovmf_vars.fd
23+
cp "$OVMF_DIR/OVMF_VARS.fd" "$INSTALL_VARS"
24+
chmod u+w "$INSTALL_VARS"
25+
26+
date
27+
28+
rm -f "$DISK"
29+
nix-shell -p qemu --run "qemu-img create -f qcow2 $DISK 32G" >/dev/null
30+
31+
INSTALL_FIFO="$(mktemp -d)/install-in.fifo"
32+
mkfifo "$INSTALL_FIFO"
33+
(
34+
# Wait for live ISO to boot + login prompt to surface on ttyS0.
35+
sleep 100
36+
echo "root"
37+
sleep 3
38+
echo "reproos"
39+
sleep 5
40+
echo "echo === M9R38_INSTALL_BEGIN ==="
41+
sleep 1
42+
# Run installer in foreground; do NOT use REPRO_INSTALLER_DIAG=1 -- we
43+
# want a clean run, not the strace/kernelstack diagnostic mode.
44+
echo "QT_QPA_PLATFORM=offscreen /usr/bin/reproos-installer-launcher.sh --automated /etc/reproos/auto-config.toml; echo INSTALLER_RC=\$?"
45+
sleep 5
46+
echo "echo === M9R38_INSTALL_END ==="
47+
sleep 2
48+
echo "echo === M9R38_VERIFY_GRUB ==="
49+
sleep 1
50+
echo "cat /mnt/boot/grub/grub.cfg 2>&1"
51+
sleep 2
52+
echo "ls -la /mnt/boot/ /mnt/vmlinuz /mnt/initrd.img 2>&1"
53+
sleep 2
54+
echo "echo === M9R38_SHUTDOWN ==="
55+
sleep 2
56+
echo "poweroff"
57+
) > "$INSTALL_FIFO" &
58+
59+
echo "=== M9.R.38.2 clean install (timeout ${INSTALL_TIMEOUT}s) ===" | tee "$INSTALL_LOG"
60+
nix-shell -p qemu OVMF --run "
61+
qemu-system-x86_64 -machine q35 -m 4096 -smp 4 \
62+
-drive if=pflash,format=raw,readonly=on,file=$OVMF_CODE \
63+
-drive if=pflash,format=raw,file=$INSTALL_VARS \
64+
-cdrom $ISO \
65+
-drive file=$DISK,if=virtio,format=qcow2 \
66+
-nographic -serial mon:stdio -display none \
67+
< $INSTALL_FIFO
68+
" >> "$INSTALL_LOG" 2>&1 &
69+
QPID=$!
70+
71+
T=0
72+
while kill -0 $QPID 2>/dev/null && [ $T -lt $INSTALL_TIMEOUT ]; do
73+
sleep 10
74+
T=$((T+10))
75+
done
76+
if kill -0 $QPID 2>/dev/null; then
77+
echo "[m9r38-install] ${INSTALL_TIMEOUT}s timeout, killing QEMU" | tee -a "$INSTALL_LOG"
78+
kill -9 $QPID 2>/dev/null
79+
fi
80+
wait $QPID 2>/dev/null
81+
82+
echo ""
83+
echo "=== M9.R.38.2 install log (last 200 lines) ==="
84+
tail -200 "$INSTALL_LOG"
85+
86+
echo ""
87+
echo "=== M9.R.38.2 install summary extract ==="
88+
sed -n '/M9R38_INSTALL_BEGIN/,/M9R38_SHUTDOWN/p' "$INSTALL_LOG" | head -200
89+
90+
date

0 commit comments

Comments
 (0)