Skip to content

Commit

Permalink
Support for savefolder in puppyinstaller and partview.
Browse files Browse the repository at this point in the history
This is based on modifications suggested by puppy forum member shinobar
see http://www.murga-linux.com/puppy/viewtopic.php?p=780175#780175
  • Loading branch information
mavrothal committed May 30, 2014
1 parent 31993e7 commit 471f518
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions woof-code/rootfs-skeleton/usr/sbin/partview
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,20 @@ do
fi
AFS="`echo -n "$APART" | cut -f 2 -d '|'`"
AFPATTERN="^/dev/$ATAG "
AUSED=`df -k | grep "$AFPATTERN" | tr -s " " | cut -f 3 -d " "`
AUSED=`df -k | grep "$AFPATTERN" | head -n 1 | tr -s " " | cut -f 3 -d " "`
if [ ! "$AUSED" ];then
MNTSTATUS='(not mounted)'
mkdir -p /mnt/$ATAG
mount -t $AFS /dev/$ATAG /mnt/$ATAG > /dev/null 2>&1
if [ $? -eq 0 ];then
AUSED=`df -k | grep "$AFPATTERN" | tr -s " " | cut -f 3 -d " "`
AUSED=`df -k | grep "$AFPATTERN" | head -n 1 | tr -s " " | cut -f 3 -d " "`
umount /dev/$ATAG
else
continue
fi
fi

AFREE=`expr $ASIZE - $AUSED`
nAUSED=`expr $BOXWIDTH \* $AUSED \/ $ASIZE` #normalise.
[ $nAUSED -eq 0 ] && nAUSED=1
#process size...
if [ $AFREE -gt 1048576 ];then #1024*1024
ONEFREE="`dc $AFREE 1048576 \/ p`"
Expand Down
8 changes: 4 additions & 4 deletions woof-code/rootfs-skeleton/usr/sbin/puppyinstaller
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ ispupfunc() { #two params: fstype partition
PUPVEROLD='0.0' #110422
[ ! $2 ] && return 0
mkdir -p /mnt/$2
ISPUPMNTPT="`mount | grep "^/dev/$2" | tr -s " " | cut -f 3 -d " "`"
ISPUPMNTPT="`mount | grep "^/dev/$2" | head -n 1 |tr -s " " | cut -f 3 -d " "`"
if [ "$ISPUPMNTPT" = "" ];then
ISPUPMNTPT="/mnt/$2"
mount -t $1 /dev/$2 /mnt/$2
Expand Down Expand Up @@ -584,13 +584,13 @@ fi
#sanity check...
SANITYPART="`echo -n "$RETTXT" | grep '^EXIT' | cut -f 2 -d '"' | cut -f 2 -d '_'`" #'geany
smPTN="^/dev/${SANITYPART} " #111011
SANITYMNTPT="`mount | grep "$smPTN" | tr -s " " | cut -f 3 -d " "`"
SANITYMNTPT="`mount | grep "$smPTN" | head -n 1 | tr -s " " | cut -f 3 -d " "`"
if [ ! "$SANITYMNTPT" = "" ];then
SANITYMSG1="$SANITYPART $(gettext 'currently mounted, need to unmount it!!!')"
SANITYMSG2="$SANITYPART $(gettext 'currently mounted read-write.')"
SANITYMSG3="`eval_gettext \"\\\$SANITYPART does not have \\\${DISTRO_FILE_PREFIX}save.3fs file in it.\"`"
SANITYRORW="`mount | grep "/$SANITYPART" | tr -s " " | cut -f 6 -d " "`"
SANITYRORW="`mount | grep "/$SANITYPART" | head -n 1 | tr -s " " | cut -f 6 -d " "`"
[ ! "`echo -n "$SANITYMNTPT" | grep "/initrd/"`" = "" ] && SANITYMSG1="$SANITYPART $(gettext 'cannot be unmounted!')"
[ "$SANITYRORW" = "(ro)" ] && SANITYMSG2="$SANITYPART $(gettext 'is mounted read-only!')"
[ -f $SANITYMNTPT/${DISTRO_FILE_PREFIX}save.3fs ] && SANITYMSG3="`eval_gettext \"\\\$SANITYPART has personal file \\\${DISTRO_FILE_PREFIX}save.3fs in it!\"`"
Expand Down Expand Up @@ -1130,7 +1130,7 @@ Click OK to quit...\"`"
#SRCPATH where to get vmlinuz, initrd, ${DISTRO_PUPPYSFS}, PUPVEROLD is old puppy version in
#format 200 (without dots) =0 if no prior installed puppy,
#NEWVER is new puppy version, DESTSIZM is size of dest partition in Mb (real number),
DESTMNTPT="`mount | grep "/dev/${DESTPART} " | tr -s " " | cut -f 3 -d " "`" #120310
DESTMNTPT="`mount | grep "/dev/${DESTPART} " | head -n 1 | tr -s " " | cut -f 3 -d " "`" #120310
#120310 er, i think this only needed for older version of ntfs-3g. harmless with latest ntfs-3g...
[ "$DESTMNTPT" = "" ] && DESTMNTPT="`ps -e | grep -o 'ntfs\-3g.*' | grep "/dev/${DESTPART} " | tr '\t' ' ' | tr -s ' ' | tr ' ' "\n" | grep '^/mnt/'`" #120310
Expand Down

0 comments on commit 471f518

Please sign in to comment.