tazinst diff installer.cgi @ rev 112

tazinst,installer.cgi: add rescue boot
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Feb 25 10:55:20 2021 +0000 (2021-02-25)
parents 6430a0969bfa
children 55a8e9fe5627
line diff
     1.1 --- a/installer.cgi	Sat Aug 15 10:58:20 2020 +0000
     1.2 +++ b/installer.cgi	Thu Feb 25 10:55:20 2021 +0000
     1.3 @@ -532,6 +532,52 @@
     1.4  }
     1.5  
     1.6  
     1.7 +select_liveboot()
     1.8 +{
     1.9 +	local liveboot="$(/usr/sbin/tazinst get liveboot "$INSTFILE")" error
    1.10 +
    1.11 +	cat <<EOT
    1.12 +	$(
    1.13 +	input "checkbox" \
    1.14 +		"liveboot" \
    1.15 +		"auto" \
    1.16 +		"$liveboot"
    1.17 +	label "liveboot" \
    1.18 +		"$(_ 'Enable the liveboot/rescue mode. (with default passwords!)')" \
    1.19 +		"$(_ "At start-up, you will be asked whether you want to boot \
    1.20 +into SliTaz GNU/Linux on disk or in RAM.")"
    1.21 +	error="$?"
    1.22 +	error_msg "$error" \
    1.23 +		"liveboot"
    1.24 +	)
    1.25 +	<br/>
    1.26 +EOT
    1.27 +}
    1.28 +
    1.29 +
    1.30 +select_webboot()
    1.31 +{
    1.32 +	local webboot="$(/usr/sbin/tazinst get webboot "$INSTFILE")" error
    1.33 +
    1.34 +	cat <<EOT
    1.35 +	$(
    1.36 +	input "checkbox" \
    1.37 +		"webboot" \
    1.38 +		"auto" \
    1.39 +		"$webboot"
    1.40 +	label "webboot" \
    1.41 +		"$(_ 'Enable the webboot mode. (with default passwords!)')" \
    1.42 +		"$(_ "At start-up, you will be asked whether you want to boot \
    1.43 +into SliTaz GNU/Linux on disk or boot in RAM from the Web.")"
    1.44 +	error="$?"
    1.45 +	error_msg "$error" \
    1.46 +		"webboot"
    1.47 +	)
    1.48 +	<br/>
    1.49 +EOT
    1.50 +}
    1.51 +
    1.52 +
    1.53  select_winboot()
    1.54  {
    1.55  	local winboot="$(/usr/sbin/tazinst get winboot "$INSTFILE")" error
    1.56 @@ -601,6 +647,8 @@
    1.57  
    1.58  	<div class="bootloader">$(
    1.59  	printf '%s' "$settings" | grep -q "bootloader" && select_bootloader
    1.60 +	printf '%s' "$settings" | grep -q "liveboot" && select_liveboot
    1.61 +	printf '%s' "$settings" | grep -q "webboot" && select_webboot
    1.62  	printf '%s' "$settings" | grep -q "winboot" && select_winboot
    1.63  	)</div>
    1.64  </fieldset>
    1.65 @@ -666,6 +714,12 @@
    1.66  	# user Pwd
    1.67  	/usr/sbin/tazinst set user_pwd "$(GET USER_PWD)" "$INSTFILE"
    1.68  
    1.69 +	# SliTaz Live Boot
    1.70 +	/usr/sbin/tazinst set liveboot "$(GET LIVEBOOT)" "$INSTFILE"
    1.71 +
    1.72 +	# SliTaz Web Boot
    1.73 +	/usr/sbin/tazinst set webboot "$(GET WEBBOOT)" "$INSTFILE"
    1.74 +
    1.75  	# win Dual-Boot
    1.76  	/usr/sbin/tazinst set winboot "$(GET WINBOOT)" "$INSTFILE"
    1.77  
    1.78 @@ -673,8 +727,9 @@
    1.79  	if [ "$(GET BOOTLOADER)" = "auto" ]; then
    1.80  		/usr/sbin/tazinst set bootloader "auto" "$INSTFILE"
    1.81  	else
    1.82 -		/usr/sbin/tazinst unset bootloader "$INSTFILE"
    1.83 -		/usr/sbin/tazinst unset winboot "$INSTFILE"
    1.84 +		for i in bootloader liveboot webboot winboot ; do
    1.85 +			/usr/sbin/tazinst unset $i "$INSTFILE"
    1.86 +		done
    1.87  	fi
    1.88  	input_hidden "CHECK" "yes"
    1.89  }
    1.90 @@ -690,7 +745,7 @@
    1.91  			print "<script type=\"text/javascript\">"
    1.92  			printf "document.write(\047<div id=\"progress\">"
    1.93  			printf "<img src=\"/styles/default/images/loader.gif\" />"
    1.94 -			printf $1 "&#37; " substr($0, length($1)+2, 40)
    1.95 +			printf $1 "&#37; " substr($0, length($1)+2)
    1.96  			print "</div>\047)"
    1.97  			print "</script>"
    1.98  			}