Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add special handling for the /mnt/home desktop icon under PUPMODE 6 #2833

Merged
merged 1 commit into from
Feb 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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