TCL 15.x armhf
RasPi Zero-W
I hadn't noticed this in the past (or may not have been in this situation?)
I have a CIFS mount to a NAS unit on the network using Zero's WiFi pointing to /mnt/os
I issued a reboot command and...
1. rc.shutdown calls sync ~line 10
2. WiFi disconnects from AP ~line 20 when processes are killed
3. rc.shutdown displays it's unloading file systems ~line 50+
4. System hangs (cannot cleanly unload CIFS since wireless is down)
Now it may have actually rebooted after so many minutes/timeout, but 30+ seconds went by before I did a hard reset
I created /etc/init.d/rc.dismount which I call from rc.shutdown after the sync command
#!/bin/busybox ash
. /etc/init.d/tc-functions
useBusybox
echo none > /sys/class/leds/ACT/trigger
echo mmc0 > /sys/class/leds/mmc0/trigger # <-- resets the LED if being used for something else
##=> System hangs if CIFS is not dismounted before WIFI
MOUNTS=$(mount | grep -v loop | grep // | awk '{print $3}') # <-- Get mount points that start with // (ie: //10.0.0.1/some/mount/point)
for MNT in $MOUNTS
do
echo "${CYAN}Dismounting ${MAGENTA}$MNT${NORMAL}"
umount $MNT
done
echo -n "${BLUE}" # <-- to put things back how we found 'em
It's a simple hack, but does the trick