makeroot: Add -l option to set file system volume label

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D1782
This commit is contained in:
Ed Maste 2015-02-06 15:38:11 +00:00
parent 63ed8a4e4b
commit b01589c956
2 changed files with 9 additions and 2 deletions

View File

@ -41,6 +41,7 @@
.Op Fl e Ar extras-manifest
.Op Fl f Ar filelist
.Op Fl k Ar keydir Op Fl K Ar user
.Op Fl l Ar label
.Op Fl p Ar master.passwd Op Fl g Ar group
.Op Fl s Ar size
.Ar image-file
@ -94,6 +95,8 @@ If no
.Fl K
argument is supplied then the files will be installed in the root user's
directory.
.It Fl l Ar label
Set the file system volume label.
.It Fl p Ar master.passwd Op Fl g Ar group
Install an alternate
.Ar master.passwd

View File

@ -75,7 +75,7 @@ KEYDIR=
KEYUSERS=
PASSWD=
while getopts "B:de:f:g:K:k:p:s:" opt; do
while getopts "B:de:f:g:K:k:l:p:s:" opt; do
case "$opt" in
B) BFLAG="-B ${OPTARG}" ;;
d) DEBUG=1 ;;
@ -84,6 +84,7 @@ while getopts "B:de:f:g:K:k:p:s:" opt; do
g) GROUP="${OPTARG}" ;;
K) KEYUSERS="${KEYUSERS} ${OPTARG}" ;;
k) KEYDIR="${OPTARG}" ;;
l) LABEL="${OPTARG}" ;;
p) PASSWD="${OPTARG}" ;;
s) SIZE="${OPTARG}" ;;
*) usage ;;
@ -230,9 +231,12 @@ if [ -n "${KEYDIR}" ]; then
done
fi
if [ -n "${LABEL}" ]; then
LABELFLAG="-o label=${LABEL}"
fi
if [ -n "${SIZE}" ]; then
SIZEFLAG="-s ${SIZE}"
fi
cd ${BSDROOT}; makefs ${DUPFLAG} -N ${DBDIR} ${SIZEFLAG} ${BFLAG} \
-t ffs -f 256 ${IMGFILE} ${manifest}
-t ffs ${LABELFLAG} -f 256 ${IMGFILE} ${manifest}