tazinst diff slitaz-installer @ rev 13

Make .cgi compliant with the latest Tazpanel.
author Dominique Corbex <domcox@slitaz.org>
date Sat Aug 17 21:49:10 2013 +0200 (2013-08-17)
parents
children 5996df6fd4a7
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/slitaz-installer	Sat Aug 17 21:49:10 2013 +0200
     1.3 @@ -0,0 +1,598 @@
     1.4 +#!/bin/sh
     1.5 +#"
     1.6 +# slitaz-installer - A CLI frontend to tazinst, the
     1.7 +# SliTaz GNU/Linux installer
     1.8 +#
     1.9 +# (C) 2007-2013 SliTaz - GNU General Public License v3.
    1.10 +#
    1.11 +# Authors : Christophe Lincoln <pankso@slitaz.org>
    1.12 +#           Dominique Corbex <domcox@slitaz.org>
    1.13 +#
    1.14 +
    1.15 +TAZINST_REQUIRED_VERSION="2.98"
    1.16 +BACKLIST="SliTaz GNU/Linux installer"
    1.17 +DIALOG=dialog
    1.18 +VERSION="3.90"
    1.19 +
    1.20 +#--------------
    1.21 +# msgs section
    1.22 +#--------------
    1.23 +
    1.24 +# info msgs
    1.25 +
    1.26 +MODE_MSG="\n$(gettext "Welcome to the slitaz-installer").\n
    1.27 +\Z2$(gettext "Which type of installation do you want to start?")\Zn\n"
    1.28 +
    1.29 +MEDIA_MSG="\n$(gettext "SliTaz can be installed from different media.")\n\n\
    1.30 +\Z2$(gettext "Select a media from the following list:")\Zn\n"
    1.31 +
    1.32 +SOURCE_USB_MSG="\n$(gettext "You have selected the option to install SliTaz \
    1.33 +from an USB Key")\n\n\
    1.34 +\Z2$(gettext "Enter the partition where SliTaz Live is located:"):\Zn\n"
    1.35 +
    1.36 +SOURCE_ISO_MSG="\n$(gettext "You have selected the option to install SliTaz \
    1.37 +from an ISO file located on a local disk.")\n\n\
    1.38 +\Z2$(gettext "Please, select a file below:")\Zn\n"
    1.39 +
    1.40 +SOURCE_WEB_MSG="\n$(gettext "You have selected the option to install SliTaz \
    1.41 +from the web")\n\n\\Z2$(gettext "Please, select a version:")\Zn\n"
    1.42 +
    1.43 +SOURCE_DEF_MSG="\n$(gettext "Select the source"):\n"
    1.44 +
    1.45 +ROOT_UUID_DEFAULT_MSG="$(gettext "\nDrive selection")\n\n\Z2$(gettext "Please specify the partition where to install SliTaz:")\Zn\n"
    1.46 +
    1.47 +ROOT_UUID_UPGRADE_MSG="$(gettext "The installer will upgrade the existing \
    1.48 +SliTaz system by saving all configuration files and the list of installed \
    1.49 +packages. Then, it will clean the partition and install the new version \
    1.50 +of SliTaz, restore the configuration files and reinstall any packages which \
    1.51 +are not present on the cdrom.
    1.52 +You will need an active internet connection before upgrading.")\n \
    1.53 +\Z2$(gettext "Partition containing the system to upgrade:")\Zn\n"
    1.54 +
    1.55 +ROOT_FORMAT_MSG="\n$(gettext "Only the filesystems actually installed on your \
    1.56 +system are listed. If you intend to use another filesystem, you have to \
    1.57 +install it before. \
    1.58 +Unless you know what you are doing, it's safe to use ext2, ext3 or ext4.\n\n\
    1.59 +\Z2To format this partition, please select a filesystem below:")\Zn\n"
    1.60 +
    1.61 +HOME_UUID_MSG="\n$(gettext "Separate /home partition")\n\n\
    1.62 +\Z2$(gettext "Please, select the partition to use:")\Zn\n"
    1.63 +
    1.64 +HOSTNAME_MSG="\n$(gettext "Hostname configuration allows you to specify the \
    1.65 +machine name. The hostname is used internally to identify the host on the \
    1.66 +network. This value can be changed after the system is installed.\n\n\
    1.67 +\Z2Enter a hostname:\Zn\n")"
    1.68 +
    1.69 +ROOT_PWD_MSG="\n$(gettext "The root administrator privilege lets you manage \
    1.70 +and configure the full system. A root user can damage your system so you \
    1.71 +should always setup a strong password with special characters and/or numbers.\
    1.72 +")\n\n\
    1.73 +\Z2$(gettext "Enter the password for root:")\Zn\n"
    1.74 +
    1.75 +USER_LOGIN_MSG="\n$(gettext "The default user for the system will have their \
    1.76 +personal files stored in /home/*user* (and will be automatically added to the \
    1.77 +audio group)")\n\n\Z2$(gettext "Enter the name of the first user:")\Zn\n"
    1.78 +
    1.79 +USER_PWD_MSG="\n$(gettext "The password for default user").
    1.80 +$(gettext "It may be a security risk if too weak and should always be strong \
    1.81 +if you use a SSH connection through the web.")\n
    1.82 +\Z2$(gettext "Enter the password for the default user:")\Zn\n"
    1.83 +
    1.84 +END_OF_INSTALL_MSG="\n$(gettext "Installation is now finished, you can exit \
    1.85 +the installer or reboot on your new SliTaz GNU/Linux operating system")."
    1.86 +
    1.87 +
    1.88 +# questions msgs
    1.89 +
    1.90 +ASK_ROOT_FORMAT="\n$(gettext "The next step lets you format the target \
    1.91 +partition. Choose between robust, stable and/or journaled filesystem. If the \
    1.92 +partition is already formated you can skip this stage, if not just accept.\n
    1.93 +Warning! formating a partition will destroy all current data.\n
    1.94 +\Z2Do you wish to format the partition ?\Zn")"
    1.95 +
    1.96 +ASK_HOME_UUID="\n$(gettext "On most GNU/Linux systems users personal \
    1.97 +files are stored in the directory /home. Home can be on a separate partition \
    1.98 +or another hard disk.\n
    1.99 +\Z2DO you want to use a separate Home partition ?\Zn")"
   1.100 +
   1.101 +ASK_HOME_FORMAT="\n$(gettext "/home will be installed on a separate partition. \
   1.102 +The next step lets you format the /home partition. If the partition \
   1.103 +is already formated you can skip this stage, if not just accept. Warning \
   1.104 +formating a partition will destroy all current data.\n
   1.105 +\Z2Do you wish to format the /home partition ?\Zn")"
   1.106 +
   1.107 +ASK_BOOTLOADER="\n$(gettext "You have now the option to install a \
   1.108 +bootloader which is capable of booting almost any kind of operating system.\n\n\
   1.109 +If you want to use an existing bootloader installation, skip this step \
   1.110 +and configure your bootloader to boot SliTaz (refer to your bootloader's \
   1.111 +documentation on how to do this)").\n\n\
   1.112 +\Z2$(gettext "Install a bootloader?")\Zn\n"
   1.113 +
   1.114 +ASK_WINBOOT="\n$(gettext "Do you want to implement a dual-boot with \
   1.115 +Windows? At start-up, you will be asked whether you want to boot into \
   1.116 +Windows or SliTaz GNU/Linux.\n
   1.117 +\Z2Install a dual-boot with Windows ?")\n"
   1.118 +
   1.119 +ASK_SUMMARY="$(gettext "Installation settings summary and last chance to \
   1.120 +cancel or restart all installation steps.")\n
   1.121 +\Z2Go and install SliTaz?\Zn\n\n"
   1.122 +
   1.123 +EMPTY_MENU_MSG="\n$(gettext "Sorry, no device, nor file found or available.")"
   1.124 +
   1.125 +#---------------"
   1.126 +# check section
   1.127 +#---------------
   1.128 +
   1.129 +check_tazinst()
   1.130 +{
   1.131 +	local version
   1.132 +	# search for tazinst
   1.133 +	if ! [ -x /usr/sbin/tazinst ] ; then
   1.134 +		printf "$(gettext "Error 2: ")
   1.135 +$(gettext "The lightweight SliTaz HDD installer 'tazinst' is missing.
   1.136 +Check permissions, or reinstall the slitaz-tools package.")\n"
   1.137 +		exit 2
   1.138 +	fi
   1.139 +	# check version
   1.140 +	version=$(tazinst version | tr -d '[:alpha:]')
   1.141 +	if ! (echo "$version" | awk -v req="$TAZINST_REQUIRED_VERSION" '
   1.142 +		{ver=$0+0}{ if (ver < req) exit 1}') ; then
   1.143 +		printf "$(gettext "Error 2: ")
   1.144 +$(gettext "The lightweight SliTaz HDD installer tazinst ($version) is not
   1.145 +at the required version ($TAZINST_REQUIRED_VERSION), use tazinst in a xterm or
   1.146 +reinstall the slitaz-tools package.")\n"
   1.147 +		exit 2
   1.148 +	fi
   1.149 +}
   1.150 +
   1.151 +#----------------
   1.152 +# dialog section
   1.153 +#----------------
   1.154 +
   1.155 +# select msgs to display
   1.156 +msg()
   1.157 +{
   1.158 +	local option="$1"
   1.159 +	case "$option" in
   1.160 +	mode)
   1.161 +		printf "$MODE_MSG" ;;
   1.162 +	media)
   1.163 +		printf "$MEDIA_MSG"	;;
   1.164 +	source)
   1.165 +		local media="$(tazinst get media)"
   1.166 +		case "$media" in
   1.167 +			usb)
   1.168 +				printf "$SOURCE_USB_MSG" ;;
   1.169 +			iso)
   1.170 +				printf "$SOURCE_ISO_MSG" ;;
   1.171 +			web)
   1.172 +				printf "$SOURCE_WEB_MSG" ;;
   1.173 +			*)
   1.174 +				printf "$SOURCE_DEF_MSG" ;;
   1.175 +		esac ;;
   1.176 +	root_uuid)
   1.177 +		local mode="$(tazinst get mode)"
   1.178 +		[ "$mode" = "upgrade" ] && printf "$ROOT_UUID_UPGRADE_MSG" \
   1.179 +								|| printf "$ROOT_UUID_DEFAULT_MSG" ;;
   1.180 +	root_format|home_format)
   1.181 +		printf "$ROOT_FORMAT_MSG" ;;
   1.182 +	home_uuid)
   1.183 +		printf "$HOME_UUID_MSG" ;;
   1.184 +	hostname)
   1.185 +		printf "$HOSTNAME_MSG" ;;
   1.186 +	root_pwd)
   1.187 +		printf "$ROOT_PWD_MSG" ;;
   1.188 +	user_login)
   1.189 +		printf "$USER_LOGIN_MSG" ;;
   1.190 +	user_pwd)
   1.191 +		printf "$USER_PWD_MSG" ;;
   1.192 +	esac
   1.193 +}
   1.194 +
   1.195 +# select questions to ask
   1.196 +ask()
   1.197 +{
   1.198 +	local option="$1"
   1.199 +	case "$option" in
   1.200 +		root_format)
   1.201 +			printf "$ASK_ROOT_FORMAT" ;;
   1.202 +		home_uuid)
   1.203 +			printf "$ASK_HOME_UUID" ;;
   1.204 +		home_format)
   1.205 +			printf "$ASK_HOME_FORMAT" ;;
   1.206 +		bootloader)
   1.207 +			printf "$ASK_BOOTLOADER" ;;
   1.208 +		winboot)
   1.209 +			printf "$ASK_WINBOOT" ;;
   1.210 +		summary)
   1.211 +			printf "$ASK_SUMMARY"
   1.212 +
   1.213 +	esac
   1.214 +}
   1.215 +
   1.216 +# make text dialog compatible
   1.217 +text2dlg()
   1.218 +{
   1.219 +	printf "$@" | awk '
   1.220 +	{
   1.221 +		num=split($0,list)
   1.222 +		printf "%s ",$1
   1.223 +		for (x=2; x<=num; x++){
   1.224 +			if (x!=num)
   1.225 +				printf "%s ", list[x]
   1.226 +			else
   1.227 +				printf "%s\n", list[x]
   1.228 +		}
   1.229 +	}'
   1.230 +}
   1.231 +
   1.232 +# menu items msgs
   1.233 +list_items()
   1.234 +{
   1.235 +	local data ref
   1.236 +	case "$1" in
   1.237 +	mode)
   1.238 +		text2dlg "$(tazinst help mode)" ;;
   1.239 +	media)
   1.240 +		text2dlg "$(tazinst help media)" ;;
   1.241 +	usb)
   1.242 +		tazinst list usb ;;
   1.243 +	iso)
   1.244 +		tazinst list iso | awk '{print $0, " "}' ;;
   1.245 +	web)
   1.246 +		text2dlg "$(tazinst help web)" ;;
   1.247 +	root_uuid)
   1.248 +		tazinst list uuid ;;
   1.249 +	root_format)
   1.250 +		for i in $(tazinst list format); do
   1.251 +			text2dlg "$(tazinst help root_format | grep $i)"
   1.252 +		done ;;
   1.253 +	home_uuid)
   1.254 +		tazinst list uuid ;;
   1.255 +	home_format)
   1.256 +		for i in $(tazinst list format); do
   1.257 +			text2dlg "$(tazinst help home_format | grep $i)"
   1.258 +		done ;;
   1.259 +	bootloader)
   1.260 +		text2dlg "$(tazinst help bootloader)" ;;
   1.261 +	esac
   1.262 +}
   1.263 +
   1.264 +summary_list()
   1.265 +{
   1.266 +	local option
   1.267 +	for option in $SEQUENCE; do
   1.268 +		case "$option" in
   1.269 +		mode)
   1.270 +			local mode="$(tazinst get mode)"
   1.271 +			printf "\n\n$(gettext "Mode"): "
   1.272 +			printf "$(tazinst help mode | grep "$mode")" ;;
   1.273 +		media)
   1.274 +			printf "\n$(gettext "From media"): $(tazinst get media)" ;;
   1.275 +		source)
   1.276 +			local source="$(tazinst get source)"
   1.277 +			[ -n "$source" ] && printf " ($source)" ;;
   1.278 +		root_uuid)
   1.279 +			printf "\n$(gettext "To the disk"): $(tazinst get root_uuid)" ;;
   1.280 +		root_format)
   1.281 +			local root_format="$(tazinst get root_format)"
   1.282 +			[ -n "$root_format" ] \
   1.283 +				&& printf " $(gettext "(Formatting as"): $root_format)" \
   1.284 +				|| printf " $(gettext "(No formatting)")" ;;
   1.285 +		home_uuid)
   1.286 +			local home_uuid="$(tazinst get home_uuid)"
   1.287 +			[ -n "$home_uuid" ] \
   1.288 +				&& printf "\n$(gettext "Separate /home is"): $home_uuid" \
   1.289 +				|| printf "\n$(gettext "No separate /home partition")" ;;
   1.290 +		home_format)
   1.291 +			local home_format="$(tazinst get home_format)"
   1.292 +			[ -n "$home_uuid" ] && ([ -n "$home_format" ] \
   1.293 +				&& printf " $(gettext "(Formatting as"): $home_format)" \
   1.294 +				|| printf " $(gettext "(No /home formatting)")";) ;;
   1.295 +		hostname)
   1.296 +			printf "\nHostname: $(tazinst get hostname)" ;;
   1.297 +		user_login)
   1.298 +			printf "\n$(gettext "User login"): $(tazinst get user_login)" ;;
   1.299 +		bootloader)
   1.300 +			local bootloader="$(tazinst get bootloader)"
   1.301 +			[ -n "$bootloader" ] \
   1.302 +				&& printf "\n$(gettext "Bootloader: installed")" \
   1.303 +				|| printf "\n$(gettext "No bootloader installed")" ;;
   1.304 +		winboot)
   1.305 +			local winboot="$(tazinst get winboot)"
   1.306 +			[ -n "$winboot" ] \
   1.307 +				&& printf "$(gettext ", with Windows dual-boot")" \
   1.308 +				|| printf "$(gettext ", no dual-boot")" ;;
   1.309 +		esac
   1.310 +	done
   1.311 +}
   1.312 +
   1.313 +dialog_menu()
   1.314 +{
   1.315 +	local option="$1" items="$2" sighup=1 sigint=2 sigquit=3
   1.316 +	if [ -z "$items" ]; then
   1.317 +		"$DIALOG" \
   1.318 +			--title " Select $option " --clear \
   1.319 +        	--msgbox "$EMPTY_MENU_MSG" 10 41
   1.320 +	fi
   1.321 +	tempfile="$(mktemp)"
   1.322 +	trap "rm -f $tempfile ; exit 1" $sighup $sigint $sigquit
   1.323 +	"$DIALOG" \
   1.324 +		--clear --colors \
   1.325 +		--title " Select $option " \
   1.326 +		--backtitle "$BACKLIST" \
   1.327 +		--default-item "$(tazinst get "$option")" \
   1.328 +		--ok-label "$(gettext "Ok")" \
   1.329 +		--cancel-label "$(gettext "Cancel")" \
   1.330 +		--menu "$(msg $option)" 18 70 6 $items 2> "$tempfile"
   1.331 +	retval="$?"
   1.332 +	choice=$(cat "$tempfile")
   1.333 +	rm -f "$tempfile"
   1.334 +	case "$retval" in
   1.335 +		 0)
   1.336 +			# a '$choice' was selected
   1.337 +			tazinst set "$option" "$choice" && move up || \
   1.338 +			"$DIALOG" \
   1.339 +				--title " Select $option " --clear \
   1.340 +    	    	--msgbox "\n$(tazinst check "$option" 2>&1)" 10 41 ;;
   1.341 +		 1|255)
   1.342 +			# voluntary exit or ESC pressed
   1.343 +			move back ;;
   1.344 +	esac
   1.345 +	return "$retval"
   1.346 +}
   1.347 +
   1.348 +dialog_yesno()
   1.349 +{
   1.350 +	local option="$1"
   1.351 +	"$DIALOG" \
   1.352 +		--clear --colors \
   1.353 +		--title " Select $option " \
   1.354 +		--backtitle "$BACKLIST" \
   1.355 +		--ok-label "$(gettext "Yes")" \
   1.356 +		--cancel-label "$(gettext "Cancel")" \
   1.357 +		--extra-button --extra-label "$(gettext "No")" \
   1.358 +		--yesno "$(ask $option)" 18 70
   1.359 +	retval="$?"
   1.360 +	case "$retval" in
   1.361 +		# 0: yes
   1.362 +		1)	# cancel
   1.363 +			move back ;;
   1.364 +		3)	# no
   1.365 +			tazinst unset "$option"
   1.366 +			move up ;;
   1.367 +		255)# ESC pressed
   1.368 +			move back ;;
   1.369 +	esac
   1.370 +	return "$retval"
   1.371 +}
   1.372 +
   1.373 +dialog_input()
   1.374 +{
   1.375 +	local option="$1" sighup=1 sigint=2 sigquit=3
   1.376 +	local value="$(tazinst get "$option")"
   1.377 +	tempfile="$(mktemp)"
   1.378 +	trap "rm -f $tempfile; exit 1" $sighup $sigint $sigquit
   1.379 +	$DIALOG \
   1.380 +		--clear --colors \
   1.381 +		--title " Select $option " \
   1.382 +		--ok-label "$(gettext "Ok")" \
   1.383 +		--cancel-label "$(gettext "Cancel")" \
   1.384 +        --inputbox "$(msg $option)" 16 51 "$value"  2> "$tempfile"
   1.385 +	retval="$?"
   1.386 +	choice="$(cat $tempfile)"
   1.387 +	rm -f "$tempfile"
   1.388 +	case "$retval" in
   1.389 +		0)	# new value
   1.390 +			tazinst set "$option" "$choice"
   1.391 +			retcode=$?
   1.392 +			[ "$retcode" -gt "0" ] && \
   1.393 +				"$DIALOG" \
   1.394 +					--title " Select $option " --clear \
   1.395 +    		    	--msgbox "\n$(tazinst check "$option" 2>&1)" 10 41
   1.396 +			# continue if no error (0) or only warning (>127)
   1.397 +			[ "$retcode" -le "0" ] && move up
   1.398 +			[ "$retcode" -gt "127" ] && move up ;;
   1.399 +		1)	# cancel pressed."
   1.400 +			move back ;;
   1.401 +		255)# ESC pressed
   1.402 +			move back ;;
   1.403 +	esac
   1.404 +	return "$retval"
   1.405 +}
   1.406 +
   1.407 +# tiny summary and last chance to cancel or restart
   1.408 +summary()
   1.409 +{
   1.410 +	"$DIALOG" \
   1.411 +		--clear --colors \
   1.412 +		--title " Summary " \
   1.413 +		--backtitle "$BACKLIST" \
   1.414 +		--yes-label "$(gettext "Yes")" \
   1.415 +		--no-label "$(gettext "No")" \
   1.416 +		--yesno "$(ask summary)$(summary_list)" 18 70
   1.417 +	retval="$?"
   1.418 +	case "$retval" in
   1.419 +		0)	# yes
   1.420 +			move up ;;
   1.421 +		1)	# Cancel
   1.422 +			move back ;;
   1.423 +		3)	# no
   1.424 +			return 3 ;;
   1.425 +		255)# ESC pressed
   1.426 +			move back ;;
   1.427 +	esac
   1.428 +}
   1.429 +
   1.430 +#--------------------
   1.431 +# sequencing section
   1.432 +#--------------------
   1.433 +
   1.434 +# get list of settings
   1.435 +sequence()
   1.436 +{
   1.437 +	SEQUENCE="$(tazinst get settings) summary"
   1.438 +	MAX="$(echo "$SEQUENCE" | wc -w)"
   1.439 +}
   1.440 +
   1.441 +# get the setting name corresponding to an index in the list of settings
   1.442 +key()
   1.443 +{
   1.444 +	local index="$1" num=1 string
   1.445 +	for string in $SEQUENCE; do
   1.446 +		[ "$num" = "$index" ] && printf "$string"
   1.447 +		num=$(($num + 1))
   1.448 +	done
   1.449 +}
   1.450 +
   1.451 +# move index in list of settings
   1.452 +move()
   1.453 +{
   1.454 +	local way="$1"
   1.455 +	case "$way" in
   1.456 +		init)
   1.457 +			INDEX=1
   1.458 +			WAY="up" ;;
   1.459 +		up)
   1.460 +			INDEX=$(($INDEX+1))
   1.461 +			WAY="up" ;;
   1.462 +		back)
   1.463 +			INDEX=$(($INDEX-1))
   1.464 +			WAY="down" ;;
   1.465 +		away)
   1.466 +			# continue to move in the same way (move up or move back)
   1.467 +			[ "$WAY" = "up" ] && INDEX=$(($INDEX+1)) || INDEX=$(($INDEX-1)) ;;
   1.468 +	esac
   1.469 +}
   1.470 +
   1.471 +source_menu()
   1.472 +{
   1.473 +	media="$(tazinst get media)"
   1.474 +	case "$media" in
   1.475 +		cdrom)
   1.476 +			tazinst unset source || exit 2
   1.477 +			move away ;;
   1.478 +		usb)
   1.479 +			dialog_menu source "$(list_items usb)" ;;
   1.480 +		iso)
   1.481 +			dialog_menu source "$(list_items iso)" ;;
   1.482 +		web)
   1.483 +			dialog_menu source "$(list_items web)" ;;
   1.484 +		*)
   1.485 +			move away ;;
   1.486 +	esac
   1.487 +}
   1.488 +
   1.489 +#--------------
   1.490 +# main section
   1.491 +#--------------
   1.492 +
   1.493 +check_tazinst && tazinst new
   1.494 +tazinst get mode || exit 1
   1.495 +sequence
   1.496 +move init
   1.497 +
   1.498 +while [ "$INDEX" -le "$MAX" ]
   1.499 +do
   1.500 +	OPTION="$(key $INDEX)"
   1.501 +	case "$OPTION" in
   1.502 +		"")
   1.503 +			exit 0 ;;
   1.504 +		mode)
   1.505 +			dialog_menu mode "$(list_items mode)" && sequence ;;
   1.506 +		media)
   1.507 +			dialog_menu media "$(list_items media)" ;;
   1.508 +		source)
   1.509 +			source_menu ;;
   1.510 +		root_uuid)
   1.511 +			dialog_menu root_uuid "$(list_items root_uuid)" ;;
   1.512 +		root_format)
   1.513 +			dialog_yesno root_format && \
   1.514 +				dialog_menu root_format "$(list_items root_format)" ;;
   1.515 +		home_uuid)
   1.516 +			dialog_yesno home_uuid && \
   1.517 +				dialog_menu home_uuid "$(list_items home_uuid)" ;;
   1.518 +		home_format)
   1.519 +			if [ -n "$(tazinst get home_uuid)" ]; then
   1.520 +				dialog_yesno home_format && \
   1.521 +					dialog_menu home_format "$(list_items home_format)"
   1.522 +			else
   1.523 +				tazinst unset home_format
   1.524 +				move away
   1.525 +			fi ;;
   1.526 +		hostname)
   1.527 +			dialog_input hostname ;;
   1.528 +		root_pwd)
   1.529 +			dialog_input root_pwd ;;
   1.530 +		user_login)
   1.531 +			dialog_input user_login ;;
   1.532 +		user_pwd)
   1.533 +			dialog_input user_pwd ;;
   1.534 +		bootloader)
   1.535 +			dialog_yesno bootloader && \
   1.536 +				{ tazinst set bootloader "auto" && move up; } || \
   1.537 +				{ tazinst unset bootloader ;
   1.538 +				tazinst unset winboot ; } ;;
   1.539 +		winboot)
   1.540 +			if [ -n "$(tazinst get bootloader)" ]; then
   1.541 +				dialog_yesno winboot && \
   1.542 +				{ tazinst set winboot "auto" && move up; } || \
   1.543 +				tazinst unset winboot
   1.544 +			else
   1.545 +				move away
   1.546 +			fi ;;
   1.547 +		summary)
   1.548 +			summary ;;
   1.549 +		*)
   1.550 +			exit 1 ;;
   1.551 +	esac
   1.552 +done
   1.553 +
   1.554 +# execute process
   1.555 +tazinst execute | awk 'BEGIN{
   1.556 +		printf "XXX\n0\n"
   1.557 +	}
   1.558 +	{
   1.559 +		num=$1+0
   1.560 +		if (num>=1){
   1.561 +			printf "XXX\nXXX\n%s\n", num
   1.562 +			printf "\n%s\n",substr($0,length($1)+2)
   1.563 +		}
   1.564 +		else
   1.565 +			printf "%s\n",$0
   1.566 +	}
   1.567 +	END{
   1.568 +		print "XXX"
   1.569 +	}' | $DIALOG --title "Slitaz-Installer" --gauge "Installing.." 20 70 0
   1.570 +
   1.571 +
   1.572 +# end_of_install
   1.573 +if tazinst log | grep -q "x-x-" ; then
   1.574 +	tazinst clean
   1.575 +	$DIALOG --title " Installation complete " \
   1.576 +		--backtitle "$BACKLIST" \
   1.577 +		--yes-label "Exit" \
   1.578 +		--no-label "Reboot" \
   1.579 +		--clear --colors --yesno "$END_OF_INSTALL_MSG" 18 70
   1.580 +	retval=$?
   1.581 +	case $retval in
   1.582 +		0)
   1.583 +			exit 0 ;;
   1.584 +		1)
   1.585 +			reboot || reboot -f ;;
   1.586 +		255)
   1.587 +			echo -e "ESC pressed.\n" && exit 0 ;;
   1.588 +	esac
   1.589 +else
   1.590 +	$DIALOG --title " Process not completed " \
   1.591 +		--backtitle "$BACKLIST" \
   1.592 +		--clear --msgbox \
   1.593 +		"$(tazinst log | awk '$1 == "-x-x-",$1 == "x-x-x"')" 18 70
   1.594 +	retval=$?
   1.595 +	case $retval in
   1.596 +		0)
   1.597 +			exit 0 ;;
   1.598 +		255)
   1.599 +			echo -e "ESC pressed.\n" && exit 0 ;;
   1.600 +	esac
   1.601 +fi