Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc Add support for specifying extra kernel name suffixes to...



details:   https://anonhg.NetBSD.org/src/rev/0d66547aafd8
branches:  trunk
changeset: 518466:0d66547aafd8
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Nov 30 18:50:09 2001 +0000

description:
Add support for specifying extra kernel name suffixes to search for
when building the kernel sets and placing gzip'd kernels in binary/kernels.
For example, if KERNEL_SUFFIXES were set to "ecoff srec", then the kernel
set would include:

        netbsd
        netbsd.ecoff (only if it exists in the kernel compile directory)
        netbsd.srec (only if it exists in the kernel compile directory)

This is useful for packaging kernel sets for platforms which have
extra special requirements for loading the kernel.

diffstat:

 etc/Makefile |  37 +++++++++++++++++++++++++++++++------
 1 files changed, 31 insertions(+), 6 deletions(-)

diffs (61 lines):

diff -r 56b6ba8b380c -r 0d66547aafd8 etc/Makefile
--- a/etc/Makefile      Fri Nov 30 18:25:58 2001 +0000
+++ b/etc/Makefile      Fri Nov 30 18:50:09 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.196 2001/11/29 22:45:53 thorpej Exp $
+#      $NetBSD: Makefile,v 1.197 2001/11/30 18:50:09 thorpej Exp $
 #      from: @(#)Makefile      8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -356,6 +356,12 @@
 #                              that are built for inclusion only in
 #                              installation disk/CD-ROM/tape images.
 #
+# A port may also specify KERNEL_SUFFIXES, which is an optional list
+# of filename suffixes for kernels to include in the kernel sets and
+# in the binary/kernels area of the release package (e.g. "netbsd" vs.
+# "netbsd.ecoff" and "netbsd.srec").  It is not an error if kernels
+# with these suffixes do not exist in the kernel build directory.
+#
 GETKERNELAWK=  awk '/^config/ {print $$2; found=1} \
                END{ if (found == 0) print "netbsd"; }'
 #
@@ -371,14 +377,33 @@
        cd ${KERNOBJDIR}/${configfile:C/.*\///} && ${MAKE} depend && ${MAKE} ${_J}
 .endfor # build kernels
 .for configfile in ${KERNEL_SETS}
-       cd ${KERNOBJDIR}/${configfile:C/.*\///} && \
-               tar cf - `${GETKERNELAWK} ${KERNCONFDIR}/${configfile}` | \
+       kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile}`; \
+       kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
+       cd $${kerndir} && \
+               tarlist=`for kernel in $${kernlist}; do \
+                       echo "$${kernel}"; \
+                       for s in ${KERNEL_SUFFIXES}; do \
+                               if [ -f $${kernel}.$${s} ]; then \
+                                       echo "$${kernel}.$${s}"; \
+                               fi; \
+                       done; \
+               done`; \
+               tar cf - $${tarlist} | \
                gzip -c -9 > ${RELEASEDIR}/binary/sets/kern-${configfile}.tgz
 .endfor # make kernel sets
 .for configfile in ${KERNEL_SETS} ${EXTRA_KERNELS}
-       cd ${KERNOBJDIR}/${configfile:C/.*\///} &&      \
-               for kernel in `${GETKERNELAWK} \
-                       ${KERNCONFDIR}/${configfile:C/.*\///}` ; do   \
+       kernlist=`${GETKERNELAWK} ${KERNCONFDIR}/${configfile:C/.*\///}`; \
+       kerndir=${KERNOBJDIR}/${configfile:C/.*\///}; \
+       cd $${kerndir} &&       \
+               gziplist=`for kernel in $${kernlist}; do \
+                       echo "$${kernel}"; \
+                       for s in ${KERNEL_SUFFIXES}; do \
+                               if [ -f $${kernel}.$${s} ]; then \
+                                       echo "$${kernel}.$${s}"; \
+                               fi; \
+                       done; \
+               done`; \
+               for kernel in $${gziplist} ; do \
                gzip -c -9 < $${kernel} > \
                        ${RELEASEDIR}/binary/kernel/$${kernel}-${configfile:C/.*\///}.gz ; done
 .endfor # place KERNEL_SETS kernels + EXTRA_KERNELS in binary/kernel/...



Home | Main Index | Thread Index | Old Index