Bug #1140 » kern.post.mk.diff
kern.post.mk 2008-09-15 23:21:29 +0200 | ||
---|---|---|
echo "You must build a kernel first." ; \
|
||
exit 1 ; \
|
||
fi
|
||
. if exists(${DESTDIR}/boot/${DESTKERNNAME})
|
||
. if exists(${DESTDIR}/${DESTKERNNAME}${POSTFIX})
|
||
.ifndef NOFSCHG
|
||
-chflags noschg ${DESTDIR}/boot/${DESTKERNNAME}
|
||
-chflags noschg ${DESTDIR}/${DESTKERNNAME}${POSTFIX}
|
||
.endif
|
||
. ifdef NO_KERNEL_OLD_STRIP
|
||
cp -p ${DESTDIR}/boot/${DESTKERNNAME} ${DESTDIR}/boot/${DESTKERNNAME}.old
|
||
cp -p ${DESTDIR}/${DESTKERNNAME}${POSTFIX} ${DESTDIR}/${DESTKERNNAME}${POSTFIX}.old
|
||
. else
|
||
${OBJCOPY} --strip-debug ${DESTDIR}/boot/${DESTKERNNAME} ${DESTDIR}/boot/${DESTKERNNAME}.old
|
||
${OBJCOPY} --strip-debug ${DESTDIR}/${DESTKERNNAME}${POSTFIX} ${DESTDIR}/${DESTKERNNAME}${POSTFIX}.old
|
||
. endif
|
||
. endif
|
||
.ifdef NOFSCHG
|
||
${INSTALL} -m 555 -o root -g wheel \
|
||
${SELECTEDKERNEL} ${DESTDIR}/boot/${DESTKERNNAME}
|
||
${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME}${POSTFIX}
|
||
.else
|
||
${INSTALL} -m 555 -o root -g wheel -fschg \
|
||
${SELECTEDKERNEL} ${DESTDIR}/boot/${DESTKERNNAME}
|
||
${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME}${POSTFIX}
|
||
.endif
|
||
kernel-reinstall: kernel-installable
|
||
.ifdef NOFSCHG
|
||
${INSTALL} -m 555 -o root -g wheel \
|
||
${SELECTEDKERNEL} ${DESTDIR}/boot/${DESTKERNNAME}
|
||
${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME}${POSTFIX}
|
||
.else
|
||
${INSTALL} -m 555 -o root -g wheel -fschg \
|
||
${SELECTEDKERNEL} ${DESTDIR}/boot/${DESTKERNNAME}
|
||
${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME}${POSTFIX}
|
||
.endif
|
||
# Require DESTDIR to be manually specified when installing a
|
||
... | ... | |
#
|
||
kernel-installable:
|
||
.if ${P} == vkernel
|
||
.if !defined(DESTDIR)
|
||
.if ( !defined(DESTDIR) || ${DESTDIR} == /boot )
|
||
@echo "When installing a virtual kernel, DESTDIR must be manually specified"
|
||
@exit 1
|
||
.endif
|
||
.endif
|
||
@if [ -f ${DESTDIR}/${DESTKERNNAME} ]; then \
|
||
@if [ -f /${DESTKERNNAME} ]; then \
|
||
echo "You need to make buildworld, installworld, and upgrade"; \
|
||
echo "before you can install a new kernel, because the"; \
|
||
echo "kernel and modules have moved to /boot"; \
|
||
... | ... | |
modules-install:
|
||
.if !defined(NO_MODULES_OLD)
|
||
. ifdef NO_KERNEL_OLD_STRIP
|
||
set -- ${DESTDIR}/boot/modules/*; \
|
||
set -- ${DESTDIR}/modules${POSTFIX}/*; \
|
||
if [ -f "$$1" ]; then \
|
||
mkdir -p ${DESTDIR}/boot/modules.old; \
|
||
mkdir -p ${DESTDIR}/modules${POSTFIX}.old; \
|
||
for file; do \
|
||
cp -p $$file ${DESTDIR}/boot/modules.old; \
|
||
cp -p $$file ${DESTDIR}/modules${POSTFIX}.old; \
|
||
done; \
|
||
fi
|
||
. else
|
||
set -- ${DESTDIR}/boot/modules/*; \
|
||
set -- ${DESTDIR}/modules${POSTFIX}/*; \
|
||
if [ -f "$$1" ]; then \
|
||
mkdir -p ${DESTDIR}/boot/modules.old; \
|
||
mkdir -p ${DESTDIR}/modules${POSTFIX}.old; \
|
||
for file; do \
|
||
${OBJCOPY} --strip-debug $$file ${DESTDIR}/boot/modules.old/$${file##*/}; \
|
||
${OBJCOPY} --strip-debug $$file ${DESTDIR}/modules${POSTFIX}.old/$${file##*/}; \
|
||
done; \
|
||
fi
|
||
. endif
|
||
.endif
|
||
mkdir -p ${DESTDIR}/boot/modules # Ensure that the modules directory exists!
|
||
mkdir -p ${DESTDIR}/modules${POSTFIX} # Ensure that the modules directory exists!
|
||
cd $S ; env ${MKMODULESENV} ${MAKE} -f Makefile.modules install
|
||
modules-reinstall:
|