From d8c64bef2b777857521294cbc85bb77c0d31dc8f Mon Sep 17 00:00:00 2001 From: cproudlock Date: Fri, 15 May 2026 10:26:31 -0400 Subject: [PATCH] Add conditional BIOS-update sub-stage on idx=1 winpe-status-push.ps1 now accepts -CurrentStage / -StageIndex params so callers can override the default "WinPE: PESetup / WIM apply" string. Backwards compatible. startnet.cmd: after the existing initial WinPE status push, inspect $BIOS_STATUS for the "->" marker that check-bios.cmd writes when an update was actually applied or staged. If present, fire a second idx=1 push with stage="WinPE: BIOS firmware update - ". No-op for clean "up to date" / "no update in catalog" runs. imaging.html: at stage_idx=1 with "bios" in current_stage, swap friendly label to "Updating BIOS firmware" with a do-NOT-power-off hint. Bays without firmware updates show the default "Booting from PXE" label as before. boot.wim startnet.cmd updated via wimupdate so live PXE clients pick it up at next boot. Co-Authored-By: Claude Opus 4.7 (1M context) --- playbook/startnet.cmd | 14 ++++++++++++++ playbook/winpe-status-push.ps1 | 8 +++++--- webapp/templates/imaging.html | 6 ++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/playbook/startnet.cmd b/playbook/startnet.cmd index 28ef75f..f53304c 100644 --- a/playbook/startnet.cmd +++ b/playbook/startnet.cmd @@ -254,6 +254,20 @@ if exist "Y:\scripts\winpe-status-push.ps1" ( powershell -NoProfile -ExecutionPolicy Bypass -File "Y:\scripts\winpe-status-push.ps1" ) +REM --- BIOS update sub-stage push --- +REM If check-bios.cmd actually applied or staged a firmware update, push +REM a second idx=1 status with a BIOS-specific stage string so the +REM dashboard friendly-label swaps to "Updating BIOS firmware". The "->" +REM marker is what check-bios writes for both "updated" and "STAGED" +REM cases. No-op states ("up to date", "no update in catalog", "Skipped", +REM "missing") never contain the arrow and stay on the default label. +echo %BIOS_STATUS% | findstr /C:"->" >NUL +if not errorlevel 1 ( + if exist "Y:\scripts\winpe-status-push.ps1" ( + powershell -NoProfile -ExecutionPolicy Bypass -File "Y:\scripts\winpe-status-push.ps1" -CurrentStage "WinPE: BIOS firmware update - %BIOS_STATUS%" + ) +) + echo Waiting for PESetup.exe to start... :wait_start ping -n 3 127.0.0.1 >NUL diff --git a/playbook/winpe-status-push.ps1 b/playbook/winpe-status-push.ps1 index 6d9eb9c..9fba978 100644 --- a/playbook/winpe-status-push.ps1 +++ b/playbook/winpe-status-push.ps1 @@ -13,7 +13,9 @@ param( [string]$PxeServer = '172.16.9.1', [int]$Port = 9009, [int]$TimeoutSec = 5, - [string]$PCType = $env:PCTYPE + [string]$PCType = $env:PCTYPE, + [string]$CurrentStage = 'WinPE: PESetup / WIM apply', + [int]$StageIndex = 1 ) $logFile = 'X:\Windows\Temp\winpe-status-push.log' @@ -54,8 +56,8 @@ if (-not $serial) { $payload = @{ serial = $serial pctype = $PCType - current_stage = 'WinPE: PESetup / WIM apply' - stage_index = 1 + current_stage = $CurrentStage + stage_index = $StageIndex stage_total = 8 status = 'in_progress' } diff --git a/webapp/templates/imaging.html b/webapp/templates/imaging.html index c58f177..6831ef1 100644 --- a/webapp/templates/imaging.html +++ b/webapp/templates/imaging.html @@ -63,6 +63,12 @@ window.addEventListener('DOMContentLoaded', scheduleImagingReload); {% set is_done = s.status == 'succeeded' %} {% set border = 'danger' if is_failed else ('success' if is_done else 'primary') %} {% set friendly = stage_labels.get(stage_idx, ('Stage ' ~ stage_idx, '')) %} + {# Stage 1 sub-phase: if WinPE pushed a BIOS update stage string, #} + {# show a BIOS-specific friendly label. Otherwise default idx=1. #} + {% if stage_idx == 1 and s.current_stage and 'bios' in s.current_stage|lower %} + {% set friendly = ('Updating BIOS firmware', + 'WinPE detected a firmware update for this model. Do NOT power off until the next reboot. Imaging continues afterward.') %} + {% endif %} {# Stage 7 fans out by sub-phase. Monitor pushes different stage #} {# strings as it crosses each Phase 1-4 boundary. Swap friendly #} {# label based on which keyword shows up. #}