Source-Changes-HG archive

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

[src/trunk]: src/etc OK, adjust the kernel finder one more time to handle the...



details:   https://anonhg.NetBSD.org/src/rev/bce096c2e6de
branches:  trunk
changeset: 471750:bce096c2e6de
user:      fair <fair%NetBSD.org@localhost>
date:      Sat Apr 10 04:41:52 1999 +0000

description:
OK, adjust the kernel finder one more time to handle the case of a config
file that just does "include" GENERIC, and therefore has no "config" line.
It's simplest to assume that "netbsd" will be the result in that case.
Rather than duplicate config(8)'s parser in awk (or something), we should
adjust config to parse the config file and spit out the kernel names, and
then use that to replace this awk script thing.

diffstat:

 etc/Makefile |  14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 9b820624e631 -r bce096c2e6de etc/Makefile
--- a/etc/Makefile      Sat Apr 10 03:59:58 1999 +0000
+++ b/etc/Makefile      Sat Apr 10 04:41:52 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.115 1999/04/08 08:24:44 fair Exp $
+#      $NetBSD: Makefile,v 1.116 1999/04/10 04:41:52 fair Exp $
 #      from: @(#)Makefile      8.7 (Berkeley) 5/25/95
 
 # Environment variables without default values:
@@ -265,7 +265,12 @@
 # system can create more than one kernel from a single configuration
 # we figure out how many there are, what they're named, and move them
 # to binary/kernel/${KERNEL}.${CONFIGFILE}.gz - most often KERNEL will
-# simply be "netbsd".
+# simply be "netbsd". If we don't find the "config" line, assume the
+# kernel will be "netbsd" (some config files are simple additions on
+# GENERIC, and just include it).
+#
+GETKERNELAWK=  awk '/^config/ {print $$2; found=1} \
+               END{ if (found == 0) print "netbsd"; }'
 #
 snap_kern:
        cd ${KERNCONFDIR} && config \
@@ -275,8 +280,7 @@
 .endif
        cd ${KERNOBJDIR}/GENERIC && ${MAKE} depend && ${MAKE} ${_J}
        cd ${KERNOBJDIR}/GENERIC &&     \
-               tar cf - `awk '$$1=="config" {print $$2}'  \
-                       ${KERNCONFDIR}/GENERIC` |\
+               tar cf - `${GETKERNELAWK} ${KERNCONFDIR}/GENERIC` |\
                gzip -c -9 > ${RELEASEDIR}/binary/sets/kern.tgz
 .for configfile in ${EXTRA_KERNELS}
        cd ${KERNCONFDIR} && config \
@@ -286,7 +290,7 @@
 .endif
        cd ${KERNOBJDIR}/${configfile} && ${MAKE} depend && ${MAKE} ${_J}
        cd ${KERNOBJDIR}/${configfile} &&       \
-               for kernel in `awk '$$1=="config" {print $$2}' \
+               for kernel in `${GETKERNELAWK} \
                        ${KERNCONFDIR}/${configfile}` ; {   \
                gzip -c -9 < $${kernel} > \
                        ${RELEASEDIR}/binary/kernel/$${kernel}.${configfile}.gz ; }



Home | Main Index | Thread Index | Old Index