Skip to content

Commit

Permalink
add special handling for the /mnt/home desktop icon under PUPMODE 6
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Feb 1, 2022
1 parent a890a7e commit c8aa15e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion woof-code/rootfs-skeleton/usr/local/pup_event/frontend_rox_funcs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ echo "$BPS" | grep -q 'ROX-Filer -p' && {
ROX_DESKTOP=yes
}

. /etc/rc.d/PUPSTATE
. /etc/rc.d/functions_x #fx_* functions

#130807 L18L
Expand Down Expand Up @@ -94,8 +95,14 @@ rox_icon_mounted_func() {
[ "$2" = "floppy" ] && DRVICON="floppy_mntd48.png"
[ "$2" = "optical" ] && DRVICON="optical_mntd48.png"
#MP: support luks-encrypted partitions
MOUNTPOINT=$(mount | grep -E "^/dev/${1} |^/dev/mapper/lukspartition_${1} " | cut -f 3 -d ' ')
MOUNTPOINT=$(mount | grep -m1 -E "^/dev/${1} |^/dev/mapper/lukspartition_${1} " | cut -f 3 -d ' ')
MOUNTEDBOOT=0
if [ "`echo "$MOUNTPOINT" | grep -v '/initrd/' | grep -v '^/$'`" = "" ] ; then
MOUNTEDBOOT=1
elif [ $PUPMODE -eq 6 -a "$MOUNTPOINT" = "`readlink /mnt/home`" ]; then
MOUNTEDBOOT=1
fi
if [ $MOUNTEDBOOT -eq 1 ]; then
#only partitions mntd on /initrd/* then must be mntd at boot. cannot unmount.
#also, full hd install has partition mntd on '/'.
DRVICON="drive_mntd_boot48.png" #default.
Expand Down Expand Up @@ -653,7 +660,13 @@ rox_desktop_icon_clicked() {
DRVX=$(fx_get_drvname $ONEDRVNAME)
probedisk $DRVX | grep -q 'usbdrv' && chk_swap $ONEDRVNAME $DRVX
[ "$MNTPT" = "" ] && exit #precaution.
CANUNMOUNT=1
if [ "$MNTPT" = "/" -o "`echo "$MNTPT" | grep '/initrd/'`" != "" ];then
CANUNMOUNT=0
elif [ $PUPMODE -eq 6 -a "$MNTPT" = "`readlink /mnt/home`" ];then
CANUNMOUNT=0
fi
if [ $CANUNMOUNT -eq 0 ]; then
/usr/lib/gtkdialog/box_ok "$(gettext 'Puppy drive manager')" error "$(eval_gettext "/dev/\${ONEDRVNAME} mounted on \${MNTPT}
is in use by Puppy. You cannot unmount it.")"
exit
Expand Down

0 comments on commit c8aa15e

Please sign in to comment.