68 zone_initfail=$(gettext "Attempt to initialize zone '%s' FAILED.")
69 path_abs=$(gettext "Pathname specified to -d '%s' must be absolute.")
70
71 cmd_h=$(gettext "%s -z <zone name> %s -h")
72 cmd_full=\
73 $(gettext "%s -z <zone name> %s [-v | -s] [-d <dir>|<device>] [<cluster> ... ]")
74
75 both_modes=$(gettext "%s: error: cannot select both silent and verbose modes")
76
77 not_found=$(gettext "%s: error: file or directory not found.")
78
79 wrong_type=\
80 $(gettext "%s: error: must be a gzip, bzip2, .Z or uncompressed tar archive.")
81
82 not_readable=$(gettext "Cannot read file '%s'")
83
84 no_install=$(gettext "Could not create install directory '%s'")
85 no_log=$(gettext "Could not create log directory '%s'")
86 no_logfile=$(gettext "Could not create log file '%s'")
87
88 install_zone=$(gettext "Installing zone '%s' at root directory '%s'")
89 install_from=$(gettext "from archive '%s'")
90
91 install_fail=$(gettext "Installation of zone '%s' FAILED.")
92 see_log=$(gettext "See the log file:\n '%s'\nfor details.")
93
94 install_abort=$(gettext "Installation of zone '%s' aborted.")
95 install_good=$(gettext "Installation of zone '%s' completed successfully.")
96
97 # Check if commands passed in exist and are executable.
98 check_cmd()
99 {
100 for cmd in "$@"; do
101 if [[ ! -f $cmd ]]; then
102 screenlog "$cmd_not_found" "$cmd"
103 screenlog "$install_abort" "$zonename"
104 exit $ZONE_SUBPROC_NOTCOMPLETE
105 fi
106
107 if [[ ! -x $cmd ]]; then
440 # If verbose mode was specified, pass the verbose flag to lx_distro_install
441 # for ISO or disc installations and to gtar for tarball-based installs.
442 #
443 if [[ -n $verbose_mode ]]
444 then
445 echo $(gettext "Verbose output mode enabled.")
446 install_opts="$install_opts -v"
447 [[ -n $gtaropts ]] && gtaropts="${gtaropts}v"
448 fi
449
450 [[ -n $gtaropts ]] && gtaropts="${gtaropts}f"
451
452 if [[ ! -d "$install_root" ]]
453 then
454 if ! mkdir -p "$install_root" 2>/dev/null; then
455 screenlog "$no_install" "$install_root"
456 exit $int_code
457 fi
458 fi
459
460 if [[ ! -d "$logdir" ]]
461 then
462 if ! mkdir -p "$logdir" 2>/dev/null; then
463 screenlog "$no_log" "$logdir"
464 exit $int_code
465 fi
466 fi
467
468 logfile="${logdir}/$zonename.install.$$.log"
469
470 if ! > $logfile; then
471 screenlog "$no_logfile" "$logfile"
472 exit $int_code
473 fi
474
475 # Redirect stderr to the log file to automatically log any error messages
476 exec 2>>"$logfile"
477
478 #
479 # From here on out, an unspecified exit or interrupt should exit with
|
68 zone_initfail=$(gettext "Attempt to initialize zone '%s' FAILED.")
69 path_abs=$(gettext "Pathname specified to -d '%s' must be absolute.")
70
71 cmd_h=$(gettext "%s -z <zone name> %s -h")
72 cmd_full=\
73 $(gettext "%s -z <zone name> %s [-v | -s] [-d <dir>|<device>] [<cluster> ... ]")
74
75 both_modes=$(gettext "%s: error: cannot select both silent and verbose modes")
76
77 not_found=$(gettext "%s: error: file or directory not found.")
78
79 wrong_type=\
80 $(gettext "%s: error: must be a gzip, bzip2, .Z or uncompressed tar archive.")
81
82 not_readable=$(gettext "Cannot read file '%s'")
83
84 no_install=$(gettext "Could not create install directory '%s'")
85 no_log=$(gettext "Could not create log directory '%s'")
86 no_logfile=$(gettext "Could not create log file '%s'")
87
88 root_full=$(gettext "Zonepath root %s exists and contains data; remove or move aside prior to install.")
89
90 install_zone=$(gettext "Installing zone '%s' at root directory '%s'")
91 install_from=$(gettext "from archive '%s'")
92
93 install_fail=$(gettext "Installation of zone '%s' FAILED.")
94 see_log=$(gettext "See the log file:\n '%s'\nfor details.")
95
96 install_abort=$(gettext "Installation of zone '%s' aborted.")
97 install_good=$(gettext "Installation of zone '%s' completed successfully.")
98
99 # Check if commands passed in exist and are executable.
100 check_cmd()
101 {
102 for cmd in "$@"; do
103 if [[ ! -f $cmd ]]; then
104 screenlog "$cmd_not_found" "$cmd"
105 screenlog "$install_abort" "$zonename"
106 exit $ZONE_SUBPROC_NOTCOMPLETE
107 fi
108
109 if [[ ! -x $cmd ]]; then
442 # If verbose mode was specified, pass the verbose flag to lx_distro_install
443 # for ISO or disc installations and to gtar for tarball-based installs.
444 #
445 if [[ -n $verbose_mode ]]
446 then
447 echo $(gettext "Verbose output mode enabled.")
448 install_opts="$install_opts -v"
449 [[ -n $gtaropts ]] && gtaropts="${gtaropts}v"
450 fi
451
452 [[ -n $gtaropts ]] && gtaropts="${gtaropts}f"
453
454 if [[ ! -d "$install_root" ]]
455 then
456 if ! mkdir -p "$install_root" 2>/dev/null; then
457 screenlog "$no_install" "$install_root"
458 exit $int_code
459 fi
460 fi
461
462 #
463 # Check for a non-empty root.
464 #
465 cnt=`ls $install_root | wc -l`
466 if [ $cnt -ne 0 ]; then
467 screenlog "$root_full" "$install_root"
468 exit $int_code
469 fi
470
471 if [[ ! -d "$logdir" ]]
472 then
473 if ! mkdir -p "$logdir" 2>/dev/null; then
474 screenlog "$no_log" "$logdir"
475 exit $int_code
476 fi
477 fi
478
479 logfile="${logdir}/$zonename.install.$$.log"
480
481 if ! > $logfile; then
482 screenlog "$no_logfile" "$logfile"
483 exit $int_code
484 fi
485
486 # Redirect stderr to the log file to automatically log any error messages
487 exec 2>>"$logfile"
488
489 #
490 # From here on out, an unspecified exit or interrupt should exit with
|