Re: kernel config

dholland@husc.harvard.edu
Sat, 22 Jul 1995 18:00:31 -0400 (EDT)


> :> And what format shall this take? It needs to be parsable from
> :> sh using only expr, sed, and awk.
>
> Only if not a single kernel hacker understands lex/yacc well enough to
> write a parser to do the necessary Makefile/header configuration.
> Seriously, why would it need to be parsable from sh at all? Can
> include a flex/bison grammar (pre flexed/bisoned even, though I doubt
> this would at all be necessary, I would guess that flex and bison are
> much more ubiquitous on machines with development tools installed than
> perl would be.) with the rest of the kernel sources, that would get
> built with make config. The sound driver already has a configure
> program written in C.

I'd be happy to write it, and make the syntax as complicated as anyone
wants, but I refuse to do it using lex and yacc.

Since the only free parser generators around are basically yacc, and I
doubt a non-free solution would be welcomed in the kernel, I'll have
to stay out of it except for suggestions and kibitzing.

That said, how about something along the lines of

config file ::= section...

section
::= identifier, doc-string, flag..., '{', config option... '}'

flag
::= "require", identifier
::= "provide", identifier
::= "cflags", quoted string
::= "module"

config option
::= typename, identifier, doc-string, flag..., ';'

typename
::= "bool"
::= "int"
::= "int", constant, "..", constant

doc-string ::= quoted string

where identifier, constant, and quoted string are what you'd expect.

If anyone tries to build this, note that identifiers can't begin with
a digit or you'll get a conflict.

This lets you, for instance, specify that SCSI tape support requires
SCSI support, in the following way:

scsi-adapters "Support for SCSI host adapters (disk/device
controllers). This is required if you want support for other SCSI
devices (hard disks, tapes, cdroms, scanners)."
{
aha1542 "Support for Adaptec 1542 SCSI cards."
provide scsi cflags "-DCONFIG_AHA_1542";
aic7xxx "Support for Adaptec 274x/284x/294x SCSI cards."
provide scsi cflags "-DCONFIG_AIC7XXX";
ABCDE "Support for the A.B.C.D.E. Super SCSI 1998 Edition."
provide scsi cflags "-DCONFIG_ABCDE";
}

scsi-devices "Support for SCSI devices (hard drives, tapes, cdroms,
scanners, etc.) Support for SCSI host adapters is required."
{
tapes "Support SCSI tape drives."
require scsi provide tape cflags "-DCONFIG_SCSI_TAPE";
disks "Support SCSI hard drives."
require scsi provide disk cflags "-DCONFIG_SCSI_DISK";
cdrom "Support SCSI cdroms."
require scsi provide cdrom cflags "-DCONFIG_SCSI_CDROM";
}

etc.

The idea is that you can select the adapters section all you like, but
unless you actually choose a controller, it won't let you turn on any
of the scsi devices.

Hmm. Thinking about it there ought to be an option "suggest". For
instance, since iso9660 support isn't useful without a cdrom, you'd
have "suggest cdrom", and you'd have the cdroms "suggest iso9660".
Presumably the config utility would do something intelligent with
"suggest" operations that were references to things the user hadn't
gotten to yet.

> :> Maybe. I'm not convinced the configuration is that badly
> :> broken. Proper documentation of the sources is more important,
> :> in my opinion. ;-)
>
> Proper documentation would be nice. Man pages for kernel internal
> functions would be really nice. Probably wouldn't take too long to
> have most of the major ones if someone were to volunteer to collect
> the kernel-man pages and ask people to write just one.

There's already somebody who maintains the man-pages package; I'm sure
if people sent him section 9 man pages he'd be willing to include
them. (I don't remember who it is though.)

> I'm too busy lately myself to collect them, but I'd be willing to
> write a page or two.

Same here.

> The current configuration doesn't bother me too much. I hate it
> when I have to start all over or go manually edit the files when I
> flub a single one up though. So I think some improvement could be
> achieved in that area, just don't think it is the most important
> thing happening with linux right now.

Right.

> NSA: plutonium Mossad NSA Panama Croatian Qaddafi domestic disruption
> munitions Noriega jihad Honduras NORAD genetic DES [Hello to all my
> fans in domestic surveillance]

That's not good enough - I'm sure they have better text retrieval
systems than that. :-p

-- 
   - David A. Holland             | Peer pressure (n.): The force from the
     dholland@husc.harvard.edu    | eyeballs of everybody watching you.