Implement NO_ROOT support for distributekernel and packagekernel.

This commit is contained in:
Brooks Davis 2013-05-16 18:37:14 +00:00
parent c532f8c4d6
commit 39da820b5c

View File

@ -1022,26 +1022,51 @@ distributekernel distributekernel.debug:
.if empty(INSTALLKERNEL)
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
false
.endif
mkdir -p ${DESTDIR}/${DISTDIR}
.if defined(NO_ROOT)
echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta
.endif
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
${CROSSENV} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
DESTDIR=${DESTDIR}/${DISTDIR}/kernel \
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \
${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
DESTDIR=${INSTALL_DDIR:S://:/:g:C:/$::}/kernel \
${.TARGET:S/distributekernel/install/}
sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
${DESTDIR}/${DISTDIR}/kernel.meta
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//}
.if defined(NO_ROOT)
echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta
.endif
cd ${KRNLOBJDIR}/${_kernel}; \
${CROSSENV} PATH=${TMPPATH} ${MAKE} \
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \
${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \
KERNEL=${INSTKERNNAME}.${_kernel} \
DESTDIR=${DESTDIR}/${DISTDIR}/kernel.${_kernel} \
DESTDIR=${INSTALL_DDIR:S://:/:g:C:/$::}/kernel.${_kernel} \
${.TARGET:S/distributekernel/install/}
sed -e 's|^./kernel|.|' \
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
.endfor
packagekernel:
.if defined(NO_ROOT)
cd ${DESTDIR}/${DISTDIR}/kernel; \
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz \
@${DESTDIR}/${DISTDIR}/kernel.meta
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//}
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz \
@${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
.endfor
.else
cd ${DESTDIR}/${DISTDIR}/kernel; \
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz .
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//}
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .
.endfor
.endif
#
# doxygen