tazinst annotate installer.cgi @ rev 2

Use UUIDs, boot delay on mobile disks, GPT support, boot flag, new slitaz-installer and web frontends
author Dominique Corbex <domcox@slitaz.org>
date Thu Feb 14 13:12:12 2013 +0100 (2013-02-14)
parents ced519734730
children e62babb3966d
rev   line source
domcox@0 1 #!/bin/sh
domcox@0 2 #
domcox@0 3 # Main CGI interface for Tazinst, the SliTaz installer.
domcox@0 4 #
domcox@2 5 # Copyright (C) 2012-2013 SliTaz GNU/Linux - BSD License
domcox@0 6 #
domcox@0 7 # Authors : Dominique Corbex <domcox@slitaz.org>
domcox@0 8 #
domcox@0 9
domcox@0 10
domcox@2 11 # restricted path
domcox@2 12 PATH="/usr/sbin:/usr/bin:/sbin:/bin"
domcox@0 13
domcox@2 14 VERSION=3.90
domcox@2 15
domcox@2 16 # panel location and theme
domcox@2 17 PANEL="/var/www/tazpanel"
domcox@2 18 STYLE="default"
domcox@2 19
domcox@2 20 # absolute paths to images
domcox@2 21 IMAGES="/styles/$STYLE/images"
domcox@2 22
domcox@2 23 # tazpanel config
domcox@2 24 [ -r /etc/slitaz/tazpanel.conf ] && . /etc/slitaz/tazpanel.conf
domcox@2 25
domcox@2 26 # include gettext helper script.
domcox@0 27 . /usr/bin/gettext.sh
domcox@0 28
domcox@2 29 # get parameters with GET, POST and FILE functions
domcox@2 30 . /usr/bin/httpd_helper.sh
domcox@0 31
domcox@2 32 # export package name for gettext.
domcox@2 33 TEXTDOMAIN='installer'
domcox@2 34 export TEXTDOMAIN
domcox@0 35
domcox@2 36 # tazinst required version
domcox@2 37 TAZINST_MINIMUM_VERSION="3.8"
domcox@2 38 TAZINST_MAXIMUM_VERSION="4.99"
domcox@0 39
domcox@2 40 # tazinst setup file
domcox@2 41 INSTFILE=/root/tazinst.conf
domcox@0 42
domcox@0 43
domcox@2 44 #-----------
domcox@2 45 # home page
domcox@2 46 #-----------
domcox@0 47
domcox@0 48 select_action()
domcox@0 49 {
domcox@2 50 comment "welcome message"
domcox@2 51 open_div_id "wrapper"
domcox@2 52 h4 "$(gettext 'Welcome to the Slitaz Installer!')"
domcox@2 53 p "$(gettext 'The SliTaz Installer installs or upgrades SliTaz to a
domcox@2 54 hard disk drive from a device like a Live-CD or LiveUSB key, from a SliTaz
domcox@2 55 ISO file, or from the web by downloading an ISO file.')"
domcox@2 56 h5 "$(gettext "Which type of installation do you want to start?")"
domcox@2 57 close_div
domcox@0 58 }
domcox@0 59
domcox@0 60 select_install()
domcox@0 61 {
domcox@2 62 comment "install message"
domcox@2 63 open_div_class "box"
domcox@2 64 h4 "$(gettext 'Install')"
domcox@2 65 p "$(gettext 'Install SliTaz on a partition of your hard disk drive. If you
domcox@2 66 decide to format your partition, all data will be lost. If you do not
domcox@2 67 format, all data except for any existing /home directory will be removed,
domcox@2 68 the home directory will be kept as is.')"
domcox@2 69 p "$(gettext 'Before installation, you may need to create or resize
domcox@2 70 partitions on your hard disk drive in order to make space for SliTaz
domcox@2 71 GNU/Linux. You can graphically manage your partitions with Gparted')"
domcox@2 72 close_div
domcox@2 73 button "install" "$(gettext "Install SliTaz")" \
domcox@2 74 "$(gettext "Proceed to a new SliTaz installation")"
domcox@0 75 }
domcox@0 76
domcox@0 77 select_upgrade()
domcox@0 78 {
domcox@2 79 comment "upgrade message"
domcox@2 80 open_div_class "box"
domcox@2 81 h4 "$(gettext 'Upgrade')"
domcox@2 82 p "$(gettext 'Upgrade an already installed SliTaz system on your hard disk
domcox@2 83 drive. Your /home /etc /var/www directories will be kept, all other
domcox@2 84 directories will be removed. Any additional packages added to your old
domcox@2 85 Slitaz system will be updated as long you have an active internet connection.')"
domcox@2 86 close_div
domcox@2 87 button "upgrade" "$(gettext 'Upgrade SliTaz')" \
domcox@2 88 "$(gettext "Upgrade an existing SliTaz system")"
domcox@2 89 }
domcox@0 90
domcox@2 91 #--------------------
domcox@2 92 # partitionning page
domcox@2 93 #--------------------
domcox@0 94
domcox@2 95 exec_gparted()
domcox@2 96 {
domcox@2 97 /bin/su - -c "exec env DISPLAY=':0.0' XAUTHORITY='/var/run/slim.auth' \
domcox@2 98 /usr/sbin/gparted"
domcox@0 99 }
domcox@0 100
domcox@0 101 select_gparted()
domcox@0 102 {
domcox@2 103 comment "gparted message"
domcox@2 104 h5 "$(gettext 'Partitioning')"
domcox@2 105 open_div_class "box"
domcox@2 106 p "$(gettext "On most used systems, the hard drive is already dedicated to
domcox@2 107 partitions for Windows<sup>&trade;</sup>, or Linux, or another operating
domcox@2 108 system. You'll need to resize these partitions in order to make space for
domcox@2 109 SliTaz GNU/Linux. SliTaz will co-exist with other operating systems already
domcox@2 110 installed on your hard drive.")"
domcox@2 111 p "$(gettext "The amount of space needed depends on how much software you
domcox@2 112 plan to install and how much space you require for users. It's conceivable
domcox@2 113 that you could run a minimal SliTaz system in 300 megs or less, but 2 gigs
domcox@2 114 is indeed more comfy.")"
domcox@2 115 p "$(gettext 'A separate home partition, and a partition that will be used
domcox@2 116 as Linux swap space may be created if needed. Slitaz detects and uses swap
domcox@2 117 partitions automatically.')"
domcox@2 118 close_div
domcox@2 119 open_div_class "box"
domcox@2 120 p "$(gettext 'You can graphically manage your partitions with GParted.
domcox@2 121 GParted is a partition editor for graphically managing your disk partitions.
domcox@2 122 GParted allows you to create, destroy, resize and copy partitions without
domcox@2 123 data loss.')"
domcox@2 124 p "$(gettext 'GParted supports ext2, ext3, ext4, linux swap, ntfs and fat32
domcox@2 125 filesystems right out of the box. Support for xjs, jfs, hfs and other
domcox@2 126 filesystems is available as well but you first need to add drivers for these
domcox@2 127 filesystems by installing the related packages xfsprogs, jfsutils, linux-hfs
domcox@2 128 and so on.')"
domcox@2 129 close_div
domcox@2 130 comment "launch GParted"
domcox@2 131 button "gparted" "$(gettext 'Execute GParted')" \
domcox@2 132 "$(gettext "Launch GParted, the partition editor tool")"
domcox@2 133 h5 "$(gettext 'Continue installation')"
domcox@2 134 p "$(gettext "Once you've made room for SliTaz on your drive, you should be
domcox@2 135 able to continue installation.")"
domcox@0 136 }
domcox@0 137
domcox@2 138 #------------
domcox@2 139 # input page
domcox@2 140 #------------
domcox@2 141
domcox@2 142
domcox@2 143 select_source()
domcox@0 144 {
domcox@2 145 local media="$(/usr/sbin/tazinst get media "$INSTFILE")"
domcox@2 146 local source="$(/usr/sbin/tazinst get source "$INSTFILE")"
domcox@2 147 local list_media="$(/usr/sbin/tazinst list media)"
domcox@2 148
domcox@2 149 # default media
domcox@2 150 [ "$media" ] || media="$(tazinst list media | cut -d ' ' -f1)"
domcox@2 151 local error
domcox@2 152 comment "source selection"
domcox@2 153 # cdrom
domcox@2 154 if printf "$list_media" | grep -q "cdrom"; then
domcox@2 155 input_media "cdrom" "$media"
domcox@2 156 label_media "cdrom" "$(gettext 'LiveCD')" "$media" \
domcox@2 157 "$(gettext "Use the SliTaz LiveCD")"
domcox@2 158 br
domcox@2 159 fi
domcox@2 160 # usb
domcox@2 161 if printf "$list_media" | grep -q "usb"; then
domcox@2 162 input_media "usb" "$media"
domcox@2 163 label_media "usb" "$(gettext 'LiveUSB:')" "$media" \
domcox@2 164 "$(gettext "Enter the partition where SliTaz Live is located on your \
domcox@2 165 USB Key")"
domcox@2 166 error="$?"
domcox@2 167 select "$(/usr/sbin/tazinst list usb "$INSTFILE")" "$source" "SRC_USB"
domcox@2 168 error_msg "$error" "source" 2
domcox@2 169 br
domcox@2 170 fi
domcox@2 171 # iso
domcox@2 172 input_media "iso" "$media"
domcox@2 173 label_media "iso" "$(gettext 'ISO file:')" "$media" \
domcox@2 174 "$(gettext "Select a SliTaz ISO file located on a local disk")"
domcox@2 175 error="$?"
domcox@2 176 if [ "$media" == "iso" ]; then
domcox@2 177 input "text" "src_iso" "$source" "" \
domcox@2 178 "$(gettext 'Select an ISO or enter the full path to the ISO file')" \
domcox@2 179 "iso"
domcox@2 180 else
domcox@2 181 input "text" "src_iso" "" "none" \
domcox@2 182 "$(gettext 'Select an ISO or enter the full path to the ISO file')" \
domcox@2 183 "iso"
domcox@2 184 fi
domcox@2 185 datalist "$(/usr/sbin/tazinst list iso "$INSTFILE")" "src_iso"
domcox@2 186 error_msg "$error" "source"
domcox@2 187 br
domcox@2 188 # web
domcox@2 189 input_media "web" "$media"
domcox@2 190 label_media "web" "$(gettext 'Web:')" "$media" \
domcox@2 191 "$(gettext "Select a SliTaz version on the Web")"
domcox@2 192 error="$?"
domcox@2 193
domcox@2 194 if [ "$media" == "web" ]; then
domcox@2 195 input "text" "src_web" "$source" "" \
domcox@2 196 "$(gettext 'Select a version or enter the full url to an ISO file')" \
domcox@2 197 "web"
domcox@2 198 else
domcox@2 199 input "text" "src_web" "" "none" \
domcox@2 200 "$(gettext 'Select a version or enter the full url to an ISO file')" \
domcox@2 201 "web"
domcox@2 202 fi
domcox@2 203 datalist "$(/usr/sbin/tazinst help web "$INSTFILE")" "src_web"
domcox@2 204 error_msg "$error" "source"
domcox@2 205 }
domcox@2 206
domcox@2 207 select_root_uuid()
domcox@2 208 {
domcox@2 209 local root_uuid="$(/usr/sbin/tazinst get root_uuid "$INSTFILE")"
domcox@2 210 local mode="$(/usr/sbin/tazinst get mode "$INSTFILE")"
domcox@2 211 comment "root_uuid selection"
domcox@2 212 if [ "$mode" == "upgrade" ]; then
domcox@2 213 label "root_uuid" "$(gettext 'Existing SliTaz partition to upgrade:')" \
domcox@2 214 "$(gettext "Specify the partition containing the system to upgrade")"
domcox@2 215 error="$?"
domcox@2 216 else
domcox@2 217 label "root_uuid" "$(gettext 'Install Slitaz to partition:')" \
domcox@2 218 "$(gettext "Specify the partition where to install SliTaz")"
domcox@2 219 error="$?"
domcox@2 220 fi
domcox@2 221 select "$(/usr/sbin/tazinst list uuid "$INSTFILE")" "$root_uuid" \
domcox@2 222 "ROOT_UUID" 2
domcox@2 223 error_msg "$error" "root_uuid" 2
domcox@2 224 br
domcox@2 225 }
domcox@2 226
domcox@2 227 select_root_format()
domcox@2 228 {
domcox@2 229 local root_format="$(/usr/sbin/tazinst get root_format "$INSTFILE")"
domcox@2 230 comment "root_format selection"
domcox@2 231 format "$(/usr/sbin/tazinst list format "$INSTFILE")" "$root_format" \
domcox@2 232 "ROOT_FORMAT"
domcox@2 233 }
domcox@2 234
domcox@2 235 select_options()
domcox@2 236 {
domcox@2 237 printf "<h4 id=\"options\">$(gettext 'Options')</h4>"
domcox@2 238 }
domcox@2 239
domcox@2 240 select_home_uuid()
domcox@2 241 {
domcox@2 242 local home_uuid="$(/usr/sbin/tazinst get home_uuid "$INSTFILE")"
domcox@2 243 comment "home_uuid selection"
domcox@2 244 h5 "$(gettext 'home partition')"
domcox@2 245 label "home_uuid" "$(gettext 'Separate partition for /home:')" \
domcox@2 246 "$(gettext "Specify the partition containing /home")"
domcox@2 247 select "$(/usr/sbin/tazinst list uuid "$INSTFILE")" "$home_uuid" \
domcox@2 248 "HOME_UUID" 2
domcox@2 249 br
domcox@2 250 }
domcox@2 251
domcox@2 252 select_home_format()
domcox@2 253 {
domcox@2 254 local home_format="$(/usr/sbin/tazinst get home_format "$INSTFILE")"
domcox@2 255 comment "home_format selection"
domcox@2 256 format "$(/usr/sbin/tazinst list format "$INSTFILE")" "$home_format" \
domcox@2 257 "HOME_FORMAT"
domcox@2 258 }
domcox@2 259
domcox@2 260 select_hostname()
domcox@2 261 {
domcox@2 262 local hostname="$(/usr/sbin/tazinst get hostname "$INSTFILE")" error
domcox@2 263 comment "hostname selection"
domcox@2 264 h5 "$(gettext 'Hostname')"
domcox@2 265 label "hostname" "$(gettext 'Set Hostname to:')" \
domcox@2 266 "$(gettext "Hostname configuration allows you to specify the machine name")"
domcox@2 267 error=$?
domcox@2 268 input "text" "HOSTNAME" "$hostname" "" "$(gettext 'Name of your system')"
domcox@2 269 error_msg "$error" "hostname" 2
domcox@2 270 }
domcox@2 271
domcox@2 272 select_root_pwd()
domcox@2 273 {
domcox@2 274 local root_pwd="$(/usr/sbin/tazinst get root_pwd "$INSTFILE")" error
domcox@2 275 comment "root_pwd selection"
domcox@2 276 h5 "$(gettext 'Root superuser')"
domcox@2 277 label "root_pwd" "$(gettext 'Root passwd:')" \
domcox@2 278 "$(gettext "Enter the password for root")"
domcox@2 279 error="$?"
domcox@2 280 input "text" "ROOT_PWD" "$root_pwd" "" "$(gettext 'Password of root')"
domcox@2 281 error_msg "$error" "root_pwd"
domcox@2 282 }
domcox@2 283
domcox@2 284 select_user_login()
domcox@2 285 {
domcox@2 286 local user_login="$(/usr/sbin/tazinst get user_login "$INSTFILE")" error
domcox@2 287 comment "user_login selection"
domcox@2 288 h5 "$(gettext 'User')"
domcox@2 289 label "user_login" "$(gettext 'User login:')" \
domcox@2 290 "$(gettext "Enter the name of the first user")"
domcox@2 291 error="$?"
domcox@2 292 input "text" "USER_LOGIN" "$user_login" "" \
domcox@2 293 "$(gettext 'Name of the first user')"
domcox@2 294 error_msg "$error" "user_login" 2
domcox@2 295 br
domcox@2 296 }
domcox@2 297
domcox@2 298 select_user_pwd()
domcox@2 299 {
domcox@2 300 local user_pwd="$(/usr/sbin/tazinst get user_pwd "$INSTFILE")" error
domcox@2 301 label "user_pwd" "$(gettext 'User passwd:')" \
domcox@2 302 "$(gettext "The password for default user")"
domcox@2 303 error="$?"
domcox@2 304 input "text" "USER_PWD" "$user_pwd" "" \
domcox@2 305 "$(gettext 'Password of the first user')"
domcox@2 306 error_msg "$error" "user_pwd"
domcox@2 307 }
domcox@2 308
domcox@2 309 select_bootloader()
domcox@2 310 {
domcox@2 311 local bootloader="$(/usr/sbin/tazinst get bootloader "$INSTFILE")" error
domcox@2 312 comment "bootloader selection"
domcox@2 313 h5 "$(gettext 'Bootloader')"
domcox@2 314 input "checkbox" "bootloader" "auto" "$bootloader"
domcox@2 315 label "bootloader" "$(gettext "Install a bootloader.")" \
domcox@2 316 "$(gettext "Usually you should answer yes, unless you want to install a \
domcox@2 317 bootloader by hand yourself.")"
domcox@2 318 error="$?"
domcox@2 319 error_msg "$error" "bootloader"
domcox@2 320 br
domcox@2 321 }
domcox@2 322
domcox@2 323 select_winboot()
domcox@2 324 {
domcox@2 325 local winboot="$(/usr/sbin/tazinst get winboot "$INSTFILE")" error
domcox@2 326 comment "winboot selection"
domcox@2 327 input "checkbox" "winboot" "auto" "$winboot"
domcox@2 328 label "winboot" "$(gettext 'Enable Windows Dual-Boot.')" \
domcox@2 329 "$(gettext "At start-up, you will be asked whether you want to boot into \
domcox@2 330 Windows&trade; or SliTaz GNU/Linux.")"
domcox@2 331 error="$?"
domcox@2 332 error_msg "$error" "winboot"
domcox@2 333 }
domcox@2 334
domcox@2 335 errors_msg()
domcox@2 336 {
domcox@2 337 if [ "$CHECK" ]; then
domcox@2 338 echo "<span class=\"alert\">"
domcox@2 339 p "$(gettext "Errors found. Please check your settings.")"
domcox@2 340 echo "</span>"
domcox@2 341 fi
domcox@2 342 }
domcox@2 343
domcox@2 344 select_settings()
domcox@2 345 {
domcox@2 346 local settings="$(/usr/sbin/tazinst get settings "$INSTFILE")"
domcox@2 347 CHECK=$(GET CHECK)
domcox@2 348 errors_msg
domcox@2 349 h4 "$(gettext 'Select source media:')"
domcox@2 350 open_div_class "box"
domcox@2 351 open_div_class "media"
domcox@2 352 select_source
domcox@2 353 close_div
domcox@2 354 close_div
domcox@2 355 h4 "$(gettext 'Select destination')"
domcox@2 356 open_div_class "box"
domcox@2 357 select_root_uuid
domcox@2 358 printf "$settings" | grep -q "root_format" \
domcox@2 359 && select_root_format
domcox@2 360 close_div
domcox@2 361 select_options
domcox@2 362 open_div_class "options"
domcox@2 363 printf "$settings" | grep -q "home_uuid" && select_home_uuid
domcox@2 364 printf "$settings" | grep -q "home_format" \
domcox@2 365 && select_home_format
domcox@2 366 printf "$settings" | grep -q "hostname" && select_hostname
domcox@2 367 printf "$settings" | grep -q "root_pwd" && select_root_pwd
domcox@2 368 printf "$settings" | grep -q "user_login" && select_user_login
domcox@2 369 printf "$settings" | grep -q "user_pwd" && select_user_pwd
domcox@2 370 close_div
domcox@2 371 open_div_class "bootloader"
domcox@2 372 printf "$settings" | grep -q "bootloader" && select_bootloader
domcox@2 373 printf "$settings" | grep -q "winboot" && select_winboot
domcox@2 374 close_div
domcox@2 375 br
domcox@2 376 }
domcox@2 377
domcox@2 378 #--------------
domcox@2 379 # execute page
domcox@2 380 #--------------
domcox@2 381
domcox@2 382 save_settings()
domcox@2 383 {
domcox@2 384 h5 "$(gettext "Checking settings...")"
domcox@2 385 # install type
domcox@2 386 /usr/sbin/tazinst set media "$(GET MEDIA)" "$INSTFILE"
domcox@2 387 # source File
domcox@2 388 case "$(/usr/sbin/tazinst get media "$INSTFILE")" in
domcox@2 389 usb)
domcox@2 390 /usr/sbin/tazinst set source "$(GET SRC_USB)" "$INSTFILE" ;;
domcox@2 391 iso)
domcox@2 392 /usr/sbin/tazinst set source "$(GET SRC_ISO)" "$INSTFILE" ;;
domcox@2 393 web)
domcox@2 394 /usr/sbin/tazinst set source "$(GET SRC_WEB)" "$INSTFILE" ;;
domcox@2 395 esac
domcox@2 396 # set defined url
domcox@2 397 [ $(GET URL) ] && SRC_WEB=$(GET URL)
domcox@2 398 # root Partition
domcox@2 399 /usr/sbin/tazinst set root_uuid "$(GET ROOT_UUID)" "$INSTFILE"
domcox@2 400 # format root partition
domcox@2 401 [ "$(GET ROOT_FORMAT)" ] \
domcox@2 402 && /usr/sbin/tazinst set root_format "$(GET ROOT_FORMAT)" "$INSTFILE" \
domcox@2 403 || /usr/sbin/tazinst unset root_format "$INSTFILE"
domcox@2 404 # home Partition
domcox@2 405 if [ "$(GET HOME_UUID)" ] ; then
domcox@2 406 /usr/sbin/tazinst set home_uuid "$(GET HOME_UUID)" "$INSTFILE"
domcox@2 407 [ "$(GET HOME_FORMAT)" ] \
domcox@2 408 && /usr/sbin/tazinst set home_format "$(GET HOME_FORMAT)" \
domcox@2 409 "$INSTFILE" \
domcox@2 410 || /usr/sbin/tazinst unset home_format "$INSTFILE"
domcox@2 411 else
domcox@2 412 /usr/sbin/tazinst unset home_uuid "$INSTFILE"
domcox@2 413 /usr/sbin/tazinst unset home_format "$INSTFILE"
domcox@2 414 fi
domcox@2 415 # hostname
domcox@2 416 /usr/sbin/tazinst set hostname "$(GET HOSTNAME)" "$INSTFILE"
domcox@2 417 # root pwd
domcox@2 418 /usr/sbin/tazinst set root_pwd "$(GET ROOT_PWD)" "$INSTFILE"
domcox@2 419 # user Login
domcox@2 420 /usr/sbin/tazinst set user_login "$(GET USER_LOGIN)" "$INSTFILE"
domcox@2 421 # user Pwd
domcox@2 422 /usr/sbin/tazinst set user_pwd "$(GET USER_PWD)" "$INSTFILE"
domcox@2 423 # win Dual-Boot
domcox@2 424 /usr/sbin/tazinst set winboot "$(GET WINBOOT)" "$INSTFILE"
domcox@2 425 # bootloader
domcox@2 426 if [ "$(GET BOOTLOADER)" == "auto" ]; then
domcox@2 427 /usr/sbin/tazinst set bootloader "auto" "$INSTFILE"
domcox@2 428 else
domcox@2 429 /usr/sbin/tazinst unset bootloader "$INSTFILE"
domcox@2 430 /usr/sbin/tazinst unset winboot "$INSTFILE"
domcox@2 431 fi
domcox@2 432 input_hidden "CHECK" "yes"
domcox@2 433 }
domcox@2 434
domcox@2 435 tazinst_run()
domcox@2 436 {
domcox@2 437 local mode="$(/usr/sbin/tazinst get mode "$INSTFILE")" error
domcox@2 438 h4 "Proceeding to: $mode"
domcox@2 439 /usr/sbin/tazinst execute "$INSTFILE" | /bin/busybox awk '{
domcox@2 440 num=$1+0
domcox@2 441 if (num>0 && num<=100){
domcox@2 442 print "<script type=\"text/javascript\">"
domcox@2 443 printf "document.write(\047<div id=\"progress\">"
domcox@2 444 printf "<img src=\"/styles/default/images/loader.gif\" />"
domcox@2 445 printf $1 "&#37; " substr($0, length($1)+2, 40)
domcox@2 446 print "</div>\047)"
domcox@2 447 print "</script>"
domcox@2 448 }
domcox@2 449 }'
domcox@2 450 # end_of_install
domcox@2 451 if /usr/sbin/tazinst log | grep -q "x-x-" ; then
domcox@2 452 error=1
domcox@2 453 echo "<script type=\"text/javascript\">"
domcox@2 454 printf "document.write(\047<div id=\"progress\">"
domcox@2 455 printf "<img src=\"/styles/default/images/stop.png\" />"
domcox@2 456 printf "$(gettext "Errors encountered.")"
domcox@2 457 printf "</div>\047)\n"
domcox@2 458 echo "</script>"
domcox@2 459 br
domcox@2 460 br
domcox@2 461 /usr/sbin/tazinst log | \
domcox@2 462 /bin/busybox awk '$1 == "-x-x-",$1 == "x-x-x"' | sed 's/-x-x-/ /' \
domcox@2 463 | grep -v "x-x-x"
domcox@2 464 else
domcox@2 465 error=0
domcox@2 466 echo "<script type=\"text/javascript\">"
domcox@2 467 printf "document.write(\047<div id=\"progress\">"
domcox@2 468 printf "<img src=\"/styles/default/images/tux.png\" />"
domcox@2 469 printf "$(gettext "Process completed!")"
domcox@2 470 printf "</div>\047)\n"
domcox@2 471 echo "</script>"
domcox@2 472 br
domcox@2 473 br
domcox@2 474 br
domcox@2 475 p "$(gettext "Installation is now finished, you can exit the installer
domcox@2 476 or reboot on your new SliTaz GNU/Linux operating system")."
domcox@2 477 fi
domcox@2 478 return "$error"
domcox@2 479
domcox@2 480 }
domcox@2 481
domcox@2 482 tazinst_log()
domcox@2 483 {
domcox@2 484 h4 "$(gettext "Tazinst log")"
domcox@2 485 printf "<pre>$(/usr/sbin/tazinst log | sed 's/\%/ percent/g')</pre>"
domcox@2 486 }
domcox@2 487
domcox@2 488
domcox@2 489 #-----------------
domcox@2 490 # page navigation
domcox@2 491 #-----------------
domcox@2 492
domcox@2 493 display_mode()
domcox@2 494 {
domcox@2 495 local mode="$(/usr/sbin/tazinst get mode "$INSTFILE")"
domcox@2 496 case $mode in
domcox@0 497 install)
domcox@2 498 open_div_id "wrapper"
domcox@2 499 h4 "$(gettext 'Install SliTaz')"
domcox@2 500 p "$(gettext "You're going to install SliTaz on a partition of your
domcox@2 501 hard disk drive. If you decide to format your HDD, all data will be
domcox@2 502 lost. If you do not format, all data except for any existing /home
domcox@2 503 directory will be removed, the home directory will be kept as is.")"
domcox@2 504 close_div
domcox@0 505 ;;
domcox@0 506 upgrade)
domcox@2 507 open_div_id "wrapper"
domcox@2 508 h4 "$(gettext 'Upgrade SliTaz')"
domcox@2 509 p "$(gettext "You're going to upgrade an already installed SliTaz
domcox@2 510 system on your hard disk drive. Your /home /etc /var/www directories
domcox@2 511 will be kept, all other directories will be removed. Any additional
domcox@2 512 packages added to your old Slitaz system will be updated as long you
domcox@2 513 have an active internet connection.")"
domcox@2 514 close_div
domcox@0 515 ;;
domcox@0 516 esac
domcox@0 517 }
domcox@0 518
domcox@2 519 moveto_page()
domcox@0 520 {
domcox@2 521 local back="$1" next="$2" back_msg next_msg
domcox@2 522 case "$back" in
domcox@2 523 partitioning)
domcox@2 524 back_msg=$(gettext 'Back to partitioning') ;;
domcox@2 525 input)
domcox@2 526 back_msg=$(gettext 'Back to entering settings') ;;
domcox@2 527 *)
domcox@2 528 back_msg=$(gettext 'Back to Installer Start Page') ;;
domcox@2 529 esac
domcox@2 530 case "$next" in
domcox@2 531 execute|run)
domcox@2 532 next_msg=$(gettext 'Proceed to SliTaz installation') ;;
domcox@2 533 reboot)
domcox@2 534 next_msg=$(gettext 'Installation complete. You can now restart') ;;
domcox@2 535 failed)
domcox@2 536 next_msg=$(gettext 'Installation failed. See log') ;;
domcox@2 537 input)
domcox@2 538 next_msg=$(gettext 'Continue installation.') ;;
domcox@2 539 *)
domcox@2 540 next_msg=$(gettext 'Back to Installer Start Page') ;;
domcox@2 541 esac
domcox@2 542 hr
domcox@2 543 input_hidden "page" "$next"
domcox@2 544 a "$back" "$SCRIPT_NAME?page=$back" "$back_msg"
domcox@2 545 input "submit" "" "$next_msg"
domcox@0 546 }
domcox@0 547
domcox@2 548 moveto_home()
domcox@0 549 {
domcox@2 550 local msg=$(gettext 'Back to Installer Start Page')
domcox@2 551 a "home" "$SCRIPT_NAME?page=home" "$msg"
domcox@0 552 }
domcox@0 553
domcox@0 554 page_redirection()
domcox@0 555 {
domcox@2 556 local page="$1"
domcox@2 557 cat <<EOT
domcox@0 558 <!DOCTYPE html>
domcox@0 559 <html>
domcox@0 560 <head>
domcox@0 561 <meta charset="utf-8">
domcox@0 562 <title>$(gettext "A web page that points a browser to a different page after \
domcox@0 563 2 seconds")</title>
domcox@0 564 <meta http-equiv="refresh" content="0; URL=$SCRIPT_NAME?page=$1">
domcox@0 565 <meta name="keywords" content="automatic redirection">
domcox@0 566 </head>
domcox@0 567 <body>
domcox@0 568 <p>$(gettext "If your browser doesn't automatically redirect within a few \
domcox@2 569 seconds, you may want to go there manually")
domcox@2 570 <a href="$SCRIPT_NAME?page=$page">$(gettext "here")</a></p>
domcox@0 571 </body>
domcox@0 572 </html>
domcox@0 573 EOT
domcox@0 574 }
domcox@0 575
domcox@2 576 #----------
domcox@2 577 # checking
domcox@2 578 #----------
domcox@2 579
domcox@0 580 check_ressources()
domcox@0 581 {
domcox@2 582 local errorcode=0
domcox@2 583 comment "check_ressources"
domcox@0 584 if ! [ -x /usr/sbin/tazinst ] ; then
domcox@2 585 h4 "$(gettext 'Tazinst Error')"
domcox@2 586 p "$(gettext "<strong>tazinst</strong>, the backend to slitaz-installer
domcox@2 587 is missing. Any installation can not be done without tazinst.")"
domcox@2 588 p "$(gettext "Check tazinst permissions, or reinstall the
domcox@2 589 slitaz-installer package.")"
domcox@2 590 errorcode=1
domcox@0 591 else
domcox@2 592 # check tazinst minimum version
domcox@2 593 v=$(/usr/sbin/tazinst version | tr -d '[:alpha:]')
domcox@2 594 r=$TAZINST_MINIMUM_VERSION
domcox@2 595 if ! (echo "$v" | /bin/busybox awk -v r=$r \
domcox@2 596 '{v=$v+0}{ if (v < r) exit 1}') ; then
domcox@2 597 h4 "$(gettext 'Tazinst Error')"
domcox@2 598 p "$(gettext "<strong>tazinst</strong>, the slitaz-installer
domcox@2 599 backend, is not at the minimum required version. Any installation
domcox@2 600 cannot be done without tazinst.")"
domcox@2 601 p "$(gettext "Reinstall the slitaz-installer package, or use
domcox@2 602 tazinst in cli mode.")"
domcox@2 603 errorcode=1
domcox@2 604 fi
domcox@2 605 # check tazinst maximum version
domcox@2 606 v=$(/usr/sbin/tazinst version | tr -d '[:alpha:]')
domcox@2 607 r=$TAZINST_MAXIMUM_VERSION
domcox@2 608 if ! (echo "$v" | /bin/busybox awk -v r=$r \
domcox@2 609 '{v=$v+0}{ if (v > r) exit 1}') ; then
domcox@2 610 h4 "$(gettext 'Tazinst Error')"
domcox@2 611 p "$(gettext "<strong>tazinst</strong>, the slitaz-installer
domcox@2 612 backend, is at a higher version than the maximum authorized
domcox@2 613 by the slitaz-installer. Any installation cannot be done.")"
domcox@2 614 p "$(gettext "Reinstall the slitaz-installer package, or use
domcox@2 615 tazinst in cli mode.")"
domcox@2 616 errorcode=1
domcox@0 617 fi
domcox@0 618 fi
domcox@2 619 return $errorcode
domcox@0 620 }
domcox@0 621
domcox@2 622
domcox@2 623 #---------------
domcox@2 624 # html snippets
domcox@2 625 #---------------
domcox@2 626
domcox@2 627 br()
domcox@0 628 {
domcox@2 629 echo "<br />"
domcox@0 630 }
domcox@0 631
domcox@2 632 hr()
domcox@0 633 {
domcox@2 634 echo "<hr />"
domcox@0 635 }
domcox@0 636
domcox@2 637 comment()
domcox@0 638 {
domcox@2 639 echo "<!-- $1 -->"
domcox@2 640 }
domcox@2 641
domcox@2 642 a()
domcox@2 643 {
domcox@2 644 local value="$1" href="$2" msg="$3"
domcox@2 645 echo "<a class=\"button\" value=\"$value\" href=\"$href\">$msg</a>"
domcox@2 646 }
domcox@2 647
domcox@2 648 open_div()
domcox@2 649 {
domcox@2 650 echo "<div>"
domcox@2 651 }
domcox@2 652
domcox@2 653 open_div_id()
domcox@2 654 {
domcox@2 655 echo "<div id=\"$1\">"
domcox@2 656 }
domcox@2 657
domcox@2 658 open_div_class()
domcox@2 659 {
domcox@2 660 echo "<div class=\"$1\">"
domcox@2 661 }
domcox@2 662
domcox@2 663 close_div()
domcox@2 664 {
domcox@2 665 echo "</div>"
domcox@2 666 }
domcox@2 667
domcox@2 668 p()
domcox@2 669 {
domcox@2 670 echo "<p>$1</p>"
domcox@2 671 }
domcox@2 672
domcox@2 673 h4()
domcox@2 674 {
domcox@2 675 echo "<h4>$1</h4>"
domcox@2 676 }
domcox@2 677
domcox@2 678 h5()
domcox@2 679 {
domcox@2 680 echo "<h5>$1</h5>"
domcox@2 681 }
domcox@2 682
domcox@2 683 label()
domcox@2 684 {
domcox@2 685 local setting="$1" label="$2" title="$3" name="$4" error=0
domcox@2 686 [ -z "$name" ] && name="$setting"
domcox@2 687 printf "<label for=\"$name\""
domcox@2 688 [ "$title" ] && echo " title=\"$title\">" || echo ">"
domcox@2 689 # display label in red in case of error
domcox@2 690 if [ "$CHECK" ]; then
domcox@2 691 /usr/sbin/tazinst check "$setting" "$INSTFILE"
domcox@2 692 error="$?"
domcox@2 693 [ "$error" -gt "0" ] && [ "$error" -lt "127" ] && \
domcox@2 694 printf "<span class=\"alert\">"
domcox@2 695 printf "$label"
domcox@2 696 [ "$error" -gt "0" ] && [ "$error" -lt "127" ] && \
domcox@2 697 printf "<sup>*</sup></span>"
domcox@2 698 else
domcox@2 699 printf "$label"
domcox@2 700 fi
domcox@2 701 echo "</label>"
domcox@2 702 return "$error"
domcox@2 703 }
domcox@2 704
domcox@2 705 label_media()
domcox@2 706 {
domcox@2 707 local id="$1" label="$2" media="$3" title="$4" retcode=0
domcox@2 708 if [ "$media" == "$id" ]; then
domcox@2 709 label "source" "$label" "$title" "$media"
domcox@2 710 retcode="$?"
domcox@2 711 else
domcox@2 712 printf "<label for=\"$id\""
domcox@2 713 [ "$title" ] && echo " title=\"$title\">" || echo ">"
domcox@2 714 echo "$label</label>"
domcox@2 715 fi
domcox@2 716 return "$retcode"
domcox@2 717 }
domcox@2 718
domcox@2 719 error_msg()
domcox@2 720 {
domcox@2 721 local error="$1" setting="$2" line="$3"
domcox@2 722 if [ "$CHECK" ]; then
domcox@2 723 if [ "$error" -gt "0" ]; then
domcox@2 724 [ "$error" -lt "128" ] && printf "<span class=\"alert\">" \
domcox@2 725 || printf "<span class=\"warning\">"
domcox@2 726 if [ "$line" ]; then
domcox@2 727 /usr/sbin/tazinst check "$setting" "$INSTFILE" 2>&1 | \
domcox@2 728 /bin/busybox awk -v LINE="$line" '{if (NR==LINE){print}}'
domcox@2 729 else
domcox@2 730 /usr/sbin/tazinst check "$setting" "$INSTFILE" 2>&1
domcox@2 731 fi
domcox@2 732 echo "</span>"
domcox@2 733 fi
domcox@2 734 fi
domcox@2 735 }
domcox@2 736
domcox@2 737 select()
domcox@2 738 {
domcox@2 739 local list="$1" selected="$2" name="$3" type="$4" none="$(gettext "None")"
domcox@2 740 printf "$list" | /bin/busybox awk -v SELECTED="$selected" -v NONE="$none" \
domcox@2 741 -v NAME="$name" -v TYPE="$type" 'BEGIN{
domcox@2 742 TYPE=TYPE+0
domcox@2 743 print "<select name=\"" NAME "\">"
domcox@2 744 print "<option value=>< " NONE " ></option>"
domcox@2 745 }
domcox@2 746 {
domcox@2 747 printf "<option value=\"" $1 "\""
domcox@2 748 if ($1 == SELECTED) printf " selected"
domcox@2 749 if (TYPE == 0)
domcox@2 750 print ">" $0 "</option>"
domcox@2 751 if (TYPE == 1)
domcox@2 752 print ">" substr($0,12) "</option>"
domcox@2 753 if (TYPE == 2)
domcox@2 754 print ">" $2 "</option>"
domcox@2 755 }
domcox@2 756 END{
domcox@2 757 print "</select>"
domcox@2 758 }'
domcox@2 759 }
domcox@2 760
domcox@2 761 input()
domcox@2 762 {
domcox@2 763 local type="$1" name="$2" value="$3" selected="$4" help="$5" action="$6"
domcox@2 764 printf "<input type=\"$type\" id=\"$name\" list=\"list_$name\" "
domcox@2 765 printf "name=\"$(printf $name | tr [a-z] [A-Z])\" class=\"$type\" "
domcox@2 766 [ "$value" ] && printf "value=\"$value\" "
domcox@2 767 [ "$value" == "$selected" ] && printf "checked "
domcox@2 768 [ "$action" ] && printf \
domcox@2 769 "onInput=\"document.getElementById('$action').checked = true;\" "
domcox@2 770 [ "$help" ] && echo "placeholder=\"$help\" />" || echo "/>"
domcox@2 771 }
domcox@2 772
domcox@2 773 input_media()
domcox@2 774 {
domcox@2 775 local id="$1" media="$2"
domcox@2 776 echo -n "<input type=\"radio\" name=\"MEDIA\" value=\"$id\" id=\"$id\" "
domcox@2 777 echo "$([ "$media" == "$id" ] && echo "checked") />"
domcox@2 778 }
domcox@2 779
domcox@2 780 input_hidden()
domcox@2 781 {
domcox@2 782 local name="$1" value="$2"
domcox@2 783 echo "<input type=\"hidden\" name=\"$name\" value=\"$value\" />"
domcox@2 784 }
domcox@2 785
domcox@2 786 datalist()
domcox@2 787 {
domcox@2 788 local list="$1" name="$2" none="$(gettext "None")"
domcox@2 789 echo "<datalist id=\"list_$name\">"
domcox@2 790 # workaround for browsers that don’t support the datalist element..
domcox@2 791 echo "<select class=\"workaround\" id=\"sel_$name\" \
domcox@2 792 onChange='displaySelValue(\"sel_$name\",\"$name\")' \
domcox@2 793 onBlur='displaySelValue(\"sel_$name\",\"$name\")'>"
domcox@2 794 # workaround ..end
domcox@2 795 printf "$list" | /bin/busybox awk -v NONE="$none" 'BEGIN{
domcox@2 796 line=0
domcox@2 797 }
domcox@2 798 {
domcox@2 799 TEXT=$1
domcox@2 800 sub(".*/","",TEXT)
domcox@2 801 print "<option value=\"" $1 "\">" TEXT "</option>"
domcox@2 802 line++
domcox@2 803 }
domcox@2 804 END{
domcox@2 805 if (line < 1)
domcox@2 806 print "<option value=>< " NONE " ></option>"
domcox@2 807 }'
domcox@2 808 echo "</select>"
domcox@2 809 echo "</datalist>"
domcox@2 810 }
domcox@2 811
domcox@2 812 format()
domcox@2 813 {
domcox@2 814 list_fs="$1" selected="$2" name="$3" none="$(gettext "Do not format")"
domcox@2 815 printf "<label for=\"$name\" title=\"$(gettext "To format this partition, \
domcox@2 816 select a filesystem, usually it's safe to use ext4")\">"
domcox@2 817 echo "$(gettext "Formatting option:")</label>"
domcox@2 818 printf "$list_fs" | /bin/busybox awk -v SELECTED=$selected -v NONE="$none" \
domcox@2 819 -v NAME="$name" 'BEGIN{
domcox@2 820 RS=" "
domcox@2 821 print "<select name=\"" NAME "\">"
domcox@2 822 print "<option value=\"\">" NONE "</option>"
domcox@2 823 line=0
domcox@2 824 }
domcox@2 825 {
domcox@2 826 printf "<option value=\"" $1 "\""
domcox@2 827 if ($1 == SELECTED) printf " selected"
domcox@2 828 print ">" $0 "</option>"
domcox@2 829 line++
domcox@2 830 }
domcox@2 831 END{
domcox@2 832 if (line < 1)
domcox@2 833 print "<option value=>< " NONE " ></option>"
domcox@2 834 print "</select>"
domcox@2 835 }'
domcox@2 836 }
domcox@2 837
domcox@2 838 button()
domcox@2 839 {
domcox@2 840 local action="$1" msg="$2" title="$3"
domcox@2 841 echo "<a class=\"button\" href=\"$SCRIPT_NAME?page=$action\" \
domcox@2 842 title=\"$title\">$msg</a>"
domcox@0 843 }
domcox@0 844
domcox@0 845 form_start()
domcox@0 846 {
domcox@2 847 local name="$1"
domcox@0 848 cat <<EOT
domcox@2 849 <form name="Form_$name" method="get" onsubmit="return true" \
domcox@2 850 action="$SCRIPT_NAME">
domcox@0 851 EOT
domcox@0 852 }
domcox@0 853
domcox@0 854 form_end()
domcox@0 855 {
domcox@0 856 echo "</form>"
domcox@0 857 }
domcox@0 858
domcox@2 859 xhtml_header()
domcox@2 860 {
domcox@2 861 cat << EOT
domcox@2 862 <!DOCTYPE html>
domcox@2 863 <html xmlns="http://www.w3.org/1999/xhtml" lang="$(echo $LANG | cut -f1 -d_)">
domcox@2 864 <head>
domcox@2 865 <title>$(gettext "SliTaz Installer")</title>
domcox@2 866 <meta charset="utf-8" />
domcox@2 867 <link rel="shortcut icon" href="/styles/$STYLE/favicon.ico" />
domcox@2 868 <style type="text/css">
domcox@2 869 .box label {
domcox@2 870 display:inline-block;
domcox@2 871 vertical-align:middle;
domcox@2 872 width: 130px;
domcox@2 873 }
domcox@2 874 .media label {
domcox@2 875 display:inline-block;
domcox@2 876 vertical-align:middle;
domcox@2 877 width: 110px;
domcox@2 878 }
domcox@2 879 .options label {
domcox@2 880 display:inline-block;
domcox@2 881 vertical-align:middle;
domcox@2 882 width: 140px;
domcox@2 883 }
domcox@2 884 .box .text {
domcox@2 885 width: 350px;
domcox@2 886 }
domcox@2 887 input {margin-bottom:3px;}
domcox@2 888 span.alert {color: red}
domcox@2 889 span.warning { color: darkgray}
domcox@2 890 #progress {
domcox@2 891 background-color: #f8f8f8;
domcox@2 892 border: 1px solid #ddd;
domcox@2 893 color: #666;
domcox@2 894 cursor: progress;
domcox@2 895 position: absolute;
domcox@2 896 width: 348px;
domcox@2 897 padding: 4px 4px 2px;
domcox@2 898 }
domcox@2 899 </style>
domcox@2 900 <link rel="stylesheet" type="text/css" href="/styles/$STYLE/style.css" />
domcox@2 901 <!-- Function to hide the loading message when page is generated. -->
domcox@2 902 <script type="text/javascript">
domcox@2 903 function showProgress(){
domcox@2 904 document.getElementById("progress").style.display='none';
domcox@2 905 }
domcox@2 906 </script>
domcox@2 907 <!-- workaround for browsers that don’t support the datalist element -->
domcox@2 908 <style type="text/css">
domcox@2 909 .workaround {width: 110px;}
domcox@2 910 </style>
domcox@2 911 <script>
domcox@2 912 function displaySelValue(selectId,inputId)
domcox@2 913 {
domcox@2 914 var slct = document.getElementById(selectId);
domcox@2 915 var input = document.getElementById(inputId);
domcox@2 916 document.getElementById("src_iso").value="";
domcox@2 917 document.getElementById("src_web").value="";
domcox@2 918 if (inputId =="src_iso"){
domcox@2 919 document.getElementById("iso").checked = true;
domcox@2 920 }
domcox@2 921 if (inputId =="src_web"){
domcox@2 922 document.getElementById("web").checked = true;
domcox@2 923 }
domcox@2 924 input.value = slct.options[slct.selectedIndex].value;
domcox@2 925
domcox@2 926 }
domcox@2 927 </script>
domcox@2 928 <!-- workaround end -->
domcox@2 929 </head>
domcox@2 930 <body onload="showProgress()">
domcox@2 931 </head>
domcox@2 932 <body>
domcox@2 933
domcox@2 934 <!--
domcox@2 935 <div id="header">
domcox@2 936 <h1>$(gettext "SliTaz Installer")</h1>
domcox@2 937 </div>
domcox@2 938 -->
domcox@2 939
domcox@2 940 <!-- Page content -->
domcox@2 941 <div id="content">
domcox@2 942 EOT
domcox@2 943 }
domcox@2 944
domcox@2 945 xhtml_footer()
domcox@2 946 {
domcox@2 947 cat << EOT
domcox@2 948 <!-- End of content-->
domcox@2 949 </div>
domcox@2 950
domcox@2 951 <div id="footer">
domcox@2 952 $(gettext 'Copyright') &copy; 2012-2013
domcox@2 953 <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a>
domcox@2 954 - <a href="/index.cgi?file=/usr/share/licenses/bsd.txt">
domcox@2 955 $(gettext 'BSD License')</a>
domcox@2 956 </div>
domcox@2 957
domcox@2 958 </body>
domcox@2 959 </html>
domcox@2 960 EOT
domcox@2 961 }
domcox@2 962
domcox@2 963
domcox@0 964 #
domcox@2 965 # main
domcox@0 966 #
domcox@0 967
domcox@2 968 header
domcox@2 969
domcox@0 970 case "$(GET page)" in
domcox@0 971 home)
domcox@0 972 xhtml_header
domcox@0 973 select_action
domcox@0 974 select_install
domcox@0 975 select_upgrade
domcox@0 976 ;;
domcox@2 977 install)
domcox@2 978 xhtml_header
domcox@2 979 /usr/sbin/tazinst set mode install "$INSTFILE"
domcox@2 980 page_redirection partitioning
domcox@2 981 ;;
domcox@0 982 partitioning)
domcox@0 983 xhtml_header
domcox@2 984 form_start
domcox@2 985 display_mode
domcox@0 986 select_gparted
domcox@2 987 moveto_page home input
domcox@2 988 form_end
domcox@0 989 ;;
domcox@0 990 gparted)
domcox@2 991 exec_gparted
domcox@2 992 xhtml_header
domcox@0 993 page_redirection partitioning
domcox@0 994 ;;
domcox@0 995 upgrade)
domcox@0 996 xhtml_header
domcox@2 997 /usr/sbin/tazinst set mode upgrade "$INSTFILE"
domcox@2 998 page_redirection input
domcox@2 999 ;;
domcox@2 1000 input)
domcox@2 1001 xhtml_header
domcox@2 1002 form_start
domcox@2 1003 display_mode
domcox@2 1004 select_settings
domcox@2 1005 moveto_page partitioning execute
domcox@0 1006 form_end
domcox@0 1007 ;;
domcox@2 1008 execute)
domcox@0 1009 xhtml_header
domcox@2 1010 form_start
domcox@2 1011 display_mode
domcox@2 1012 save_settings
domcox@2 1013 if ! (/usr/sbin/tazinst check all $INSTFILE > /dev/null); then
domcox@2 1014 page_redirection "input&CHECK=yes"
domcox@0 1015 else
domcox@2 1016 tazinst_run && moveto_page home reboot \
domcox@2 1017 || moveto_page input failed
domcox@0 1018 fi
domcox@2 1019 form_end
domcox@0 1020 ;;
domcox@0 1021 reboot)
domcox@2 1022 /usr/sbin/tazinst clean "$INSTFILE"
domcox@0 1023 reboot ;;
domcox@0 1024 failed)
domcox@0 1025 xhtml_header
domcox@2 1026 form_start
domcox@2 1027 tazinst_log
domcox@2 1028 moveto_home
domcox@2 1029 form_end
domcox@0 1030 ;;
domcox@0 1031 *)
domcox@0 1032 xhtml_header
domcox@0 1033 if check_ressources; then
domcox@2 1034 /usr/sbin/tazinst new "$INSTFILE"
domcox@0 1035 page_redirection home
domcox@0 1036 fi
domcox@0 1037 ;;
domcox@0 1038 esac
domcox@0 1039
domcox@0 1040 xhtml_footer
domcox@0 1041
domcox@0 1042 exit 0