Fix the unattend that broke Engineer builds; gate unattend deploys on the linter
a94c203added a RunSynchronous Path of 417 chars to both std/eng answer files. Windows caps it at 259 and then rejects the WHOLE answer file, so an Engineer build stopped at 'Windows could not parse or process unattend answer file'. The live files were restored to their pre-a94c203 versions the same day. - The status steps now fit: Send-ImagingStage.ps1 -Persist copies itself out of C:\Deploy (no cmd copy chain), short PowerShell switches, default arguments left out. Longest Path is 168 chars; lint-unattend passes. NOT deployed: these files must go live only through deploy-unattend.sh. - scripts/deploy-unattend.sh: the only route for an answer file to a PXE server. Lints first and refuses on any error, backs up, swaps atomically, lints the live copy and restores the backup if that fails. - .githooks/pre-commit (git config core.hooksPath .githooks): refuses a commit whose staged unattend fails the linter. Verified by planting a 352-char Path (blocked) and against the exacta94c203file (rejected). - Boot menu: also accept SecureBoot read as hex 01, and show the raw values in the warning so a wrong read can be diagnosed from the screen.
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
# own reporting in Shopfloor\lib\Send-PxeStatus.ps1).
|
||||
#
|
||||
# Called from the image's FlatUnattendW10.xml (specialize RunSynchronous and
|
||||
# oobeSystem FirstLogonCommands). Deployed to
|
||||
# oobeSystem FirstLogonCommands). Keep those command lines short: Windows
|
||||
# rejects the whole unattend if a RunSynchronous Path exceeds 259 characters
|
||||
# (check with scripts/lint-unattend.py --local). Deployed to
|
||||
# _shared\Applications\extra\pxe-status\ on the PXE server, which PESetup
|
||||
# copies to C:\Deploy\Applications\extra\pxe-status\.
|
||||
#
|
||||
@@ -20,7 +22,10 @@ param(
|
||||
[ValidateSet('in_progress', 'succeeded', 'failed')][string]$Status = 'in_progress',
|
||||
[string]$PxeServer = '172.16.9.1',
|
||||
[int]$Port = 9009,
|
||||
[int]$TimeoutSec = 5
|
||||
[int]$TimeoutSec = 5,
|
||||
# Copy this script to C:\ProgramData\PxeStatus first: the bulk-enrollment
|
||||
# task deletes C:\Deploy before first logon, when the later steps run.
|
||||
[switch]$Persist
|
||||
)
|
||||
|
||||
$logFile = 'C:\Logs\send-imaging-stage.log'
|
||||
@@ -31,6 +36,13 @@ function Log([string]$msg) {
|
||||
} catch { }
|
||||
}
|
||||
|
||||
if ($Persist) {
|
||||
try {
|
||||
New-Item -ItemType Directory -Path 'C:\ProgramData\PxeStatus' -Force | Out-Null
|
||||
Copy-Item -LiteralPath $PSCommandPath -Destination 'C:\ProgramData\PxeStatus\Send-ImagingStage.ps1' -Force
|
||||
} catch { Log "persist failed: $($_.Exception.Message)" }
|
||||
}
|
||||
|
||||
try {
|
||||
$serial = $null
|
||||
try { $serial = (Get-CimInstance -ClassName Win32_BIOS -ErrorAction Stop).SerialNumber } catch {
|
||||
|
||||
Reference in New Issue
Block a user