From 0cb9f8b9cad7d633ac6f50589f3926eae00d225f Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Thu, 24 Sep 2026 10:48:39 +0200 Subject: [PATCH] fix: BIOS dry run also walks through the restart choices A dry run counts as staged, so [m]/[r] and the restart question on q show up; restarting only prints in dry-run mode. --- CHANGELOG.md | 5 ++++- lib/bios.sh | 5 ++++- setup-gamescope-boot.sh | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fb73f1..c7c692f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ every run. Merged together with 0.7.0, so v0.8.0 is the release that has both. - `b70c9d6` **fix: shellcheck in the bundle, and the docs for the BIOS checks** - A variable name in `lib/bios.sh` clashed with `lib/state.sh` in the bundle (CI's shellcheck would fail); README, AGENTS.md and this changelog updated. -- **feat: Menu comes back after each run, BIOS dry run, version 0.8.0** +- `54fc9e3` **feat: Menu comes back after each run, BIOS dry run, version 0.8.0** - After a run the menu returns with the new state; quit with `q`. When something needs a restart, choose between back to the menu (`m`) and restart now (`r`); quitting asks once more. @@ -33,6 +33,9 @@ every run. Merged together with 0.7.0, so v0.8.0 is the release that has both. - `WIZARD_BIOS_DRY_RUN=1` walks through the whole BIOS update (download, checksum, both warnings) but only prints the install and never flashes. - README: the menu loop and the BIOS update step by step. +- **fix: BIOS dry run also walks through the restart choices** + - A dry run counts as staged, so `[m]`/`[r]` and the restart question on `q` + show up; in dry-run mode restarting only prints what it would do. ## 0.7.0 - 2026-09-24 diff --git a/lib/bios.sh b/lib/bios.sh index 00c5e4b..64da99b 100644 --- a/lib/bios.sh +++ b/lib/bios.sh @@ -174,7 +174,10 @@ bios_enable() { if [[ -n "$BIOS_DRY_RUN" ]]; then ok "Dry run: would now run: sudo fwupdmgr install -y --no-reboot-check $BIOS_CAB" - ok "Dry run finished; nothing was flashed and no restart is needed." + ok "Dry run finished; nothing was flashed." + # Treated as staged, so the restart choices that follow a real + # update show up too; restarting only prints (see restart_now). + BIOS_NEEDS_RESTART=1 rm -rf "$tmp" return 0 fi diff --git a/setup-gamescope-boot.sh b/setup-gamescope-boot.sh index c12e97a..8955d95 100755 --- a/setup-gamescope-boot.sh +++ b/setup-gamescope-boot.sh @@ -46,6 +46,10 @@ restart_now() { warn "The BIOS update is written during this restart. Keep the power on and don't" warn "touch the machine until it has fully started again, even if the screen stays black." fi + if [[ -n "${BIOS_DRY_RUN:-}" ]]; then + ok "Dry run: would restart now (sudo reboot); not restarting." + exit 0 + fi info "Restarting..." sudo reboot exit 0 @@ -131,13 +135,13 @@ if [[ -n "${BIOS_NEEDS_RESTART:-}" ]]; then warn "The BIOS update is written during the next restart. Keep the power on and" warn "don't touch the machine until it has fully started again, even if the screen stays black." if ask_yn "Restart now to install the BIOS update?" n; then - sudo reboot + restart_now else info "The BIOS update installs at your next restart." fi elif [[ "$RESTART_FOR_LOGIN" == true ]]; then if ask_yn "Restart now so the changes take effect?" n; then - sudo reboot + restart_now else info "Restart whenever you're ready." fi