diff --git a/.gitignore b/.gitignore index 4f5b5f5..49ba8d6 100644 --- a/.gitignore +++ b/.gitignore @@ -44,5 +44,8 @@ __pycache__/ *.pyo venv/ +# MOK Secure Boot signing keys (contains private key) +mok-keys/ + # Secrets secrets.md diff --git a/build-proxmox-iso.sh b/build-proxmox-iso.sh index 68e5164..353f248 100755 --- a/build-proxmox-iso.sh +++ b/build-proxmox-iso.sh @@ -232,11 +232,20 @@ if [ -d "$WEBAPP_DIR" ]; then fi # Python wheels +if [ ! -d "$PIP_WHEELS_DIR" ]; then + echo " pip-wheels/ not found — downloading now..." + mkdir -p "$PIP_WHEELS_DIR" + if pip3 download -d "$PIP_WHEELS_DIR" flask lxml 2>/dev/null; then + echo " Downloaded pip wheels successfully." + else + echo " WARNING: Failed to download pip wheels (no internet?)" + rmdir "$PIP_WHEELS_DIR" 2>/dev/null || true + fi +fi if [ -d "$PIP_WHEELS_DIR" ]; then cp -r "$PIP_WHEELS_DIR" "$PXE_DATA/pip-wheels" - echo " Copied pip-wheels/" -else - echo " WARNING: No pip-wheels/ found (run download-packages.sh first)" + WHEEL_COUNT=$(find "$PIP_WHEELS_DIR" -name '*.whl' | wc -l) + echo " Copied pip-wheels/ ($WHEEL_COUNT wheels)" fi # WinPE boot files (wimboot, boot.wim, BCD, ipxe.efi, etc.) diff --git a/build-usb.sh b/build-usb.sh index e3cfd2b..6e4a4af 100755 --- a/build-usb.sh +++ b/build-usb.sh @@ -187,11 +187,22 @@ fi # Copy pip wheels for offline Flask install PIP_WHEELS_DIR="$SCRIPT_DIR/pip-wheels" +if [ ! -d "$PIP_WHEELS_DIR" ]; then + echo " pip-wheels/ not found — downloading now..." + mkdir -p "$PIP_WHEELS_DIR" + if pip3 download -d "$PIP_WHEELS_DIR" flask lxml 2>/dev/null; then + echo " Downloaded pip wheels successfully." + else + echo " WARNING: Failed to download pip wheels (no internet?)" + echo " The PXE server will need internet to install Flask later," + echo " or manually copy wheels to pip-wheels/ and rebuild." + rmdir "$PIP_WHEELS_DIR" 2>/dev/null || true + fi +fi if [ -d "$PIP_WHEELS_DIR" ]; then cp -r "$PIP_WHEELS_DIR" "$MOUNT_POINT/pip-wheels" - echo " Copied pip-wheels/" -else - echo " No pip-wheels/ found (run download-packages.sh first)" + WHEEL_COUNT=$(find "$PIP_WHEELS_DIR" -name '*.whl' | wc -l) + echo " Copied pip-wheels/ ($WHEEL_COUNT wheels)" fi # Copy WinPE boot files (wimboot, boot.wim, BCD, ipxe.efi, etc.) diff --git a/playbook/startnet.cmd b/playbook/startnet.cmd index 70808cf..759ec27 100644 --- a/playbook/startnet.cmd +++ b/playbook/startnet.cmd @@ -103,3 +103,19 @@ net use Z: \\10.9.100.1\winpeapps\ge-shopfloor-mce /persistent:no goto end :end +echo. +echo Waiting for PESetup.exe to start... +:wait_start +timeout /t 2 /nobreak >NUL +tasklist /FI "IMAGENAME eq PESetup.exe" 2>NUL | find /I "PESetup.exe" >NUL +if errorlevel 1 goto wait_start +echo PESetup.exe is running. Waiting for imaging to complete... +:wait_finish +timeout /t 10 /nobreak >NUL +tasklist /FI "IMAGENAME eq PESetup.exe" 2>NUL | find /I "PESetup.exe" >NUL +if not errorlevel 1 goto wait_finish +echo. +echo Imaging complete. Rebooting in 15 seconds... +echo Press Ctrl+C to cancel. +timeout /t 15 +wpeutil reboot diff --git a/startnet-template.cmd b/startnet-template.cmd index 70808cf..759ec27 100644 --- a/startnet-template.cmd +++ b/startnet-template.cmd @@ -103,3 +103,19 @@ net use Z: \\10.9.100.1\winpeapps\ge-shopfloor-mce /persistent:no goto end :end +echo. +echo Waiting for PESetup.exe to start... +:wait_start +timeout /t 2 /nobreak >NUL +tasklist /FI "IMAGENAME eq PESetup.exe" 2>NUL | find /I "PESetup.exe" >NUL +if errorlevel 1 goto wait_start +echo PESetup.exe is running. Waiting for imaging to complete... +:wait_finish +timeout /t 10 /nobreak >NUL +tasklist /FI "IMAGENAME eq PESetup.exe" 2>NUL | find /I "PESetup.exe" >NUL +if not errorlevel 1 goto wait_finish +echo. +echo Imaging complete. Rebooting in 15 seconds... +echo Press Ctrl+C to cancel. +timeout /t 15 +wpeutil reboot