[ would have taken me days or weeks to figure out a missing variable i guess .]
1. /usr/sbin/filemnt WORKS on both encrypted savefiles !! HURRAY !!
[ really missed that feature

ONE MINOR THINGY about /usr/sbin/filemnt
which is not only cosmetic :
due to the code checks if FILE is mounted due to a simple
if [ ! -d "$MntPt" ] ;then
::MANY TIMES (99%+) the rmdir $MntPt at the end of umount $MntPt does not succeed ,
i guess due to little time for the system to update everything .
AN ALWAYS WORKING " rmdir $MntPt " i could achieve with either both of these :
Code: Select all
--- /initrd/pup_ro2/usr/sbin/filemnt 2011-11-10 12:03:10.000000000 +0800
+++ /usr/sbin/filemnt 2011-11-11 12:05:50.000000000 +0800
@@ -166,7 +166,7 @@ Note, there is an SFS-version-converter
rox -D $MntPt #BK
umount $MntPt
Err=$?
- rmdir $MntPt
+ #rmdir $MntPt ##KRG though umount finishes , many times rmdir thinks $MntPt still not empty
if [ "basename $imgFile" = 'initrd' ] ;then gzip -9 $imgFile ;fi
# yaf-splash -timeout 3 -font "8x16" -outline 0 -margin 4 -bg orange -text "Unmounting $imgFileBASE" #BK
# /usr/X11R7/bin/yaf-splash -timeout 3 -font "8x16" -outline 0 -margin 4 -bg orange -text "Unmounting $imgFileBASE" #BK
@@ -181,5 +181,5 @@ Note, there is an SFS-version-converter
#xmessage -title " ERROR..." " Failed mounting or unmounting. "
pupdialog --background red --title "ERROR" --msgbox "Failed mounting or unmounting" 0 0
fi
-
+[ -d "$MntPt" -a "`busybox mount | grep "$MntPt"`" = "" ] && rmdir "$MntPt"
###END###
Code: Select all
--- /initrd/pup_ro2/usr/sbin/filemnt 2011-11-10 12:03:10.000000000 +0800
+++ /usr/sbin/filemnt 2011-11-11 13:10:08.000000000 +0800
@@ -37,7 +37,7 @@ fi
imgFile="`pwd``echo $imgFile |sed 's/^\.//'`"
fi
MntPt='/mnt/'`echo "$imgFile" |sed "s#^\.##g" |sed "s#/#+#g"`
-
+ [ -d "$MntPt" -a "`busybox mount | grep "$MntPt"`" = "" ] && rmdir "$MntPt"
if [ 1 -eq 2 ] ;then ############################################## JUMP OVER this SECTION.
@@ -166,7 +166,7 @@ Note, there is an SFS-version-converter
rox -D $MntPt #BK
umount $MntPt
Err=$?
- rmdir $MntPt
+ #rmdir $MntPt ##KRG though umount finishes , many times rmdir thinks $MntPt still not empty
if [ "basename $imgFile" = 'initrd' ] ;then gzip -9 $imgFile ;fi
# yaf-splash -timeout 3 -font "8x16" -outline 0 -margin 4 -bg orange -text "Unmounting $imgFileBASE" #BK
# /usr/X11R7/bin/yaf-splash -timeout 3 -font "8x16" -outline 0 -margin 4 -bg orange -text "Unmounting $imgFileBASE" #BK
would need several
[ "$DISPLAY" ] && yaf-splash || pupdialog
realpath $1 || readlink -e $1 ##if called with filemnt ./save-file.2fs
if [ "$DISPLAY" ] ; then
rxvt -geometry 25x3 -title "Enter password" -bg orange -e losetup-FULL -E 1 $DEVLOOP $imgFile
else
echo "Enter password :"
losetup-FULL -E 1 $DEVLOOP $imgFile
fi
END of play-around ]