slitaz-tools diff installer/tazinst @ rev 660
tazinst: just some more checks
author | Dominique Corbex <domcox@slitaz.org> |
---|---|
date | Mon Aug 01 22:56:46 2011 +0200 (2011-08-01) |
parents | c28183eaefef |
children | 97804a1ab52e |
line diff
1.1 --- a/installer/tazinst Sun Jul 31 10:32:56 2011 +0200 1.2 +++ b/installer/tazinst Mon Aug 01 22:56:46 2011 +0200 1.3 @@ -19,7 +19,7 @@ 1.4 # 6: SliTaz system to upgrade not found 1.5 # 8: Internal error 1.6 1.7 -VERSION=3.20 1.8 +VERSION=3.21 1.9 1.10 # Internationalization 1.11 . /usr/bin/gettext.sh 1.12 @@ -185,8 +185,9 @@ 1.13 # $@ : 1.14 init() 1.15 { 1.16 - echo "=== Tazinst start at `date` ===" >$LOG 1.17 + echo "=== Tazinst: start at `date` ===" >$LOG 1.18 echo "Command: $0 $@" >>$LOG 1.19 + debug $(fdisk -l | grep \/dev) 1.20 1.21 # Default Type 1.22 INST_TYPE=cdrom 1.23 @@ -284,7 +285,7 @@ 1.24 usb|iso|web) 1.25 # We need a valid source 1.26 if [ -z "$SRC_FILE" ]; then 1.27 - msg "INST_TYPE=$INST_TYPE,`gettext "but SRC_FILE is not set"`"; error=yes 1.28 + msg "INST_TYPE=$INST_TYPE, `gettext "but no source file is provided"`"; error=yes 1.29 fi ;; 1.30 *) msg "INST_TYPE=$INST_TYPE: `gettext "Invalid setting"`"; error=yes ;; 1.31 esac 1.32 @@ -317,6 +318,9 @@ 1.33 if [ "$found" != "yes" ]; then 1.34 msg "TGT_PARTITION=$TGT_PARTITION: `gettext "Partition not found"`"; error=yes 1.35 fi 1.36 + if [ "$TGT_PARTITION" == "$SRC_FILE" ]; then 1.37 + msg $(gettext "Target and source partitions should be different."); error=yes 1.38 + fi 1.39 1.40 # Check Filesystem 1.41 case $TGT_FS in 1.42 @@ -341,6 +345,12 @@ 1.43 if [ "$found" != "yes" ]; then 1.44 msg "TGT_HOME=$TGT_HOME: `gettext "Partition not found"`"; error=yes 1.45 fi 1.46 + if [ "$TGT_HOME" == "$SRC_FILE" ]; then 1.47 + msg $(gettext "/home and source partitions should be different."); error=yes 1.48 + fi 1.49 + if [ "$TGT_HOME" == "$TGT_PARTITION" ]; then 1.50 + msg $(gettext "main and /home partitions should be different."); error=yes 1.51 + fi 1.52 fi 1.53 1.54 # Check Home Filesystem 1.55 @@ -354,13 +364,13 @@ 1.56 if [ "$found" == "no" ]; then 1.57 msg "$TGT_FS: mkfs.$TGT_FS `gettext "is not installed."`"; error=yes 1.58 fi ;; 1.59 - *) msg "TGT_HOME_FS=$TGT_HOME_FS: `eval_gettext "Unknown filesystem"`"; error=yes ;; 1.60 + *) msg "TGT_HOME_FS=$TGT_HOME_FS: `gettext "Unknown filesystem"`"; error=yes ;; 1.61 esac 1.62 1.63 # Check Grub 1.64 case $TGT_GRUB in 1.65 yes|no) ;; 1.66 - *) msg "TGT_GRUB=$TGT_GRUB: `eval_gettext "Invalid setting"`"; error=yes ;; 1.67 + *) msg "TGT_GRUB=$TGT_GRUB: `gettext "Invalid setting"`"; error=yes ;; 1.68 esac 1.69 1.70 # Check Winboot 1.71 @@ -368,7 +378,7 @@ 1.72 "") ;; 1.73 auto) ;; 1.74 hd[[:digit:]],[[:digit:]]) ;; 1.75 - *) msg "TGT_WINBOOT=$TGT_WINBOOT: `eval_gettext "Invalid format"`"; error=yes ;; 1.76 + *) msg "TGT_WINBOOT=$TGT_WINBOOT: `gettext "Invalid format"`"; error=yes ;; 1.77 esac 1.78 1.79 # Stop on error 1.80 @@ -453,7 +463,7 @@ 1.81 fi 1.82 src_md5=$(echo $SRC_FILE | sed 's/.iso$/.md5/') 1.83 debug "Downloading $src_md5" 1.84 - wget $src_md5 -P /tmp || warning "$src_md5: `eval_gettext "Failed to download."`" 1.85 + wget $src_md5 -P /tmp || warning "$src_md5: `gettext "Failed to download."`" 1.86 tmpfile=$(echo $SRC_FILE | awk 'BEGIN{RS="/"}{out=$1}END{printf"%s",out}') 1.87 SRC_FILE="/tmp/$tmpfile" 1.88 check_iso