diff --git a/playbook/startnet.cmd b/playbook/startnet.cmd index 5298a7c..b134482 100644 --- a/playbook/startnet.cmd +++ b/playbook/startnet.cmd @@ -318,6 +318,33 @@ echo. echo Starting GEA Shopfloor setup... start "FlatApp" %SYSTEMDRIVE%\GESetup\FlatSetupLoader.exe for /l %%i in (1,1,2000000) do rem +REM --- Per-PCTYPE media view ----------------------------------------------- +REM PESetup's CopyPackages copies the WHOLE of \Deploy\Applications to +REM the target, recursively, with no filtering and no manifest (see +REM docs/PESETUP-INTERNALS.md). One shared shopfloor media therefore hands +REM every shopfloor payload to every bay whatever its type. +REM _media\ is that same media rebuilt out of symlinks by +REM scripts/build-pctype-media.py, carrying only this type's payload. It is +REM built once, server-side, and never mutated per session: bays image +REM concurrently and CopyPackages is fail-fast, so changing a path mid-copy +REM would fail some OTHER bay's imaging. +if "%PCTYPE%"=="" goto gea_shopfloor_media_shared +REM Free Z: first. A leftover mapping makes net use fail with "device already +REM in use" and the probe below would then pass against the OLD media. +net use Z: /delete /y >NUL 2>&1 +net use Z: \\172.16.9.1\winpeapps\_media\%PCTYPE% /user:pxe-upload pxe /persistent:no >NUL 2>&1 +REM Probe a file that only resolves when the view exists AND its symlinks are +REM intact. A dangling view must not image silently off a half-mapped drive. +if exist "Z:\Deploy\Control\HardwareDriver.json" goto end +echo. +echo WARNING: no usable per-type media at _media\%PCTYPE%. +echo Falling back to the shared shopfloor media, so EVERY shopfloor +echo payload will be staged on this bay, not just this type's. +echo Imaging is otherwise unaffected. Tell the PXE admin. +echo. +net use Z: /delete /y >NUL 2>&1 + +:gea_shopfloor_media_shared net use Z: \\172.16.9.1\winpeapps\gea-shopfloor /user:pxe-upload pxe /persistent:no goto end