wok-stable rev 12276

slitaz-tools: new patch to tazinst fixes mkfs. error, improves win detection, add help user msgs
author Dominique Corbex <domcox@slitaz.org>
date Thu May 03 07:47:01 2012 +0200 (2012-05-03)
parents 6c8ca8c10417
children ccc42dc5096b
files slitaz-tools/receipt slitaz-tools/stuff/tazinst.patch
line diff
     1.1 --- a/slitaz-tools/receipt	Wed May 02 21:19:00 2012 +0200
     1.2 +++ b/slitaz-tools/receipt	Thu May 03 07:47:01 2012 +0200
     1.3 @@ -23,6 +23,8 @@
     1.4  compile_rules()
     1.5  {
     1.6      cd $src
     1.7 +	  # tazinst minor fixes
     1.8 +	  patch -p1 < $stuff/tazinst.patch || return 1
     1.9      make && make DESTDIR=$DESTDIR install
    1.10  }
    1.11  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/slitaz-tools/stuff/tazinst.patch	Thu May 03 07:47:01 2012 +0200
     2.3 @@ -0,0 +1,110 @@
     2.4 +--- slitaz-tools-4.9.1/installer/tazinst
     2.5 ++++ /usr/sbin/tazinst
     2.6 +@@ -20,7 +20,7 @@
     2.7 + # 7: Another instance is running
     2.8 + # 8: Internal error
     2.9 + 
    2.10 +-VERSION=3.32
    2.11 ++VERSION=3.34
    2.12 + 
    2.13 + # Internationalization
    2.14 + . /usr/bin/gettext.sh
    2.15 +@@ -115,6 +115,7 @@
    2.16 + gen_setup()
    2.17 + {
    2.18 + 	SETUP=$1
    2.19 ++	[ -z "$1" ] && abort 1 "Missing <file> parameter for install configuration"
    2.20 + 	touch $SETUP || abort 2 $(gettext "Can't write setup file")
    2.21 + 	if [ -r "$SETUP" ]; then
    2.22 + 		cat > $SETUP << _EOF_
    2.23 +@@ -172,7 +173,7 @@
    2.24 + TGT_WINBOOT=""
    2.25 + 
    2.26 + _EOF_
    2.27 +-
    2.28 ++		echo "$(ls $1)" $(gettext "created")
    2.29 + 	else
    2.30 + 		abort 2 $(gettext "Setup file not found")
    2.31 + 	fi
    2.32 +@@ -339,10 +340,10 @@
    2.33 + 		btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|jfs|ntfs|reiser4|reiserfs|ufs|xfs)
    2.34 + 			found=no
    2.35 + 			for xdir in /sbin /usr/sbin /usr/bin; do
    2.36 +-				[ -x "$xdir/mkfs.$TGT_FS" ] && found=yes
    2.37 ++				[ -x "$xdir/mkfs.$TGT_HOME_FS" ] && found=yes
    2.38 + 			done
    2.39 + 			if [ "$found" == "no" ]; then
    2.40 +-				msg "$TGT_FS: mkfs.$TGT_FS $(gettext "is not installed")"; error=yes
    2.41 ++				msg "$TGT_FS: mkfs.$TGT_HOME_FS $(gettext "is not installed")"; error=yes
    2.42 + 			fi ;;
    2.43 + 		*) msg "$TGT_HOME_FS: $(gettext "Unknown filesystem (/home)")"; error=yes ;;
    2.44 + 	esac
    2.45 +@@ -774,20 +775,39 @@
    2.46 + 	debug "Searching for Windows"
    2.47 + 	if [ "$TGT_WINBOOT" == "auto" ];then
    2.48 + 		WINBOOT=$(fdisk -l | awk '
    2.49 +-BEGIN{disk=-1,	found=-1,	winboot=""}
    2.50 ++BEGIN{
    2.51 ++	disk=-1
    2.52 ++	found=0 
    2.53 ++	winboot=""}
    2.54 + {
    2.55 +-	# Counting disk
    2.56 +-	if ($1=="Disk"){disk++, part=-1}
    2.57 +-	# Counting partition
    2.58 +-	if (substr($1,1,4)=="/dev"){part++}
    2.59 +-	# Read partition Id
    2.60 +- 	if ($2=="*"){Id=$6}	else {Id=$5}
    2.61 +-	# Detect Windows type
    2.62 +-	if (Id=="7" || Id=="b"){
    2.63 +-		if (found){
    2.64 +-			# record 1st Windows partition found
    2.65 +-			winboot=sprintf("hd%d,%d",disk,part),found++}
    2.66 ++	# Count disks
    2.67 ++	if ($1=="Disk"){
    2.68 ++		disk++
    2.69 ++		part=-1
    2.70 ++		dev=substr($2,6,3)
    2.71 ++		# get removable status
    2.72 ++		file="/sys/block/"dev"/removable"
    2.73 ++		"cat " file | getline removable
    2.74 ++		close("cat ")
    2.75 ++}
    2.76 ++	# Count partitions
    2.77 ++	if (substr($1,1,4)=="/dev"){
    2.78 ++		# List fixed drives only
    2.79 ++		if (removable==0){
    2.80 ++			part++
    2.81 ++			# Read partition Id
    2.82 ++	 		if ($2=="*"){Id=$6} else {Id=""}
    2.83 ++			# Detect Windows Partition Type: 7,b,c,e,f
    2.84 ++			WPT="[7bcef]"
    2.85 ++			if (Id ~ WPT){
    2.86 ++				found++
    2.87 ++				# record 1st Windows partition found
    2.88 ++				if (found==1){
    2.89 ++					winboot=sprintf("hd%d,%d",disk,part)
    2.90 ++				}
    2.91 ++			}
    2.92 + 		}
    2.93 ++	}
    2.94 + }
    2.95 + END{printf "%s", winboot}')
    2.96 + 		if [ -z "$WINBOOT" ]; then
    2.97 +@@ -1201,6 +1221,7 @@
    2.98 + 	new)
    2.99 + 		gen_setup $2 ;;
   2.100 + 	showurl)
   2.101 ++		LOG="/dev/null"
   2.102 + 		case $2 in
   2.103 + 			stable)
   2.104 + 				echo $URL_STABLE ;;
   2.105 +@@ -1208,6 +1229,8 @@
   2.106 + 				echo $URL_COOKING ;;
   2.107 + 			rolling)
   2.108 + 				echo $URL_ROLLING ;;
   2.109 ++			*)
   2.110 ++				abort 1 $(gettext "Unknown url shortcut")
   2.111 + 		esac ;;
   2.112 + 	check)
   2.113 + 		LOG="/dev/null"