Print this page
PSARC 2008/766 native zones p2v
6667924 physical to virtual utility for native zones

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/brand/lx/zone/lx_install.ksh
          +++ new/usr/src/lib/brand/lx/zone/lx_install.ksh
↓ open down ↓ 77 lines elided ↑ open up ↑
  78   78  
  79   79  wrong_type=\
  80   80  $(gettext "%s: error: must be a gzip, bzip2, .Z or uncompressed tar archive.")
  81   81  
  82   82  not_readable=$(gettext "Cannot read file '%s'")
  83   83  
  84   84  no_install=$(gettext "Could not create install directory '%s'")
  85   85  no_log=$(gettext "Could not create log directory '%s'")
  86   86  no_logfile=$(gettext "Could not create log file '%s'")
  87   87  
       88 +root_full=$(gettext "Zonepath root %s exists and contains data; remove or move aside prior to install.")
       89 +
  88   90  install_zone=$(gettext "Installing zone '%s' at root directory '%s'")
  89   91  install_from=$(gettext "from archive '%s'")
  90   92  
  91   93  install_fail=$(gettext "Installation of zone '%s' FAILED.")
  92   94  see_log=$(gettext "See the log file:\n  '%s'\nfor details.")
  93   95  
  94   96  install_abort=$(gettext "Installation of zone '%s' aborted.")
  95   97  install_good=$(gettext "Installation of zone '%s' completed successfully.")
  96   98  
  97   99  # Check if commands passed in exist and are executable.
↓ open down ↓ 352 lines elided ↑ open up ↑
 450  452  [[ -n $gtaropts ]] && gtaropts="${gtaropts}f"
 451  453  
 452  454  if [[ ! -d "$install_root" ]]
 453  455  then
 454  456          if ! mkdir -p "$install_root" 2>/dev/null; then
 455  457                  screenlog "$no_install" "$install_root"
 456  458                  exit $int_code
 457  459          fi
 458  460  fi
 459  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 +
 460  471  if [[ ! -d "$logdir" ]]
 461  472  then
 462  473          if ! mkdir -p "$logdir" 2>/dev/null; then
 463  474                  screenlog "$no_log" "$logdir"
 464  475                  exit $int_code
 465  476          fi
 466  477  fi
 467  478  
 468  479  logfile="${logdir}/$zonename.install.$$.log"
 469  480  
↓ open down ↓ 98 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX