Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Mar 2000 16:51:06 +0200
From:      Sheldon Hearn <sheldonh@uunet.co.za>
To:        hackers@FreeBSD.org
Subject:   Alpha & pc98 testers wanted
Message-ID:  <698.954514266@axl.ops.uunet.co.za>

next in thread | raw e-mail | index | archive | help

Hi folks,

The following patch to the 5.0-CURRENT sources allows the installkernel
target to install multiple kernels.  Given the following in
/etc/make.conf:

	KERNEL=	AXL AXLOPT GENERIC

the installkernel target would install:

	AXL	->	/kernel
	AXLOPT	->	/kernel.AXLOPT
	GENERIC	->	/kernel.GENERIC

I've tested this for the i386 and would prefer to have it tested on the
Alpha and pc98 before committing it, although I'm convinced that it
should work on both of those platforms.

Thanks,
Sheldon.

PS: This patch comes from PR 17698.

Index: Makefile.inc1
===================================================================
RCS file: /home/ncvs/src/Makefile.inc1,v
retrieving revision 1.143
diff -u -d -r1.143 Makefile.inc1
--- Makefile.inc1	2000/03/30 13:06:53	1.143
+++ Makefile.inc1	2000/03/31 12:19:48
@@ -339,6 +339,7 @@
 # properly.
 
 KERNEL?=	GENERIC GENERIC98
+DESTKERNEL?=	kernel
 
 # The only exotic MACHINE_ARCH/MACHINE combination valid at this
 # time is i386/pc98. In all other cases set MACHINE equal to
@@ -357,11 +358,14 @@
 
 BUILDKERNELS=
 INSTALLKERNEL=
+INSTALLKERNELS=
 .for _kernel in ${KERNEL}
 .if exists(${KRNLCONFDIR}/${_kernel})
 BUILDKERNELS+=	${_kernel}
 .if empty(INSTALLKERNEL)
 INSTALLKERNEL= ${_kernel}
+.else
+INSTALLKERNELS+= ${_kernel}
 .endif
 .endif
 .endfor
@@ -392,12 +396,25 @@
 #
 # installkernel
 #
-# Install the kernel defined by INSTALLKERNEL
+# Install the kernel defined by INSTALLKERNEL and INSTALLKERNELS
 #
 installkernel:
+	@echo
+	@echo "--------------------------------------------------------------"
+	@echo ">>> Installing kernel(s)"
+	@echo "--------------------------------------------------------------"
+	@echo "===> ${INSTALLKERNEL} as ${DESTDIR}/${DESTKERNEL}"
 	cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
 		${IMAKEENV} MACHINE=${MACHINE} KERNEL=${INSTALLKERNEL} \
-		    ${MAKE} install
+		    DESTKERNEL=${DESTKERNEL} ${MAKE} install
+.for _kernel in ${INSTALLKERNELS}
+	@echo "===> ${_kernel} as ${DESTDIR}/${DESTKERNEL}.${_kernel}"
+	cd ${KRNLOBJDIR}/${_kernel}; \
+		${IMAKEENV} MACHINE=${MACHINE} KERNEL=${_kernel} \
+		    DESTKERNEL=${DESTKERNEL}.${_kernel} ${MAKE} install
+.endfor	
+
+
 
 #
 # update
Index: sys/conf/Makefile.alpha
===================================================================
RCS file: /home/ncvs/src/sys/conf/Makefile.alpha,v
retrieving revision 1.48
diff -u -d -r1.48 Makefile.alpha
--- sys/conf/Makefile.alpha	2000/03/29 23:20:35	1.48
+++ sys/conf/Makefile.alpha	2000/03/31 14:40:39
@@ -21,6 +21,7 @@
 
 # Can be overridden by makeoptions or /etc/make.conf
 KERNEL?=	kernel
+DESTKERNEL?=	${KERNEL}
 STD8X16FONT?=	iso
 
 .if !defined(S)
@@ -243,16 +244,16 @@
 		echo "You must build a kernel first." ; \
 		exit 1 ; \
 	fi
-.if exists(${DESTDIR}/${KERNEL})
-	-chflags noschg ${DESTDIR}/${KERNEL}
-	mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old
+.if exists(${DESTDIR}/${DESTKERNEL})
+	-chflags noschg ${DESTDIR}/${DESTKERNEL}
+	mv -f ${DESTDIR}/${DESTKERNEL} ${DESTDIR}/${DESTKERNEL}.old
 .endif
 	install -c -m 555 -o root -g wheel -fschg \
