Check for GADGET_MODE in boot/firmware to enable

This commit is contained in:
2026-09-04 10:01:40 +00:00
parent 9c49411159
commit e6a0556147
2 changed files with 39 additions and 22 deletions
+7
View File
@@ -9,6 +9,13 @@ if [ $(id -u) -ne 0 ]; then
exit 1
fi
if [ -f /boot/firmware/GADGET_MODE ]; then
systemd-cat -t gadget.sh -p info echo "/boot/firmware/GADGET_MODE exists: GADGET mode enabled"
else
systemd-cat -t gadget.sh -p warning echo "/boot/firmware/GADGET_MODE missing: GADGET mode disabled"
systemctl disable serial-getty@ttyGS0.service
exit 1
fi
# Is the dwc2 overlay installed? Nothing will work if it isn't.
if [ -d /sys/class/udc ] && [ -n "$(ls -A /sys/class/udc)" ]; then