aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Hibma <n_hibma@FreeBSD.org>2013-04-28 21:44:44 +0000
committerNick Hibma <n_hibma@FreeBSD.org>2013-04-28 21:44:44 +0000
commit2b235be6d35bfde7d095f16f8da7dccee79d026b (patch)
tree0dfb65cf8687437def8132721f381ae0c8c91e31
parent62cc3a631486240859ab933d24e8dd3d98e832e2 (diff)
downloadsrc-2b235be6d35bfde7d095f16f8da7dccee79d026b.tar.gz
src-2b235be6d35bfde7d095f16f8da7dccee79d026b.zip
Doing a cpio from /var/empty if dir was not specified or non-existent
copies its mode to the destination. This is not desirable. Rephrase this code to be more sensible. PR: 173483 MFC after: 1 week
Notes
Notes: svn path=/head/; revision=250034
-rw-r--r--tools/tools/nanobsd/nanobsd.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh
index c3e96b3f5cdc..78525847e396 100644
--- a/tools/tools/nanobsd/nanobsd.sh
+++ b/tools/tools/nanobsd/nanobsd.sh
@@ -413,12 +413,13 @@ populate_slice ( ) (
dir=$2
mnt=$3
lbl=$4
- test -z $2 && dir=${NANO_WORLDDIR}/var/empty
- test -d $dir || dir=${NANO_WORLDDIR}/var/empty
- echo "Creating ${dev} with ${dir} (mounting on ${mnt})"
- newfs_part $dev $mnt $lbl
- cd ${dir}
- find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt}
+ echo "Creating ${dev} (mounting on ${mnt})"
+ newfs_part ${dev} ${mnt} ${lbl}
+ if [ -n "${dir}" -a -d "${dir}" ]; then
+ echo "Populating ${lbl} from ${dir}"
+ cd ${dir}
+ find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt}
+ fi
df -i ${mnt}
umount ${mnt}
)