Unmount-all-mounted-partitions bug
Wow, a bug that has been there from the dawn of EasyOS, 2017! Miminou and Caramel have reported it here:
https://forum.puppylinux.com/viewtopic.php?p=173404#p173404
If the right-click on any of the drive partition icons running along the bottom of the screen, there is a menu option "Unmount all mounted partitions". To follow what happens if you choose that option, you need to look inside one of the folders in /root/.pup_event:
For example, say there is folder 'drive_sda6'. Do not click on it; instead, right-click and choose "Look inside". Then you will see three files; 'AppInfo.xml', 'AppRun' and 'info'
This is all ROX-Filer; you need to know how rox handles these files. Inside AppInfo.xml you will find the text "Unmount all mounted partitions" and in the same line "unmountall"; rox will call AppRun passing that "unmountall" string.
Look inside AppRun and you will see the problem:
#v424 have added right-click menu item to unmount all partitions (see pup_event_frontend_d)...
if [ "$PARAM1" = "unmountall" ];then
#190705 exclude WKG_DEV (see /etc/rc.d/PUPSTATE)...
for MNTPT in $(mount | grep '^/dev/' | grep -vE "^/dev/loop|^/dev/ram|^/dev/${WKG_DEV} " | cut -f 3 -d ' ' | grep -v '^/initrd/' | grep -v '^/$' | tr '\n' ' ')
do
unmount_func
done
exit
fi
...ancient code! That would have been written back around 2008 - 2009. I did put in a little fix for EasyOS in 2019, but missed the big problem. Here it is now, fixed:
#v424 have added right-click menu item to unmount all partitions (see pup_event_frontend_d)...
if [ "$PARAM1" = "unmountall" ];then
#190705 exclude WKG_DEV (see /etc/rc.d/PUPSTATE)...
#20260706 fix...
for MNTPT in $(grep '^/dev/' /proc/mounts | grep -vE "^/dev/loop|^/dev/ram|^/dev/${WKG_DEV} |^/dev/zram" | cut -f 2 -d ' ' | grep -vF '/mnt/.easy' | grep -v '^/$' | tr '\n' ' ')
do
unmount_func
done
exit
fi
In Easy, we see that, as the guys reported, with the old code, the '.easy_rw' folder gets unmounted, or attempted to:
# grep '^/dev/' /proc/mounts
/dev/nvme0n1p2 /mnt/nvme0n1p2 ext4 rw,noatime,commit=30,data=ordered 0 0
/dev/loop0 /mnt/.easy_ro/easy_sfs squashfs ro,noatime,errors=continue 0 0
/dev/zram1 /mnt/.easy_rw ext4 rw,relatime 0 0
/dev/sda2 /mnt/sda2 ext4 rw,relatime 0 0
#
This rox handling got implemented back in the very early Puppy
days. Let's see, look in /usr/local/pup_event/frontend_funcs;
there is a function 'create_icon_func' that calls function
'create_appinfo_func' that creates that AppInfo.xml
file.
Tags: easy