diff --git a/iso/scripts/luks-e2e.sh b/iso/scripts/luks-e2e.sh index a2aa70196..8199e8a55 100755 --- a/iso/scripts/luks-e2e.sh +++ b/iso/scripts/luks-e2e.sh @@ -37,6 +37,32 @@ TEST_PASSWORD="${UTAH_E2E_PASSWORD:-utahtest}" # falling back. TERMINAL_APP="${UTAH_E2E_TERMINAL:-com.mitchellh.ghostty}" +# Display size and terminal geometry for the screenshots. These exist because +# fastfetch with its logo needs about 90 columns -- roughly 33 for the logo +# column plus a ~57 character detail line -- while Ghostty opens at 80x24. The +# detail lines wrapped and pushed fastfetch's own header off the top of the +# window, which is what #84 worked around by dropping the logo entirely with +# --logo none. The shot is the evidence on the repository front page, so it +# should carry the branding rather than hide it. +# +# Columns are the lever, not point size: Ghostty sizes its window in cells, so +# a smaller font alone gives a smaller window with the same 80 columns and the +# same wrap. What buys the columns is the display -- at 1920x1080 a 110-column +# window at 12pt is roughly 880px of 1920, so the logo fits with room to spare +# and the font stays large enough for the tesseract gate below to read. Doing +# this by shrinking the font on a 1280x800 screen would have traded the wrap +# for worse OCR. 35 rows keeps all of fastfetch on screen without scrolling. +# +# xres/yres are the EDID hints QEMU passes to the guest for a preferred mode; +# -vga none replaces the machine default with the same stdvga device rather +# than a different adapter, so nothing about the graphics path changes. +DISPLAY_WIDTH="${UTAH_E2E_DISPLAY_WIDTH:-1920}" +DISPLAY_HEIGHT="${UTAH_E2E_DISPLAY_HEIGHT:-1080}" +VGA_ARGS=(-vga none -device "VGA,xres=${DISPLAY_WIDTH},yres=${DISPLAY_HEIGHT}") +TERMINAL_FONT_SIZE="${UTAH_E2E_FONT_SIZE:-12}" +TERMINAL_COLUMNS="${UTAH_E2E_COLUMNS:-110}" +TERMINAL_ROWS="${UTAH_E2E_ROWS:-35}" + ISO="$(realpath "${ISO}")" mkdir -p "${WORK}" SHOTS="${WORK}/screenshots" @@ -189,6 +215,7 @@ cp -f "${OVMF_VARS_SRC}" "${VARS}" "${QEMU}" \ -machine q35 -cpu host -m "${VM_RAM}" -smp "${VM_CPUS}" ${ACCEL} \ + "${VGA_ARGS[@]}" \ -drive "if=pflash,format=raw,readonly=on,file=${OVMF_CODE}" \ -drive "if=pflash,format=raw,file=${VARS}" \ -drive "if=none,id=iso,file=${ISO},media=cdrom,readonly=on,format=raw" \ @@ -389,6 +416,7 @@ echo "=== Phase 4/6: boot the installed disk ===" cp -f "${VARS}" "${WORK}/ovmf-vars-installed.fd" "${QEMU}" \ -machine q35 -cpu host -m "${VM_RAM}" -smp "${VM_CPUS}" ${ACCEL} \ + "${VGA_ARGS[@]}" \ -drive "if=pflash,format=raw,readonly=on,file=${OVMF_CODE}" \ -drive "if=pflash,format=raw,file=${WORK}/ovmf-vars-installed.fd" \ -drive "if=none,id=disk,file=${INSTALL_DISK},format=qcow2" \ @@ -468,7 +496,20 @@ shot installed-greeter "${MONITOR_INSTALLED}" # runs inside the session with a bus and a display of its own. echo "Arranging for a terminal to open in the session..." ssh_target " - grep -q 'utah-e2e fastfetch' ~/.bashrc 2>/dev/null || printf '%s\n' '[[ \$- == *i* ]] && { fastfetch --logo none && echo UTAH-E2E-FASTFETCH; } # utah-e2e fastfetch' >> ~/.bashrc + grep -q 'utah-e2e fastfetch' ~/.bashrc 2>/dev/null || printf '%s\n' '[[ \$- == *i* ]] && { fastfetch && echo UTAH-E2E-FASTFETCH; } # utah-e2e fastfetch' >> ~/.bashrc + # Ghostty is a flatpak here, and which config path it reads depends on + # whether the sandbox exposes xdg-config or keeps its own per-app dir, so + # write both rather than guess. An unknown key would only be warned about, + # and a geometry that failed to apply shows up as the OCR gate failing + # rather than as a quietly bad screenshot. + for _cfgdir in ~/.config/ghostty ~/.var/app/${TERMINAL_APP}/config/ghostty; do + mkdir -p \"\${_cfgdir}\" + cat > \"\${_cfgdir}/config\" < ~/.config/autostart/${TERMINAL_APP}.desktop <