[-mm patch] fix the ROMFS_* dependencies

From: Adrian Bunk
Date: Sun Mar 04 2007 - 20:51:18 EST


On Sun, Mar 04, 2007 at 03:35:14PM +0000, David Howells wrote:
> Adrian Bunk <bunk@xxxxxxxxx> wrote:
>
> > Is
> >
> > CONFIG_BLOCK=y
> > CONFIG_ROMFS_FS=y
> > CONFIG_ROMFS_ON_BLOCK=n
> > CONFIG_ROMFS_ON_MTD=y
> >
> > a reasonable configuration that should be supported, or can we turn
> > CONFIG_ROMFS_ON_BLOCK always on if CONFIG_BLOCK=y?
>
> Hmmm... I don't really know the answer to that, apart from it depends. On a
> non-embedded device, it's entirely reasonable, I think, to turn
> CONFIG_ROMFS_ON_BLOCK on if CONFIG_BLOCK is on, no questions asked. However,
> on an embedded device you might want the extra option.

OK, what about the patch below?

> David

cu
Adrian


<-- snip -->


This patch:
- adds the missing dependency of ROMFS_FS on BLOCK || MTD
- disallows the illegal ROMFS_FS=y, MTD=m, ROMFS_ON_MTD=y
- ensures that at least one of ROMFS_ON_BLOCK and ROMFS_ON_MTD is always
enabled:
- automatically enable ROMFS_ON_MTD if BLOCK=n
- automatically enable ROMFS_ON_BLOCK if ROMFS_ON_MTD=n
- if EMBEDDED=n, ROMFS_ON_BLOCK is always enabled
- the "(which may have been disabled)" that could now confuse
users has therefore been removed from the help text

Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>

---

fs/Kconfig | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

--- linux-2.6.21-rc2-mm1/fs/Kconfig.old 2007-03-04 23:04:41.000000000 +0100
+++ linux-2.6.21-rc2-mm1/fs/Kconfig 2007-03-04 23:24:27.000000000 +0100
@@ -484,6 +484,7 @@

config ROMFS_FS
tristate "ROM file system support"
+ depends on BLOCK || MTD
---help---
This is a very small read-only file system mainly intended for
initial ram disks of installation disks, but it could be used for
@@ -499,8 +500,9 @@
answer N.

config ROMFS_ON_BLOCK
- bool "Block device-backed ROM file system support"
+ bool "Block device-backed ROM file system support" if (ROMFS_ON_MTD && EMBEDDED)
depends on ROMFS_FS && BLOCK
+ default y
help
This permits ROMFS to use block devices buffered through the page
cache as the medium from which to retrieve data. It does not allow
@@ -509,14 +511,15 @@
If unsure, answer Y.

config ROMFS_ON_MTD
- bool "MTD-backed ROM file system support"
- depends on ROMFS_FS && MTD
+ bool "MTD-backed ROM file system support" if BLOCK
+ depends on ROMFS_FS
+ depends on MTD=y || (ROMFS_FS=m && MTD)
+ default y
help
This permits ROMFS to use MTD based devices directly, without the
- intercession of the block layer (which may have been disabled). It
- also allows direct mapping of MTD devices through romfs files under
- NOMMU conditions if the underlying device is directly addressable by
- the CPU.
+ intercession of the block layer. It also allows direct mapping of
+ MTD devices through romfs files under NOMMU conditions if the
+ underlying device is directly addressable by the CPU.

If unsure, answer Y.


-
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/