summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorGerald Jelinek <Gerald.Jelinek@Sun.COM>2010-01-06 14:33:59 -0800
committerGerald Jelinek <Gerald.Jelinek@Sun.COM>2010-01-06 14:33:59 -0800
commit1c604ca783a40b93271e2765bd14a3060c14429b (patch)
treefd3d7b454921084a549f9a50b5cef73631f602a5 /usr/src
parente9af4bc0b1cc30cea75d6ad4aa2fde97d985e9be (diff)
downloadillumos-gate-1c604ca783a40b93271e2765bd14a3060c14429b.tar.gz
6911417 need a way to test images with no patch metadata
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/lib/brand/solaris10/s10_support/s10_support.c27
-rw-r--r--usr/src/lib/brand/solaris10/zone/image_install.ksh4
2 files changed, 23 insertions, 8 deletions
diff --git a/usr/src/lib/brand/solaris10/s10_support/s10_support.c b/usr/src/lib/brand/solaris10/s10_support/s10_support.c
index 61a52ee989..e8a640b6e0 100644
--- a/usr/src/lib/brand/solaris10/s10_support/s10_support.c
+++ b/usr/src/lib/brand/solaris10/s10_support/s10_support.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -230,17 +230,13 @@ read_pkg_data(FILE *fp)
* Read the SUNWcakr pkginfo file and get the PATCHLIST for the pkg.
*/
static int
-get_ku_patchlist(char *zonename, char **patchlist)
+get_ku_patchlist(char *zonepath, char **patchlist)
{
- char zonepath[MAXPATHLEN];
char pkginfo[MAXPATHLEN];
FILE *fp;
char *buf;
int err = 0;
- if (zone_get_zonepath(zonename, zonepath, sizeof (zonepath)) != Z_OK)
- s10_err(gettext("error getting zone's path"));
-
if (snprintf(pkginfo, sizeof (pkginfo),
"%s/root/var/sadm/pkg/SUNWcakr/pkginfo", zonepath)
>= sizeof (pkginfo))
@@ -285,12 +281,29 @@ have_valid_ku(char *zonename)
char *pstr;
char *patchlist = NULL;
int i;
+ char zonepath[MAXPATHLEN];
+ char sanity_skip[MAXPATHLEN];
+ struct stat64 buf;
char *vers_table[] = {
"141444-09",
"141445-09",
NULL};
- if (get_ku_patchlist(zonename, &patchlist) != 0 || patchlist == NULL)
+ if (zone_get_zonepath(zonename, zonepath, sizeof (zonepath)) != Z_OK)
+ s10_err(gettext("error getting zone's path"));
+
+ /*
+ * If the zone was installed to bypass sanity checking for internal
+ * testing purposes, just return success.
+ */
+ if (snprintf(sanity_skip, sizeof (sanity_skip), "%s/root/.sanity_skip",
+ zonepath) >= sizeof (sanity_skip))
+ s10_err(gettext("error formating file path"));
+
+ if (stat64(sanity_skip, &buf) == 0)
+ return (B_TRUE);
+
+ if (get_ku_patchlist(zonepath, &patchlist) != 0 || patchlist == NULL)
return (B_FALSE);
pstr = patchlist;
diff --git a/usr/src/lib/brand/solaris10/zone/image_install.ksh b/usr/src/lib/brand/solaris10/zone/image_install.ksh
index c322b654d8..8cf238a16b 100644
--- a/usr/src/lib/brand/solaris10/zone/image_install.ksh
+++ b/usr/src/lib/brand/solaris10/zone/image_install.ksh
@@ -19,7 +19,7 @@
#
# CDDL HEADER END
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -210,6 +210,8 @@ create_active_ds
vlog "Installation started for zone \"$ZONENAME\""
install_image "$inst_type" "$install_media"
+[[ "$SANITY_SKIP" == "1" ]] && touch $ZONEROOT/.sanity_skip
+
log "$p2ving"
vlog "running: p2v $OPT_V $unconfig_zone $ZONENAME $ZONEPATH"