wok-stable diff slitaz-tools/stuff/tazinst.patch @ rev 12465

Up e2fsprogs (1.44.2)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Mar 04 18:42:23 2019 +0100 (2019-03-04)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/slitaz-tools/stuff/tazinst.patch	Mon Mar 04 18:42:23 2019 +0100
     1.3 @@ -0,0 +1,110 @@
     1.4 +--- slitaz-tools-4.9.1/installer/tazinst
     1.5 ++++ /usr/sbin/tazinst
     1.6 +@@ -20,7 +20,7 @@
     1.7 + # 7: Another instance is running
     1.8 + # 8: Internal error
     1.9 + 
    1.10 +-VERSION=3.32
    1.11 ++VERSION=3.34
    1.12 + 
    1.13 + # Internationalization
    1.14 + . /usr/bin/gettext.sh
    1.15 +@@ -115,6 +115,7 @@
    1.16 + gen_setup()
    1.17 + {
    1.18 + 	SETUP=$1
    1.19 ++	[ -z "$1" ] && abort 1 "Missing <file> parameter for install configuration"
    1.20 + 	touch $SETUP || abort 2 $(gettext "Can't write setup file")
    1.21 + 	if [ -r "$SETUP" ]; then
    1.22 + 		cat > $SETUP << _EOF_
    1.23 +@@ -172,7 +173,7 @@
    1.24 + TGT_WINBOOT=""
    1.25 + 
    1.26 + _EOF_
    1.27 +-
    1.28 ++		echo "$(ls $1)" $(gettext "created")
    1.29 + 	else
    1.30 + 		abort 2 $(gettext "Setup file not found")
    1.31 + 	fi
    1.32 +@@ -339,10 +340,10 @@
    1.33 + 		btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|jfs|ntfs|reiser4|reiserfs|ufs|xfs)
    1.34 + 			found=no
    1.35 + 			for xdir in /sbin /usr/sbin /usr/bin; do
    1.36 +-				[ -x "$xdir/mkfs.$TGT_FS" ] && found=yes
    1.37 ++				[ -x "$xdir/mkfs.$TGT_HOME_FS" ] && found=yes
    1.38 + 			done
    1.39 + 			if [ "$found" == "no" ]; then
    1.40 +-				msg "$TGT_FS: mkfs.$TGT_FS $(gettext "is not installed")"; error=yes
    1.41 ++				msg "$TGT_FS: mkfs.$TGT_HOME_FS $(gettext "is not installed")"; error=yes
    1.42 + 			fi ;;
    1.43 + 		*) msg "$TGT_HOME_FS: $(gettext "Unknown filesystem (/home)")"; error=yes ;;
    1.44 + 	esac
    1.45 +@@ -774,20 +775,39 @@
    1.46 + 	debug "Searching for Windows"
    1.47 + 	if [ "$TGT_WINBOOT" == "auto" ];then
    1.48 + 		WINBOOT=$(fdisk -l | awk '
    1.49 +-BEGIN{disk=-1,	found=-1,	winboot=""}
    1.50 ++BEGIN{
    1.51 ++	disk=-1
    1.52 ++	found=0 
    1.53 ++	winboot=""}
    1.54 + {
    1.55 +-	# Counting disk
    1.56 +-	if ($1=="Disk"){disk++, part=-1}
    1.57 +-	# Counting partition
    1.58 +-	if (substr($1,1,4)=="/dev"){part++}
    1.59 +-	# Read partition Id
    1.60 +- 	if ($2=="*"){Id=$6}	else {Id=$5}
    1.61 +-	# Detect Windows type
    1.62 +-	if (Id=="7" || Id=="b"){
    1.63 +-		if (found){
    1.64 +-			# record 1st Windows partition found
    1.65 +-			winboot=sprintf("hd%d,%d",disk,part),found++}
    1.66 ++	# Count disks
    1.67 ++	if ($1=="Disk"){
    1.68 ++		disk++
    1.69 ++		part=-1
    1.70 ++		dev=substr($2,6,3)
    1.71 ++		# get removable status
    1.72 ++		file="/sys/block/"dev"/removable"
    1.73 ++		"cat " file | getline removable
    1.74 ++		close("cat ")
    1.75 ++}
    1.76 ++	# Count partitions
    1.77 ++	if (substr($1,1,4)=="/dev"){
    1.78 ++		# List fixed drives only
    1.79 ++		if (removable==0){
    1.80 ++			part++
    1.81 ++			# Read partition Id
    1.82 ++	 		if ($2=="*"){Id=$6} else {Id=""}
    1.83 ++			# Detect Windows Partition Type: 7,b,c,e,f
    1.84 ++			WPT="[7bcef]"
    1.85 ++			if (Id ~ WPT){
    1.86 ++				found++
    1.87 ++				# record 1st Windows partition found
    1.88 ++				if (found==1){
    1.89 ++					winboot=sprintf("hd%d,%d",disk,part)
    1.90 ++				}
    1.91 ++			}
    1.92 + 		}
    1.93 ++	}
    1.94 + }
    1.95 + END{printf "%s", winboot}')
    1.96 + 		if [ -z "$WINBOOT" ]; then
    1.97 +@@ -1201,6 +1221,7 @@
    1.98 + 	new)
    1.99 + 		gen_setup $2 ;;
   1.100 + 	showurl)
   1.101 ++		LOG="/dev/null"
   1.102 + 		case $2 in
   1.103 + 			stable)
   1.104 + 				echo $URL_STABLE ;;
   1.105 +@@ -1208,6 +1229,8 @@
   1.106 + 				echo $URL_COOKING ;;
   1.107 + 			rolling)
   1.108 + 				echo $URL_ROLLING ;;
   1.109 ++			*)
   1.110 ++				abort 1 $(gettext "Unknown url shortcut")
   1.111 + 		esac ;;
   1.112 + 	check)
   1.113 + 		LOG="/dev/null"