Re: tristate and bool not enogh for Kconfig anymore

From: Henrik Carlqvist
Date: Sun Oct 21 2007 - 06:24:19 EST


On Sun, 21 Oct 2007 00:47:38 -0400
Valdis.Kletnieks@xxxxxx wrote:

> On Sat, 20 Oct 2007 21:17:00 +0200, Sam Ravnborg said:
> > I assume
> > depends on MODULES
> >
> > should do the trick.
>
> Umm... I think that will work backwards, and give you CONFIG_FOO=y
> if.f the kernel *supports* modules. What he needs is to be able to say
> CONFIG_FOO=n or CONFIG_FOO=m, but *ban* CONFIG_FOO=y.

Yes, thats right, MODULES does not ban y as would be needed. As an example
I tried to do a quick test, I edited drivers/scsi/qla2xxx/Kconfig to look
like this:

-8<-------------------------------------------------------
config SCSI_QLA_FC
tristate "QLogic QLA2XXX Fibre Channel Support"
depends on PCI && SCSI && MODULES
select SCSI_FC_ATTRS
select FW_LOADER
---help---
This qla2xxx driver supports all QLogic Fibre Channel
PCI and PCIe host adapters.

By default, firmware for the ISP parts will be loaded
via the Firmware Loader interface.

ISP Firmware Filename
---------- -----------------
21xx ql2100_fw.bin
22xx ql2200_fw.bin
2300, 2312, 6312 ql2300_fw.bin
2322, 6322 ql2322_fw.bin
24xx ql2400_fw.bin

Upon request, the driver caches the firmware image until
the driver is unloaded.

Firmware images can be retrieved from:

ftp://ftp.qlogic.com/outgoing/linux/firmware/
-8<-------------------------------------------------------

The only thing that I did change was that I added "&& MODULES" to the
depends line. However, this only causes the driver to be possible to build
when you build a kernel with module support. Still tristate allows you to
build it both as a module and as a driver built into the kernel. However,
when built into the kernel the driver is unusable as it needs its firmware
which it can't reach.

Is there any other way to specify that a functionality can only be built
as a module, not built into the kernel?

In my firsta attempts to post about these tests my post ended up not on
the mailing list but as a reply to Sam Ravnborg only, apologies for
that...

Best regards Henrik
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/