From 3d6b10723e57d5935f813d23e15c04b92d279cf8 Mon Sep 17 00:00:00 2001 From: Filippo Bedendo Bordon Date: Sat, 18 Feb 2012 17:56:33 +0100 Subject: [PATCH] Add various checks --- src/usbinstall.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/usbinstall.sh b/src/usbinstall.sh index 040b14a..4a4b9a0 100755 --- a/src/usbinstall.sh +++ b/src/usbinstall.sh @@ -176,6 +176,7 @@ fi #=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ #--------------------------------(INSTALLATION)-------------------------------------- #=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ +export LOGFILE=/var/log/usbinstall.log set_status "Smonto la chiavetta" DEVICEISMOUNTED=`dbus_properties_get_bool org.freedesktop.UDisks /org/freedesktop/UDisks/devices/${SELECT_USB/*\/}1 \ @@ -190,15 +191,23 @@ set_pbar 2 set_status "Formattazione della chiavetta in corso..." -sudo fdisk $SELECT_USB < ./fdisk_template +echo "Format..." +sudo fdisk $SELECT_USB < /usr/share/openmamba/usbinstall/fdisk_template &>$LOGFILE if [ "$?" != "0" ]; then - errorAndExit "Error: fdisk exit with error" + errorAndExit "Error: \"fdisk\" exit with error (see $LOGFILE)" fi set_pbar 5 -sudo mkfs.ext3 ${SELECT_USB}1 -L openmamba_live -sleep 1 +echo "Make Fs (ext3)..." +sudo mkfs.ext3 ${SELECT_USB}1 -L openmamba_live &>>$LOGFILE +if [ "$?" != "0" ]; then + errorAndExit "Error: \"mkfs.ext3\" exit with error (see $LOGFILE)" +fi + LANG=C udisks --mount ${SELECT_USB}1 +if [ "$?" != "0" ]; then + errorAndExit "Error: \"udisks --mount\" exit with error (see $LOGFILE)" +fi set_pbar 30