Skip to content

Commit

Permalink
Merge pull request #1 from rserwin1/rserwin1-patch-2
Browse files Browse the repository at this point in the history
Update remasterpup2: change 5 greps for free space calculation
  • Loading branch information
rserwin1 committed Jul 29, 2016
2 parents 63f1283 + 54e5709 commit ea77b2c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions woof-code/rootfs-skeleton/usr/sbin/remasterpup2
Original file line number Diff line number Diff line change
Expand Up @@ -231,26 +231,26 @@ PARTSLIST="`probepart -m 2> /dev/null | grep '^/dev/' | grep -E 'f2fs|ext2|ext3|
ASIZE="`echo -n "$APART" | cut -f 3 -d '|'`"
AFS="`echo -n "$APART" | cut -f 2 -d '|'`"
AFPATTERN="^/dev/$ATAG " #v3.01
AFREE="`df -m | grep "$AFPATTERN" | tr -s " " | cut -f 4 -d " "`"
AFREE="`df -m | grep -m 1 "$AFPATTERN" | tr -s " " | cut -f 4 -d " "`"
FLAG_RO='no' #v431
if [ ! "$AFREE" ];then
MNTSTATUS="($m_08)" #"not mounted"
mkdir -p /mnt/$ATAG
mount -t $AFS /dev/$ATAG /mnt/$ATAG > /dev/null 2>&1
if [ $? -eq 0 ];then
if [ "$ATAG" = "fd0" ];then
FFREE=`df -k | grep "$AFPATTERN" | tr -s " " | cut -f 4 -d " "`
FFREE=`df -k | grep -m 1 "$AFPATTERN" | tr -s " " | cut -f 4 -d " "`
AFREE="`LANG=C dc $FFREE 1024 \/ p`"
else
AFREE="`df -m | grep "$AFPATTERN" | tr -s " " | cut -f 4 -d " "`"
AFREE="`df -m | grep -m 1 "$AFPATTERN" | tr -s " " | cut -f 4 -d " "`"
fi
[ "`mount | grep "$AFPATTERN" | grep ' (rw'`" = "" ] && FLAG_RO='yes' #v431 make sure writable.
[ "`mount | grep -m 1 "$AFPATTERN" | grep ' (rw'`" = "" ] && FLAG_RO='yes' #v431 make sure writable.
umount /dev/$ATAG
else #v431
continue
fi
else
[ "`mount | grep "$AFPATTERN" | grep ' (rw'`" = "" ] && FLAG_RO='yes' #v431 make sure writable.
[ "`mount | grep -m 1 "$AFPATTERN" | grep ' (rw'`" = "" ] && FLAG_RO='yes' #v431 make sure writable.
fi
[ "$FLAG_RO" = "yes" ] && continue #v431
[ "$AFS" ] && echo "${ATAG} \"${m_09}: $AFS ${m_10}: ${ASIZE}M ${m_11}: ${AFREE}M ${MNTSTATUS}\" \\" >> /tmp/schoices.txt #v3.01 added precaution. #130302 L18L
Expand Down

0 comments on commit ea77b2c

Please sign in to comment.