diff options
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/cmd/zoneadmd/vplat.c | 2 | ||||
| -rw-r--r-- | usr/src/cmd/zoneadmd/zoneadmd.c | 29 | ||||
| -rw-r--r-- | usr/src/cmd/zoneadmd/zoneadmd.h | 1 |
3 files changed, 28 insertions, 4 deletions
diff --git a/usr/src/cmd/zoneadmd/vplat.c b/usr/src/cmd/zoneadmd/vplat.c index 3194f52eb4..6ea132427b 100644 --- a/usr/src/cmd/zoneadmd/vplat.c +++ b/usr/src/cmd/zoneadmd/vplat.c @@ -282,7 +282,7 @@ lofs_read_mnttab(zlog_t *zlogp) * This function loops over potential loopback mounts and symlinks in a given * path and resolves them all down to an absolute path. */ -static void +void resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen) { int len, arlen; diff --git a/usr/src/cmd/zoneadmd/zoneadmd.c b/usr/src/cmd/zoneadmd/zoneadmd.c index fd2962f5d2..7ba467160c 100644 --- a/usr/src/cmd/zoneadmd/zoneadmd.c +++ b/usr/src/cmd/zoneadmd/zoneadmd.c @@ -503,6 +503,7 @@ init_template(void) typedef struct fs_callback { zlog_t *zlogp; zoneid_t zoneid; + boolean_t mount_cmd; } fs_callback_t; static int @@ -511,6 +512,7 @@ mount_early_fs(void *data, const char *spec, const char *dir, { zlog_t *zlogp = ((fs_callback_t *)data)->zlogp; zoneid_t zoneid = ((fs_callback_t *)data)->zoneid; + boolean_t mount_cmd = ((fs_callback_t *)data)->mount_cmd; char rootpath[MAXPATHLEN]; pid_t child; int child_status; @@ -518,9 +520,28 @@ mount_early_fs(void *data, const char *spec, const char *dir, int rv; ctid_t ct; - if (zone_get_rootpath(zone_name, rootpath, sizeof (rootpath)) != Z_OK) { - zerror(zlogp, B_FALSE, "unable to determine zone root"); - return (-1); + /* determine the zone rootpath */ + if (mount_cmd) { + char zonepath[MAXPATHLEN]; + char luroot[MAXPATHLEN]; + + assert(zone_isnative || zone_iscluster); + + if (zone_get_zonepath(zone_name, + zonepath, sizeof (zonepath)) != Z_OK) { + zerror(zlogp, B_FALSE, "unable to determine zone path"); + return (-1); + } + + (void) snprintf(luroot, sizeof (luroot), "%s/lu", zonepath); + resolve_lofs(zlogp, luroot, sizeof (luroot)); + (void) strlcpy(rootpath, luroot, sizeof (rootpath)); + } else { + if (zone_get_rootpath(zone_name, + rootpath, sizeof (rootpath)) != Z_OK) { + zerror(zlogp, B_FALSE, "unable to determine zone root"); + return (-1); + } } if ((rv = valid_mount_path(zlogp, rootpath, spec, dir, fstype)) < 0) { @@ -672,6 +693,7 @@ zone_bootup(zlog_t *zlogp, const char *bootargs) cb.zlogp = zlogp; cb.zoneid = zoneid; + cb.mount_cmd = B_FALSE; /* Get a handle to the brand info for this zone */ if ((bh = brand_open(brand_name)) == NULL) { @@ -1087,6 +1109,7 @@ server(void *cookie, char *args, size_t alen, door_desc_t *dp, */ cb.zlogp = zlogp; cb.zoneid = zone_id; + cb.mount_cmd = B_TRUE; rval = brand_platform_iter_mounts(bh, mount_early_fs, &cb); diff --git a/usr/src/cmd/zoneadmd/zoneadmd.h b/usr/src/cmd/zoneadmd/zoneadmd.h index f65f6ae217..d8612b73b9 100644 --- a/usr/src/cmd/zoneadmd/zoneadmd.h +++ b/usr/src/cmd/zoneadmd/zoneadmd.h @@ -124,6 +124,7 @@ extern int valid_mount_path(zlog_t *, const char *, const char *, const char *, const char *); extern int make_one_dir(zlog_t *, const char *, const char *, mode_t, uid_t, gid_t); +extern void resolve_lofs(zlog_t *zlogp, char *path, size_t pathlen); /* * Console subsystem routines. |
