fix(live-usb): Fix hanging boot services

- Add 10s timeout to secubox-cmdline.service
- Add 5s timeout to netplan apply
- Remove pipefail to allow graceful failures
- Scripts now continue on non-critical errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-03-30 11:23:45 +02:00
parent cbe43876a2
commit ba02a422a2
3 changed files with 5 additions and 3 deletions

View File

@ -4,7 +4,7 @@
# Parses kernel parameters for SecuBox-specific options
# Run early at boot before network configuration
# ══════════════════════════════════════════════════════════════════
set -euo pipefail
set -u # Exit on undefined variables, but allow command failures
CMDLINE="${1:-/proc/cmdline}"
MARKER_DIR="/var/lib/secubox"

View File

@ -4,7 +4,7 @@
# Detects board type and configures WAN/LAN interfaces accordingly
# Supports: EspressoBin, MochaBin, x64 (VM/Bare-metal)
# ══════════════════════════════════════════════════════════════════
set -euo pipefail
set -u # Exit on undefined variables, but allow command failures
SECUBOX_CONF="/etc/secubox/secubox.conf"
NETPLAN_DIR="/etc/netplan"
@ -339,7 +339,8 @@ main() {
# Generate and apply netplan configuration
generate_netplan "$board" "$wan_iface" "$lan_ifaces" "$sfp_ifaces" "$mode"
log "Applying netplan..."
netplan apply 2>/dev/null || warn "netplan apply failed"
# Use timeout to prevent hanging
timeout 5 netplan apply 2>/dev/null || log "netplan apply skipped or failed"
ok "Network configuration applied (mode: $mode)"
;;
test)

View File

@ -7,6 +7,7 @@ After=local-fs.target
[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=10s
ExecStart=/usr/sbin/secubox-cmdline-handler apply
[Install]