#!/bin/sh

# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"@(#)luzonevfs.sh	1.1	07/03/02 SMI"
#
# This is a helper script for lu_beo.c.  It retrieves the file system
# information from the non-global zones in a specified boot environment.
# The output format is vfstab(4) with one extra field: zone name.

PATH=/usr/bin:/usr/sbin:/sbin
export PATH

LUBIN=${LUBIN:=/usr/lib/lu}
. $LUBIN/lulib

if [ $# -ne 1 ]; then
	$LUPRINTF -Eelp2 "`gettext 'usage: luzonevfs <be-root>'`"
	exit 1
fi

if [ ! -d "$1" ]; then
	$LUPRINTF -Eelp2 "`gettext 'luzonevfs: %s is not a directory'`" "$1"
	exit 1
fi

lulib_zone_check "$1"

all_nonglobal_zones -c "$1" |
while read zonename; do
	lulib_get_zone_fs "$1" $zonename | sed 's/$/	'$zonename/
done
