wok-stable view 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 source
1 --- slitaz-tools-4.9.1/installer/tazinst
2 +++ /usr/sbin/tazinst
3 @@ -20,7 +20,7 @@
4 # 7: Another instance is running
5 # 8: Internal error
7 -VERSION=3.32
8 +VERSION=3.34
10 # Internationalization
11 . /usr/bin/gettext.sh
12 @@ -115,6 +115,7 @@
13 gen_setup()
14 {
15 SETUP=$1
16 + [ -z "$1" ] && abort 1 "Missing <file> parameter for install configuration"
17 touch $SETUP || abort 2 $(gettext "Can't write setup file")
18 if [ -r "$SETUP" ]; then
19 cat > $SETUP << _EOF_
20 @@ -172,7 +173,7 @@
21 TGT_WINBOOT=""
23 _EOF_
24 -
25 + echo "$(ls $1)" $(gettext "created")
26 else
27 abort 2 $(gettext "Setup file not found")
28 fi
29 @@ -339,10 +340,10 @@
30 btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|jfs|ntfs|reiser4|reiserfs|ufs|xfs)
31 found=no
32 for xdir in /sbin /usr/sbin /usr/bin; do
33 - [ -x "$xdir/mkfs.$TGT_FS" ] && found=yes
34 + [ -x "$xdir/mkfs.$TGT_HOME_FS" ] && found=yes
35 done
36 if [ "$found" == "no" ]; then
37 - msg "$TGT_FS: mkfs.$TGT_FS $(gettext "is not installed")"; error=yes
38 + msg "$TGT_FS: mkfs.$TGT_HOME_FS $(gettext "is not installed")"; error=yes
39 fi ;;
40 *) msg "$TGT_HOME_FS: $(gettext "Unknown filesystem (/home)")"; error=yes ;;
41 esac
42 @@ -774,20 +775,39 @@
43 debug "Searching for Windows"
44 if [ "$TGT_WINBOOT" == "auto" ];then
45 WINBOOT=$(fdisk -l | awk '
46 -BEGIN{disk=-1, found=-1, winboot=""}
47 +BEGIN{
48 + disk=-1
49 + found=0
50 + winboot=""}
51 {
52 - # Counting disk
53 - if ($1=="Disk"){disk++, part=-1}
54 - # Counting partition
55 - if (substr($1,1,4)=="/dev"){part++}
56 - # Read partition Id
57 - if ($2=="*"){Id=$6} else {Id=$5}
58 - # Detect Windows type
59 - if (Id=="7" || Id=="b"){
60 - if (found){
61 - # record 1st Windows partition found
62 - winboot=sprintf("hd%d,%d",disk,part),found++}
63 + # Count disks
64 + if ($1=="Disk"){
65 + disk++
66 + part=-1
67 + dev=substr($2,6,3)
68 + # get removable status
69 + file="/sys/block/"dev"/removable"
70 + "cat " file | getline removable
71 + close("cat ")
72 +}
73 + # Count partitions
74 + if (substr($1,1,4)=="/dev"){
75 + # List fixed drives only
76 + if (removable==0){
77 + part++
78 + # Read partition Id
79 + if ($2=="*"){Id=$6} else {Id=""}
80 + # Detect Windows Partition Type: 7,b,c,e,f
81 + WPT="[7bcef]"
82 + if (Id ~ WPT){
83 + found++
84 + # record 1st Windows partition found
85 + if (found==1){
86 + winboot=sprintf("hd%d,%d",disk,part)
87 + }
88 + }
89 }
90 + }
91 }
92 END{printf "%s", winboot}')
93 if [ -z "$WINBOOT" ]; then
94 @@ -1201,6 +1221,7 @@
95 new)
96 gen_setup $2 ;;
97 showurl)
98 + LOG="/dev/null"
99 case $2 in
100 stable)
101 echo $URL_STABLE ;;
102 @@ -1208,6 +1229,8 @@
103 echo $URL_COOKING ;;
104 rolling)
105 echo $URL_ROLLING ;;
106 + *)
107 + abort 1 $(gettext "Unknown url shortcut")
108 esac ;;
109 check)
110 LOG="/dev/null"