[Server-devel] [PATCH] mkusbinstall: Fix loop in options handling, disk space check

Martin Langhoff martin at laptop.org
Thu Sep 4 19:39:30 EDT 2008


---
 util/mkusbinstall |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/util/mkusbinstall b/util/mkusbinstall
index 76cd29d..564db40 100755
--- a/util/mkusbinstall
+++ b/util/mkusbinstall
@@ -166,9 +166,11 @@ while [ $# -gt 2 ]; do
     case $1 in
 	--noverify)
 	    noverify=1
+	    shift;
 	    ;;
 	--reset-mbr|--resetmbr)
 	    resetmbr=1
+	    shift;
 	    ;;
 	*)
 	    usage
@@ -223,7 +225,10 @@ trap exitclean SIGINT SIGTERM
   check=$CDMNT
 
 # let's try to make sure there's enough room on the stick
-  tbd=0
+tbd=0
+if [ -d $USBMNT/iso ]; then
+    tbd=$(du -s -B 1M $USBMNT/iso | awk {'print $1;'})
+fi
 livesize=$(du -s -B 1M $check | awk {'print $1;'})
 free=$(df  -B1M $USBDEV  |tail -n 1 |awk {'print $4;'})
 if [ $livesize -gt $(($free + $tbd)) ]; then
-- 
1.5.5.1



More information about the Server-devel mailing list