From 588a679c1744a571f0e4ed10cc70b61059b37eeb Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Thu, 22 Feb 2007 21:02:49 +0000 Subject: [PATCH] Enable building/installing of multiple kernels in nrelease. Directly make use of this feature and build a NATA kernel. --- nrelease/Makefile | 46 ++++++++++++++++++++++++++++++------------- sys/conf/kern.post.mk | 24 +++++++++++----------- sys/conf/kern.pre.mk | 3 ++- 3 files changed, 46 insertions(+), 27 deletions(-) diff --git a/nrelease/Makefile b/nrelease/Makefile index e7b33ddffc..0de49a7c9f 100644 --- a/nrelease/Makefile +++ b/nrelease/Makefile @@ -1,4 +1,4 @@ -# $DragonFly: src/nrelease/Makefile,v 1.59 2007/02/16 10:11:46 swildner Exp $ +# $DragonFly: src/nrelease/Makefile,v 1.60 2007/02/22 21:02:48 corecode Exp $ # # compat target @@ -15,7 +15,7 @@ ISODIR ?= /usr/release ISOFILE ?= ${ISODIR}/dfly.iso ISOROOT = ${ISODIR}/root OBJSYS= ${.OBJDIR}/../sys -KERNCONF ?= GENERIC +KERNCONF ?= GENERIC NATA PKGSRC_PREFIX?= /usr/pkg PKGBIN_PKG_ADD?= ${PKGSRC_PREFIX}/sbin/pkg_add @@ -103,17 +103,18 @@ check: @exit 1 .endif -buildworld1: - ( cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make buildworld ) +buildworld1 buildworld2: + cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make ${.TARGET:C/build(.*)2/quick\1/:C/1//} -buildworld2: - ( cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make quickworld ) - -buildkernel1: - ( cd ${.CURDIR}/..; CCVER=${KERNEL_CCVER} make buildkernel KERNCONF=${KERNCONF} ) - -buildkernel2: - ( cd ${.CURDIR}/..; CCVER=${KERNEL_CCVER} make quickkernel KERNCONF=${KERNCONF} ) +buildkernel1 buildkernel2: + cd ${.CURDIR}/..; \ + first=; \ + for kernconf in ${KERNCONF}; do \ + CCVER=${KERNEL_CCVER} make ${.TARGET:C/build(.*)2/quick\1/:C/1//} \ + KERNCONF=$${kernconf} \ + $${first:+-DNO_MODULES}; \ + first=done; \ + done # note that we do not want to mess with any /usr/obj directories not related # to buildworld, buildkernel, or nrelease, so we must supply the proper @@ -129,8 +130,15 @@ buildiso: cp -p ${.CURDIR}/mk.conf.pkgsrc ${ISOROOT}/etc/mk.conf chroot ${ISOROOT} /usr/bin/newaliases cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd - ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} \ - installkernel KERNCONF=${KERNCONF} ) + cd ${.CURDIR}/..; \ + first=; \ + for kernconf in ${KERNCONF}; do \ + make DESTDIR=${ISOROOT} \ + installkernel KERNCONF=$${kernconf} \ + $${first:+DESTKERNNAME=kernel.$${kernconf}} \ + $${first:+-DNO_MODULES}; \ + first=done; \ + done ln -s kernel ${ISOROOT}/kernel.BOOTP mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/ mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var @@ -230,6 +238,16 @@ pkgsrc_cdrecord: ${PKGBIN_PKG_ADD} ${PKGSRC_PKG_PATH}/cdrecord* .endif + +# XXX I am a tentative target, remove me when I am not needed anymore! +buildkernel1 buildkernel2: ${.CURDIR}/../sys/config/NATA + +${.CURDIR}/../sys/config/NATA: ${.CURDIR}/../sys/config/GENERIC + ( sed -e '/[[:<:]]ata[01]/d;s/[[:<:]]ata/n&/' ${.ALLSRC}; \ + echo "options PCI_MAP_FIXUP"; \ + echo "device nataraid" ) > ${.TARGET} + + .PHONY: all release installer_release quickrel installer_quickrel realquickrel .PHONY: installer_fetch .PHONY: installer_realquickrel check buildworld1 buildworld2 diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index b50aedaa05..d40d1f83dd 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -1,4 +1,4 @@ -# $DragonFly: src/sys/conf/kern.post.mk,v 1.9 2007/02/05 22:19:28 corecode Exp $ +# $DragonFly: src/sys/conf/kern.post.mk,v 1.10 2007/02/22 21:02:49 corecode Exp $ # # This Makefile covers the bottom part of the MI build instructions # @@ -112,35 +112,35 @@ kernel-install: exit 1 ; \ fi .ifdef NOFSCHG -. if exists(${DESTDIR}/${KERNEL}) +. if exists(${DESTDIR}/${DESTKERNNAME}) . ifdef NO_KERNEL_OLD_STRIP - cp -p ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old + cp -p ${DESTDIR}/${DESTKERNNAME} ${DESTDIR}/${DESTKERNNAME}.old . else - ${OBJCOPY} --strip-debug ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old + ${OBJCOPY} --strip-debug ${DESTDIR}/${DESTKERNNAME} ${DESTDIR}/${DESTKERNNAME}.old . endif . endif ${INSTALL} -m 555 -o root -g wheel \ - ${SELECTEDKERNEL} ${DESTDIR}/${KERNEL} + ${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME} .else -. if exists(${DESTDIR}/${KERNEL}) - -chflags noschg ${DESTDIR}/${KERNEL} +. if exists(${DESTDIR}/${DESTKERNNAME}) + -chflags noschg ${DESTDIR}/${DESTKERNNAME} . ifdef NO_KERNEL_OLD_STRIP - cp -p ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old + cp -p ${DESTDIR}/${DESTKERNNAME} ${DESTDIR}/${DESTKERNNAME}.old . else - ${OBJCOPY} --strip-debug ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old + ${OBJCOPY} --strip-debug ${DESTDIR}/${DESTKERNNAME} ${DESTDIR}/${DESTKERNNAME}.old . endif . endif ${INSTALL} -m 555 -o root -g wheel -fschg \ - ${SELECTEDKERNEL} ${DESTDIR}/${KERNEL} + ${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME} .endif kernel-reinstall: .ifdef NOFSCHG ${INSTALL} -m 555 -o root -g wheel \ - ${SELECTEDKERNEL} ${DESTDIR}/${KERNEL} + ${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME} .else ${INSTALL} -m 555 -o root -g wheel -fschg \ - ${SELECTEDKERNEL} ${DESTDIR}/${KERNEL} + ${SELECTEDKERNEL} ${DESTDIR}/${DESTKERNNAME} .endif .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 35fd2bcc53..5d0820c550 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -1,4 +1,4 @@ -# $DragonFly: src/sys/conf/kern.pre.mk,v 1.4 2007/01/19 07:23:42 dillon Exp $ +# $DragonFly: src/sys/conf/kern.pre.mk,v 1.5 2007/02/22 21:02:49 corecode Exp $ # # This Makefile covers the top part of the MI kernel build instructions # @@ -103,6 +103,7 @@ SELECTEDKERNEL= ${KERNEL}.debug FULLKERNEL= ${KERNEL}.nodebug SELECTEDKERNEL= ${KERNEL}.stripped .endif +DESTKERNNAME?= ${KERNEL} MKMODULESENV= MAKEOBJDIRPREFIX=${.OBJDIR} BUILDING_WITH_KERNEL=${.OBJDIR} -- 2.41.0