-		${KERNEL}${.TARGET:S/install//} ${DESTDIR}/${KERNEL}
+		${KERNEL}${.TARGET:S/install//} ${DESTDIR}/${DESTKERNEL}
 
 reinstall reinstall.debug:
 	install -c -m 555 -o root -g wheel -fschg \
-		${KERNEL}${.TARGET:S/reinstall//} ${DESTDIR}/${KERNEL}
+		${KERNEL}${.TARGET:S/reinstall//} ${DESTDIR}/${DESTKERNEL}
 
 config.o:
 	${NORMAL_C}
Index: sys/conf/Makefile.i386
===================================================================
RCS file: /home/ncvs/src/sys/conf/Makefile.i386,v
retrieving revision 1.180
diff -u -d -r1.180 Makefile.i386
--- sys/conf/Makefile.i386	2000/03/29 23:20:35	1.180
+++ sys/conf/Makefile.i386	2000/03/31 12:16:50
@@ -21,6 +21,7 @@
 
 # Can be overridden by makeoptions or /etc/make.conf
 KERNEL?=	kernel
+DESTKERNEL?=	${KERNEL}
 STD8X16FONT?=	iso
 
 .if !defined(S)
@@ -197,16 +198,16 @@
 		echo "You must build a kernel first." ; \
 		exit 1 ; \
 	fi
-.if exists(${DESTDIR}/${KERNEL})
-	-chflags noschg ${DESTDIR}/${KERNEL}
-	mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old
+.if exists(${DESTDIR}/${DESTKERNEL})
+	-chflags noschg ${DESTDIR}/${DESTKERNEL}
+	mv -f ${DESTDIR}/${DESTKERNEL} ${DESTDIR}/${DESTKERNEL}.old
 .endif
 	install -c -m 555 -o root -g wheel -fschg \
-		${KERNEL}${.TARGET:S/install//} ${DESTDIR}/${KERNEL}
+		${KERNEL}${.TARGET:S/install//} ${DESTDIR}/${DESTKERNEL}
 
 reinstall reinstall.debug:
 	install -c -m 555 -o root -g wheel -fschg \
-		${KERNEL}${.TARGET:S/reinstall//} ${DESTDIR}/${KERNEL}
+		${KERNEL}${.TARGET:S/reinstall//} ${DESTDIR}/${DESTKERNEL}
 
 config.o:
 	${NORMAL_C}
Index: sys/conf/Makefile.pc98
===================================================================
RCS file: /home/ncvs/src/sys/conf/Makefile.pc98,v
retrieving revision 1.83
diff -u -d -r1.83 Makefile.pc98
--- sys/conf/Makefile.pc98	2000/03/29 23:20:35	1.83
+++ sys/conf/Makefile.pc98	2000/03/31 14:41:43
@@ -23,6 +23,7 @@
 
 # Can be overridden by makeoptions or /etc/make.conf
 KERNEL?=	kernel
+DESTKERNEL?=	${KERNEL}
 #STD8X16FONT?=	iso
 
 .if !defined(S)
@@ -200,16 +201,16 @@
 		echo "You must build a kernel first." ; \
 		exit 1 ; \
 	fi
-.if exists(${DESTDIR}/${KERNEL})
-	-chflags noschg ${DESTDIR}/${KERNEL}
-	mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old
+.if exists(${DESTDIR}/${DESTKERNEL})
+	-chflags noschg ${DESTDIR}/${DESTKERNEL}
+	mv -f ${DESTDIR}/${DESTKERNEL} ${DESTDIR}/${DESTKERNEL}.old
 .endif
 	install -c -m 555 -o root -g wheel -fschg \
-		${KERNEL}${.TARGET:S/install//} ${DESTDIR}/${KERNEL}
+		${KERNEL}${.TARGET:S/install//} ${DESTDIR}/${DESTKERNEL}
 
 reinstall reinstall.debug:
 	install -c -m 555 -o root -g wheel -fschg \
-		${KERNEL}${.TARGET:S/reinstall//} ${DESTDIR}/${KERNEL}
+		${KERNEL}${.TARGET:S/reinstall//} ${DESTDIR}/${DESTKERNEL}
 
 config.o:
 	${NORMAL_C}


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?698.954514266>