summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wallace <kevin@pentabarf.net>2025-12-30 15:38:10 -0800
committerKevin Wallace <kevin@pentabarf.net>2025-12-30 15:38:10 -0800
commit45e997cf354369ffb9785bc7b3c6f96c284774d3 (patch)
tree1738a659f5e92fd538ce099ca389fd4eb1019e4b
parentmove usb port down a tiny bit for mounting plate clearance (diff)
automount mp_sd by label in addition to path
By default, the system will automount /dev/disk/by-path/platform-ci_hdrc.1-usb-0:1.3:1.0-scsi-0:0:0:0-part1 but this won't work if there's a USB hub in the picture. If there's no disk at that path, this will additionally try to mount a disk with label "MP_SD".
-rw-r--r--flash.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/flash.py b/flash.py
index eeb4371..8cdc854 100644
--- a/flash.py
+++ b/flash.py
@@ -13,14 +13,20 @@ Fahrzeugadresse=11111111
MontageplattenNr=22222222
[TestMode]
0=echo -n "PROXdongl3: "
-1=if [ -e /init/efad/mp_sd/autorun.sh ]; then
-2= echo ok
-3= systemctl stop init-abtproxy
-4= sh /init/efad/mp_sd/autorun.sh
-5=else
-6= echo autorun.sh not on USB
-7= systemctl --no-block start nx
-8=fi
+0=dev=/dev/disk/by-label/MP_SD
+0=mp=/init/efad/mp_sd
+0=if [ -f $mp -a -e $dev ]; then
+0= rm $mp && mkdir $mp
+0= mount -o noatime $dev $mp || (rmdir $mp 2>/dev/null && touch $mp)
+0=fi
+0=if [ -e $mp/autorun.sh ]; then
+0= echo ok
+0= systemctl stop init-abtproxy
+0= sh $mp/autorun.sh
+0=else
+0= echo autorun.sh not on USB
+0= systemctl --no-block start nx
+0=fi
""".lstrip()
write_data = ini.strip().replace(b'\n', b'\r\n').ljust(size, b'\xff')