Print this page


Split Close
Expand all
Collapse all
          --- old/usr/src/lib/brand/shared/zone/common.ksh
          +++ new/usr/src/lib/brand/shared/zone/common.ksh
↓ open down ↓ 342 lines elided ↑ open up ↑
 343  343  }
 344  344  
 345  345  #
 346  346  # Perform validation and cleanup in the zoneroot after unpacking the archive.
 347  347  #
 348  348  post_unpack()
 349  349  {
 350  350          #
 351  351          # Check if the image was created with a valid libc.so.1.
 352  352          #
 353      -        if [[ -f $ZONEROOT/lib/libc.so.1 ]]; then
 354      -                hwcap=`moe -v -32 $ZONEROOT/lib/libc.so.1 2>&1`
 355      -                if (( $? != 0 )); then
 356      -                        vlog "$f_hwcap_info" "$hwcap"
 357      -                        fail_fatal "$f_sanity_hwcap"
 358      -                fi
      353 +        hwcap=`moe -v -32 $ZONEROOT/lib/libc.so.1 2>&1`
      354 +        if (( $? != 0 )); then
      355 +                vlog "$f_hwcap_info" "$hwcap"
      356 +                fail_fatal "$f_sanity_hwcap"
 359  357          fi
 360  358  
 361  359          ( cd "$ZONEROOT" && \
 362  360              find . \( -type b -o -type c \) -exec rm -f "{}" \; )
 363  361  }
 364  362  
 365  363  #
 366  364  # Determine flar compression style from identification file.
 367  365  #
 368  366  get_compression()
↓ open down ↓ 646 lines elided ↑ open up ↑
1015 1013          chmod 700 $zonepath
1016 1014  
1017 1015          (( $unpack_result != 0 )) && fatal "$f_unpack_failed"
1018 1016  
1019 1017          # Verify this is a valid image.
1020 1018          sanity_check $ZONEROOT
1021 1019  
1022 1020          return 0
1023 1021  }
1024 1022  
1025      -e_cannot_wrap="%s: error: wrapper file already exists"
1026      -e_baddir="Invalid '%s' directory within the zone"
1027      -e_badfile="Invalid '%s' file within the zone"
1028      -e_path_abs="Pathname specified to -a '%s' must be absolute."
1029      -e_not_found="%s: error: file or directory not found."
1030      -e_install_abort="Installation aborted."
1031      -e_not_readable="Cannot read directory '%s'"
1032      -e_not_dir="Error: must be a directory"
1033      -e_unknown_archive="Error: Unknown archive format. Must be a flash archive, a cpio archive (can also be gzipped or bzipped), a pax XUSTAR archive, or a level 0 ufsdump archive."
1034      -e_absolute_archive="Error: archive contains absolute paths instead of relative paths."
1035      -e_mismatch_archive="Error: the archive top-level directory (%s) does not match the zonepath (%s)."
1036      -e_tmpfile="Unable to create temporary file"
1037      -e_root_full="Zonepath root %s exists and contains data; remove or move aside prior to install."
1038      -f_mkdir="Unable to create directory %s."
1039      -f_chmod="Unable to chmod directory %s."
1040      -f_chown="Unable to chown directory %s."
1041      -f_hwcap_info="HWCAP: %s\n"
1042      -f_sanity_hwcap="The image was created with an incompatible libc.so.1 hwcap lofs mount.\n"\
     1023 +# Setup i18n output
     1024 +TEXTDOMAIN="SUNW_OST_OSCMD"
     1025 +export TEXTDOMAIN
     1026 +
     1027 +e_cannot_wrap=$(gettext "%s: error: wrapper file already exists")
     1028 +e_baddir=$(gettext "Invalid '%s' directory within the zone")
     1029 +e_badfile=$(gettext "Invalid '%s' file within the zone")
     1030 +e_path_abs=$(gettext "Pathname specified to -a '%s' must be absolute.")
     1031 +e_not_found=$(gettext "%s: error: file or directory not found.")
     1032 +e_install_abort=$(gettext "Installation aborted.")
     1033 +e_not_readable=$(gettext "Cannot read directory '%s'")
     1034 +e_not_dir=$(gettext "Error: must be a directory")
     1035 +e_unknown_archive=$(gettext "Error: Unknown archive format. Must be a flash archive, a cpio archive (can also be gzipped or bzipped), a pax XUSTAR archive, or a level 0 ufsdump archive.")
     1036 +e_absolute_archive=$(gettext "Error: archive contains absolute paths instead of relative paths.")
     1037 +e_mismatch_archive=$(gettext "Error: the archive top-level directory (%s) does not match the zonepath (%s).")
     1038 +e_tmpfile=$(gettext "Unable to create temporary file")
     1039 +e_root_full=$(gettext "Zonepath root %s exists and contains data; remove or move aside prior to install.")
     1040 +f_mkdir=$(gettext "Unable to create directory %s.")
     1041 +f_chmod=$(gettext "Unable to chmod directory %s.")
     1042 +f_chown=$(gettext "Unable to chown directory %s.")
     1043 +f_hwcap_info=$(gettext "HWCAP: %s\n")
     1044 +f_sanity_hwcap=$(gettext \
     1045 +"The image was created with an incompatible libc.so.1 hwcap lofs mount.\n"\
1043 1046  "       The zone will not boot on this platform.  See the zone's\n"\
1044      -"       documentation for the recommended way to create the archive."
     1047 +"       documentation for the recommended way to create the archive.")
1045 1048  
1046      -m_analyse_archive="Analysing the archive"
     1049 +m_analyse_archive=$(gettext "Analysing the archive")
1047 1050  
1048      -not_readable="Cannot read file '%s'"
1049      -not_flar="Input is not a flash archive"
1050      -bad_flar="Flash archive is a corrupt"
1051      -bad_zfs_flar="Flash archive contains a ZFS send stream.\n\tRecreate the flar using the -L option with cpio or pax."
1052      -f_unpack_failed="Unpacking the archive failed"
1053      -unknown_archiver="Archiver %s is not supported"
1054      -cmd_not_exec="Required command '%s' not executable!"
     1051 +not_readable=$(gettext "Cannot read file '%s'")
     1052 +not_flar=$(gettext "Input is not a flash archive")
     1053 +bad_flar=$(gettext "Flash archive is a corrupt")
     1054 +bad_zfs_flar=$(gettext "Flash archive contains a ZFS send stream.\n\tRecreate the flar using the -L option with cpio or pax.")
     1055 +f_unpack_failed=$(gettext "Unpacking the archive failed")
     1056 +unknown_archiver=$(gettext "Archiver %s is not supported")
     1057 +cmd_not_exec=$(gettext "Required command '%s' not executable!")
1055 1058  
1056 1059  #
1057 1060  # Exit values used by the script, as #defined in <sys/zone.h>
1058 1061  #
1059 1062  #       ZONE_SUBPROC_OK
1060 1063  #       ===============
1061 1064  #       Installation was successful
1062 1065  #
1063 1066  #       ZONE_SUBPROC_USAGE
1064 1067  #       ==================
↓ open down ↓ 17 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX