Auto-reboot after imaging, auto-download pip-wheels in build scripts
startnet.cmd now polls for PESetup.exe completion and reboots with a 15-second countdown. Build scripts (USB + Proxmox) auto-download pip wheels if the pip-wheels/ directory is missing. Added mok-keys/ to gitignore. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -44,5 +44,8 @@ __pycache__/
|
|||||||
*.pyo
|
*.pyo
|
||||||
venv/
|
venv/
|
||||||
|
|
||||||
|
# MOK Secure Boot signing keys (contains private key)
|
||||||
|
mok-keys/
|
||||||
|
|
||||||
# Secrets
|
# Secrets
|
||||||
secrets.md
|
secrets.md
|
||||||
|
|||||||
@@ -232,11 +232,20 @@ if [ -d "$WEBAPP_DIR" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Python wheels
|
# 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
|
if [ -d "$PIP_WHEELS_DIR" ]; then
|
||||||
cp -r "$PIP_WHEELS_DIR" "$PXE_DATA/pip-wheels"
|
cp -r "$PIP_WHEELS_DIR" "$PXE_DATA/pip-wheels"
|
||||||
echo " Copied pip-wheels/"
|
WHEEL_COUNT=$(find "$PIP_WHEELS_DIR" -name '*.whl' | wc -l)
|
||||||
else
|
echo " Copied pip-wheels/ ($WHEEL_COUNT wheels)"
|
||||||
echo " WARNING: No pip-wheels/ found (run download-packages.sh first)"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# WinPE boot files (wimboot, boot.wim, BCD, ipxe.efi, etc.)
|
# WinPE boot files (wimboot, boot.wim, BCD, ipxe.efi, etc.)
|
||||||
|
|||||||
17
build-usb.sh
17
build-usb.sh
@@ -187,11 +187,22 @@ fi
|
|||||||
|
|
||||||
# Copy pip wheels for offline Flask install
|
# Copy pip wheels for offline Flask install
|
||||||
PIP_WHEELS_DIR="$SCRIPT_DIR/pip-wheels"
|
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
|
if [ -d "$PIP_WHEELS_DIR" ]; then
|
||||||
cp -r "$PIP_WHEELS_DIR" "$MOUNT_POINT/pip-wheels"
|
cp -r "$PIP_WHEELS_DIR" "$MOUNT_POINT/pip-wheels"
|
||||||
echo " Copied pip-wheels/"
|
WHEEL_COUNT=$(find "$PIP_WHEELS_DIR" -name '*.whl' | wc -l)
|
||||||
else
|
echo " Copied pip-wheels/ ($WHEEL_COUNT wheels)"
|
||||||
echo " No pip-wheels/ found (run download-packages.sh first)"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy WinPE boot files (wimboot, boot.wim, BCD, ipxe.efi, etc.)
|
# Copy WinPE boot files (wimboot, boot.wim, BCD, ipxe.efi, etc.)
|
||||||
|
|||||||
@@ -103,3 +103,19 @@ net use Z: \\10.9.100.1\winpeapps\ge-shopfloor-mce /persistent:no
|
|||||||
goto end
|
goto end
|
||||||
|
|
||||||
: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
|
||||||
|
|||||||
@@ -103,3 +103,19 @@ net use Z: \\10.9.100.1\winpeapps\ge-shopfloor-mce /persistent:no
|
|||||||
goto end
|
goto end
|
||||||
|
|
||||||
: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
|
||||||
|
|||||||
Reference in New Issue
Block a user