Prefer install over mkdir to create the directory. Add test to ensure

the directory doesn't exist before creating it. This makes the NO_ROOT
case actually work.

Suggested by: brooks@
This commit is contained in:
Warner Losh 2015-02-09 16:29:44 +00:00
parent 9f78f7b262
commit cbe6c25d2e

View File

@ -64,9 +64,9 @@ realinstall: _dtbinstall
.ORDER: beforeinstall _kmodinstall .ORDER: beforeinstall _kmodinstall
_dtbinstall: _dtbinstall:
# Need to create this because installkernel doesn't invoke mtree with BSD.root.mtree # Need to create this because installkernel doesn't invoke mtree with BSD.root.mtree
# to make sure the tree is setup properly. This may break ownership of ${DTBDIR} # to make sure the tree is setup properly. We don't recreate it to avoid duplicate
# for no-root build. # entries in the NO_ROOT case.
mkdir -p ${DESTDIR}${DTBDIR} test -d ${DESTDIR}${DTBDIR} || ${INSTALL} -d -o ${DTBOWN} -g ${DTBGRP} ${DESTDIR}${DTBDIR}
.for _dtb in ${DTB} .for _dtb in ${DTB}
${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \ ${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \
${_INSTALLFLAGS} ${_dtb} ${DESTDIR}${DTBDIR} ${_INSTALLFLAGS} ${_dtb} ${DESTDIR}${DTBDIR}