Skip to content

Commit

Permalink
makeroot: Add -l option to set file system volume label
Browse files Browse the repository at this point in the history
Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D1782
  • Loading branch information
emaste committed Feb 6, 2015
1 parent f98d8f0 commit 51c4218
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tools/tools/makeroot/makeroot.8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions tools/tools/makeroot/makeroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand All @@ -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 ;;
Expand Down Expand Up @@ -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}

0 comments on commit 51c4218

Please sign in to comment.