Compare commits

..

No commits in common. "382b4cb7dc77dc3d4d9ff3e081deca428fcea8d0" and "4f19c604c7331c194342df583480a7ea8322371d" have entirely different histories.

4 changed files with 12 additions and 44 deletions

View File

@ -90,7 +90,6 @@ while [[ $# -gt 0 ]]; do
--size) IMG_SIZE="$2"; shift 2 ;;
--embed-image) EMBED_IMAGE="$2"; shift 2 ;;
--local-cache) USE_LOCAL_CACHE=1; shift ;;
--slipstream) SLIPSTREAM_DEBS=1; shift ;;
--no-slipstream) SLIPSTREAM_DEBS=0; shift ;;
--no-compress) NO_COMPRESS=1; shift ;;
--no-led) INCLUDE_LED_KERNEL=0; shift ;;

View File

@ -178,30 +178,16 @@ check_prerequisites() {
fi
fi
# Charger les modules nécessaires. dwc2 must be loaded FIRST — it creates
# the UDC node that the gadget functions bind to. Historically dwc2 was
# loaded implicitly by secubox-eye-gadget.service's ExecStartPre; with
# that service disabled at boot (storage-only mode is opt-in), the
# gadget chain now owns its own dwc2 modprobe explicitly.
modprobe dwc2 2>/dev/null || true
# Charger les modules nécessaires
modprobe libcomposite 2>/dev/null || true
modprobe usb_f_ecm 2>/dev/null || true
modprobe usb_f_rndis 2>/dev/null || true
modprobe usb_f_acm 2>/dev/null || true
modprobe usb_f_mass_storage 2>/dev/null || true
# dwc2 binds asynchronously to the BCM USB controller — wait up to 5s
# for the UDC node to appear (typically <500ms on a Pi Zero W).
for _ in 1 2 3 4 5 6 7 8 9 10; do
if [[ -d /sys/class/udc ]] && [[ -n "$(ls /sys/class/udc 2>/dev/null)" ]]; then
break
fi
sleep 0.5
done
# Vérifier la présence d'un UDC (USB Device Controller)
if [[ ! -d /sys/class/udc ]] || [[ -z "$(ls /sys/class/udc 2>/dev/null)" ]]; then
err "Aucun UDC trouvé — vérifier dtoverlay=dwc2 dans /boot/config.txt et module dwc2 dans /etc/modules"
err "Aucun UDC trouvé — ce script doit être exécuté sur un RPi Zero W"
return 1
fi

View File

@ -650,14 +650,9 @@ mkdir -p "$ROOT_MNT/etc/systemd/system/dnsmasq.service.d"
cp "$SCRIPT_DIR/files/etc/systemd/system/dnsmasq.service.d/secubox-eye.conf" \
"$ROOT_MNT/etc/systemd/system/dnsmasq.service.d/"
# secubox-eye-gadget is STORAGE-only mode for U-Boot rescue. Enabling it
# at boot alongside secubox-otg-gadget.service (composite ECM+ACM) caused
# UDC contention. Install the unit but DO NOT enable at boot.
# Manual U-Boot rescue mode:
# systemctl disable secubox-otg-gadget.service
# systemctl enable --now secubox-eye-gadget.service
# ln -sf /etc/systemd/system/secubox-eye-gadget.service \
# "$ROOT_MNT/etc/systemd/system/multi-user.target.wants/"
# Enable new gadget service
ln -sf /etc/systemd/system/secubox-eye-gadget.service \
"$ROOT_MNT/etc/systemd/system/multi-user.target.wants/"
# Copy framebuffer dashboard (Pi Zero W has no NEON, can't run Chromium)
log "Installing framebuffer dashboard..."
@ -689,15 +684,10 @@ if [[ -f "$SCRIPT_DIR/secubox-eye-agent.service" && -f "$SCRIPT_DIR/config.toml.
# Install agent service
cp "$SCRIPT_DIR/secubox-eye-agent.service" "$ROOT_MNT/etc/systemd/system/"
# The agent depends on Pydantic v2 (pydantic_core, Rust) which has no
# ARMv6 wheel — pip ships an ARMv7 wheel that crashes with SIGILL on
# the Pi Zero W BCM2835 (status=4/ILL). v2.2.1 design moved metrics
# rendering to secubox-fallback-display.service (pure-Python Pillow),
# so we install the unit but DO NOT enable at boot. ARMv7+ boards:
# systemctl enable --now secubox-eye-agent.service
# Enable agent service via symlink (atomic, no chroot needed)
mkdir -p "$ROOT_MNT/etc/systemd/system/multi-user.target.wants"
# ln -sf /etc/systemd/system/secubox-eye-agent.service \
# "$ROOT_MNT/etc/systemd/system/multi-user.target.wants/"
ln -sf /etc/systemd/system/secubox-eye-agent.service \
"$ROOT_MNT/etc/systemd/system/multi-user.target.wants/"
# v2.2.0: Install menu system icons for radial menu
if [[ -d "$SCRIPT_DIR/assets/icons" ]]; then
@ -776,10 +766,7 @@ ln -sf /etc/systemd/system/eye-firstboot-hostname.service "$ROOT_MNT/etc/systemd
ln -sf /etc/systemd/system/hyperpixel2r-init.service "$ROOT_MNT/etc/systemd/system/multi-user.target.wants/" 2>/dev/null || true
# Eye Remote services
# secubox-eye-gadget (storage-only, U-Boot rescue) is NOT enabled at boot
# to avoid UDC contention with secubox-otg-gadget.service. See comment at
# line 653 for the manual rescue-mode recipe.
# ln -sf /etc/systemd/system/secubox-eye-gadget.service "$ROOT_MNT/etc/systemd/system/multi-user.target.wants/" 2>/dev/null || true
ln -sf /etc/systemd/system/secubox-eye-gadget.service "$ROOT_MNT/etc/systemd/system/multi-user.target.wants/" 2>/dev/null || true
# v2.2.1: Use fallback-display instead of eye-agent (3D cube + rainbow rings, stable)
ln -sf /etc/systemd/system/secubox-fallback-display.service "$ROOT_MNT/etc/systemd/system/multi-user.target.wants/" 2>/dev/null || true
# NOTE: secubox-eye-agent is broken (import errors) - disabled pending fix

View File

@ -17,19 +17,15 @@ After=systemd-modules-load.service
Before=network-pre.target
Wants=network-pre.target
# Conditions : configfs disponible (UDC est crééable dynamiquement via dwc2,
# voir ExecStartPre — pas de pré-condition stricte sur /sys/class/udc).
# Conditions : seulement sur un périphérique avec UDC (RPi Zero W)
ConditionPathIsDirectory=/sys/class/udc
ConditionPathExists=/sys/kernel/config
[Service]
Type=oneshot
RemainAfterExit=yes
# Chargement des modules nécessaires. dwc2 est chargé en premier pour créer
# le UDC (sinon le gadget ne peut s'attacher). secubox-eye-gadget.service
# le chargeait historiquement avant; depuis qu'il est désactivé au boot
# (storage-only mode opt-in), on doit le charger ici.
ExecStartPre=/sbin/modprobe dwc2
# Chargement des modules nécessaires
ExecStartPre=/sbin/modprobe libcomposite
ExecStartPre=/sbin/modprobe usb_f_ecm
ExecStartPre=/sbin/modprobe usb_f_acm