diff options
| author | Susan Kamm-Worrell <Susan.Kamm-Worrell@Sun.COM> | 2010-08-16 11:59:54 -0700 |
|---|---|---|
| committer | Susan Kamm-Worrell <Susan.Kamm-Worrell@Sun.COM> | 2010-08-16 11:59:54 -0700 |
| commit | 2a8b76b292edb1417feb26be130d62bf24f6f812 (patch) | |
| tree | 042b170ed9d30e24eddc1c217d21a491ea9a9791 /usr | |
| parent | 99389cdeb9c9d0c12fa16c043aa9d1c384f05a05 (diff) | |
| download | illumos-joyent-2a8b76b292edb1417feb26be130d62bf24f6f812.tar.gz | |
6969507 mount of ipkg zone in alternate root fails
Diffstat (limited to 'usr')
| -rw-r--r-- | usr/src/cmd/zoneadmd/zoneadmd.c | 15 | ||||
| -rw-r--r-- | usr/src/lib/brand/solaris10/zone/poststate.ksh | 6 | ||||
| -rw-r--r-- | usr/src/lib/brand/solaris10/zone/prestate.ksh | 5 | ||||
| -rw-r--r-- | usr/src/lib/libbrand/dtd/brand.dtd.1 | 4 | ||||
| -rw-r--r-- | usr/src/lib/libzonecfg/common/libzonecfg.c | 1 |
5 files changed, 20 insertions, 11 deletions
diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c index 743370c1ad..fe7719bbe1 100644 --- a/usr/src/cmd/zoneadmd/zoneadmd.c +++ b/usr/src/cmd/zoneadmd/zoneadmd.c @@ -20,8 +20,7 @@ */ /* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. */ /* @@ -457,12 +456,14 @@ static int brand_prestatechg(zlog_t *zlogp, int state, int cmd) { char cmdbuf[2 * MAXPATHLEN]; + const char *altroot; if (pre_statechg_hook[0] == '\0') return (0); - if (snprintf(cmdbuf, sizeof (cmdbuf), "%s %d %d", pre_statechg_hook, - state, cmd) > sizeof (cmdbuf)) + altroot = zonecfg_get_root(); + if (snprintf(cmdbuf, sizeof (cmdbuf), "%s %d %d %s", pre_statechg_hook, + state, cmd, altroot) > sizeof (cmdbuf)) return (-1); if (do_subproc(zlogp, cmdbuf, NULL) != 0) @@ -478,12 +479,14 @@ static int brand_poststatechg(zlog_t *zlogp, int state, int cmd) { char cmdbuf[2 * MAXPATHLEN]; + const char *altroot; if (post_statechg_hook[0] == '\0') return (0); - if (snprintf(cmdbuf, sizeof (cmdbuf), "%s %d %d", post_statechg_hook, - state, cmd) > sizeof (cmdbuf)) + altroot = zonecfg_get_root(); + if (snprintf(cmdbuf, sizeof (cmdbuf), "%s %d %d %s", post_statechg_hook, + state, cmd, altroot) > sizeof (cmdbuf)) return (-1); if (do_subproc(zlogp, cmdbuf, NULL) != 0) diff --git a/usr/src/lib/brand/solaris10/zone/poststate.ksh b/usr/src/lib/brand/solaris10/zone/poststate.ksh index 1d87cd4a95..97319f8df3 100644 --- a/usr/src/lib/brand/solaris10/zone/poststate.ksh +++ b/usr/src/lib/brand/solaris10/zone/poststate.ksh @@ -19,9 +19,10 @@ # # CDDL HEADER END # + +# # -# Copyright 2010 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. # . /usr/lib/brand/solaris10/common.ksh @@ -46,6 +47,7 @@ zonename=$1 zonepath=$2 state=$3 cmd=$4 +altroot=$5 # unused at this time for s10 branded zones # If we're readying the zone, update the zone index file to look like this is # the global zone. diff --git a/usr/src/lib/brand/solaris10/zone/prestate.ksh b/usr/src/lib/brand/solaris10/zone/prestate.ksh index 61dc7da01d..5adafc58a4 100644 --- a/usr/src/lib/brand/solaris10/zone/prestate.ksh +++ b/usr/src/lib/brand/solaris10/zone/prestate.ksh @@ -19,9 +19,9 @@ # # CDDL HEADER END # + # -# Copyright 2009 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. +# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. # . /usr/lib/brand/solaris10/common.ksh @@ -46,6 +46,7 @@ zonename=$1 zonepath=$2 state=$3 cmd=$4 +altroot=$5 # unused at this time for s10 branded zones # If we're not readying the zone, then just return. if (( $cmd == 0 )); then diff --git a/usr/src/lib/libbrand/dtd/brand.dtd.1 b/usr/src/lib/libbrand/dtd/brand.dtd.1 index 5a202c8c89..15542102db 100644 --- a/usr/src/lib/libbrand/dtd/brand.dtd.1 +++ b/usr/src/lib/libbrand/dtd/brand.dtd.1 @@ -519,6 +519,8 @@ 0 - ready 1 - boot 4 - halt + 3rd arg Alternate root (zonepath is mounted under this root) + empty string if zone not mounted under alternate root --> <!ELEMENT prestatechange (#PCDATA) > <!ATTLIST prestatechange> @@ -534,7 +536,7 @@ %z Name of zone %R Zonepath of zone - See prestatechange comment for 1st and 2nd argument values. + See prestatechange comment for 1st, 2nd and 3rd argument values. --> <!ELEMENT poststatechange (#PCDATA) > <!ATTLIST poststatechange> diff --git a/usr/src/lib/libzonecfg/common/libzonecfg.c b/usr/src/lib/libzonecfg/common/libzonecfg.c index c9da45b76a..2e8251f82f 100644 --- a/usr/src/lib/libzonecfg/common/libzonecfg.c +++ b/usr/src/lib/libzonecfg/common/libzonecfg.c @@ -238,6 +238,7 @@ char *zonecfg_root = ""; * Set the root (/) path for all zonecfg configuration files. This is a * private interface used by Live Upgrade extensions to access zone * configuration inside mounted alternate boot environments. + * This interface is also used by zoneadm mount and unmount subcommands. */ void zonecfg_set_root(const char *rootpath) |
