summaryrefslogtreecommitdiff
path: root/usr/src/cmd/zlogin
diff options
context:
space:
mode:
authorSteve Lawrence <Stephen.Lawrence@Sun.COM>2009-10-14 11:48:20 -0700
committerSteve Lawrence <Stephen.Lawrence@Sun.COM>2009-10-14 11:48:20 -0700
commit628680125482a37a45c692030029fd62a600f914 (patch)
tree907bf466b842dc95bfc68baf85b4503e766ebb1f /usr/src/cmd/zlogin
parentbce0a86e5d4d65341c5aca6da2595c848297b2aa (diff)
downloadillumos-joyent-628680125482a37a45c692030029fd62a600f914.tar.gz
6874636 RFE: zoneadmd should mount cluster branded zones as native in alternate roots.
Diffstat (limited to 'usr/src/cmd/zlogin')
-rw-r--r--usr/src/cmd/zlogin/zlogin.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/usr/src/cmd/zlogin/zlogin.c b/usr/src/cmd/zlogin/zlogin.c
index 4138d80306..0effcdd353 100644
--- a/usr/src/cmd/zlogin/zlogin.c
+++ b/usr/src/cmd/zlogin/zlogin.c
@@ -113,6 +113,8 @@ static const char *pname;
#define DEFAULTSHELL "/sbin/sh"
#define DEF_PATH "/usr/sbin:/usr/bin"
+#define CLUSTER_BRAND_NAME "cluster"
+
/*
* The ZLOGIN_BUFSIZ is larger than PIPE_BUF so we can be sure we're clearing
* out the pipe when the child is exiting. The ZLOGIN_RDBUFSIZ must be less
@@ -1894,12 +1896,28 @@ main(int argc, char **argv)
return (1);
}
- /* Get a handle to the brand info for this zone */
- if ((zone_get_brand(zonename, zonebrand, sizeof (zonebrand)) != Z_OK) ||
- ((bh = brand_open(zonebrand)) == NULL)) {
+ if (zone_get_brand(zonename, zonebrand, sizeof (zonebrand)) != Z_OK) {
zerror(gettext("could not get brand for zone %s"), zonename);
return (1);
}
+ /*
+ * In the alternate root environment, the only supported
+ * operations are mount and unmount. In this case, just treat
+ * the zone as native if it is cluster. Cluster zones can be
+ * native for the purpose of LU or upgrade, and the cluster
+ * brand may not exist in the miniroot (such as in net install
+ * upgrade).
+ */
+ if (zonecfg_in_alt_root() &&
+ strcmp(zonebrand, CLUSTER_BRAND_NAME) == 0) {
+ (void) strlcpy(zonebrand, NATIVE_BRAND_NAME,
+ sizeof (zonebrand));
+ }
+ if ((bh = brand_open(zonebrand)) == NULL) {
+ zerror(gettext("could not open brand for zone %s"), zonename);
+ return (1);
+ }
+
if ((new_args = prep_args(bh, login, proc_args)) == NULL) {
zperror(gettext("could not assemble new arguments"));
brand_close(bh);