Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Oct 2003 02:00:30 -0400 (EDT)
From:      "Adam C. Migus" <adam@migus.org>
To:        "Bruce Evans" <bde@zeta.org.au>
Cc:        arch@freebsd.org
Subject:   Re: sys/conf/DEFAULT[S]
Message-ID:  <49955.192.168.4.2.1065074430.squirrel@mail.migus.org>
In-Reply-To: <20030927080420.N18558@gamplex.bde.org>
References:  <XFMail.20030924170342.jhb@FreeBSD.org>    <20030925092319.H5418@gamplex.bde.org><49939.204.254.155.35.1064593320.squirrel@mail.migus.org> <20030927080420.N18558@gamplex.bde.org>

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

[-- Attachment #1 --]
Bruce Evans said:
> On Fri, 26 Sep 2003, Adam C. Migus wrote:
>
>> Bruce Evans said:
>> > Do we actually gave the abiltity to include other config files?
>> It
>> > was
>> > quite broken last time I tried to use it for anything more
>> > complicated
>> > than the example in "SMP".
>>
>> I use the include feature quite a bit, nested in some cases.  It
>> works great for me for creating combinations of debug, diskless,
>> mac
>> and smp kernels for example.
>
> My example written last Februry still shows that even simple
> includes
> don't work:
>
> %%%
> Script started on Tue Feb 25 14:16:01 2003
> ttyp0:bde@besplex:/usr/src/sys/i386/conf> cat FOOBAR
> include FOO
> ttyp0:bde@besplex:/usr/src/sys/i386/conf> cat FOO
> machine		i386
> cpu		I486_CPU
> ident		FOO
> ttyp0:bde@besplex:/usr/src/sys/i386/conf> config FOOBAR
> config: FOO:1: syntax error
> ttyp0:bde@besplex:/usr/src/sys/i386/conf> config FOO
> Kernel build directory is ../compile/FOO
> Don't forget to do a ``make depend''
> ttyp0:bde@besplex:/usr/src/sys/i386/conf> exit
>
> Script done on Tue Feb 25 14:16:23 2003
> %%%
>
> Similarly with FOOBAR's contents identical with SMP's contents
> except
> for including FOO instead of GENERIC.  So the bug must be related to
> the file being included ... adding an empty or comment line to the
> beginning of FOO works around it.  I guess there is an off-by-1 byte
> or line error switching the input stream.
>
> Bruce
>

This patch works for me, please let me know if there's any problems
with it or you'd like a PR.

-- 
Adam - (http://people.migus.org/~amigus/)
Migus Dot Org - (http://www.migus.org/)
[-- Attachment #2 --]
==== //depot/user/amigus/freebsd-amigus/src/usr.sbin/config/config.y#1 - /src/p4/user/amigus/perforce.freebsd.org/freebsd-amigus/usr.sbin/config/config.y ====
@@ -118,6 +118,8 @@
 		|
 	Config_spec SEMICOLON
 		|
+	Include
+		|
 	SEMICOLON
 		|
 	error SEMICOLON
@@ -164,9 +166,7 @@
 	      = {
 		      hints = $2;
 		      hintmode = 1;
-	        } |
-	INCLUDE ID
-	      = { include($2, 0); };
+	        };
 
 System_spec:
 	CONFIG System_id System_parameter_list
@@ -265,6 +265,11 @@
 		rmdev($2);
 		} ;
 
+Include:
+	INCLUDE ID
+	      = { include($2, 0); };
+
+
 %%
 
 void

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