Skip to content

Commit f52fd5b

Browse files
dhowellsDavid Woodhouse
authored andcommitted
NOMMU: Fix the RomFS Kconfig to ensure at least one backing store is selected
Fix the configuration of the RomFS to make sure that at least one backing store method is always selected. This is done by rendering it down to a choice item that selects between Block, MTD and both. This also works correctly in the case that CONFIG_MTD=m: MTD cannot be selected as a backing store unless CONFIG_ROMFS_FS is also 'm'. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent da4458b commit f52fd5b

1 file changed

Lines changed: 28 additions & 6 deletions

File tree

‎fs/romfs/Kconfig‎

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
config ROMFS_FS
22
tristate "ROM file system support"
3-
depends on BLOCK
3+
depends on BLOCK || MTD
44
---help---
55
This is a very small read-only file system mainly intended for
66
initial ram disks of installation disks, but it could be used for
@@ -15,19 +15,28 @@ config ROMFS_FS
1515
If you don't know whether you need it, then you don't need it:
1616
answer N.
1717

18-
config ROMFS_ON_BLOCK
19-
bool "Block device-backed ROM file system support" if (ROMFS_ON_MTD && EMBEDDED)
20-
depends on ROMFS_FS && BLOCK
18+
#
19+
# Select the backing stores to be supported
20+
#
21+
choice
22+
prompt "RomFS backing stores"
23+
depends on ROMFS_FS
24+
default ROMFS_BACKED_BY_BLOCK
25+
help
26+
Select the backing stores to be supported.
27+
28+
config ROMFS_BACKED_BY_BLOCK
29+
bool "Block device-backed ROM file system support"
30+
depends on BLOCK
2131
help
2232
This permits ROMFS to use block devices buffered through the page
2333
cache as the medium from which to retrieve data. It does not allow
2434
direct mapping of the medium.
2535

2636
If unsure, answer Y.
2737

28-
config ROMFS_ON_MTD
38+
config ROMFS_BACKED_BY_MTD
2939
bool "MTD-backed ROM file system support"
30-
depends on ROMFS_FS
3140
depends on MTD=y || (ROMFS_FS=m && MTD)
3241
help
3342
This permits ROMFS to use MTD based devices directly, without the
@@ -38,3 +47,16 @@ config ROMFS_ON_MTD
3847

3948
If unsure, answer Y.
4049

50+
config ROMFS_BACKED_BY_BOTH
51+
bool "Both the above"
52+
depends on BLOCK && (MTD=y || (ROMFS_FS=m && MTD))
53+
endchoice
54+
55+
56+
config ROMFS_ON_BLOCK
57+
bool
58+
default y if ROMFS_BACKED_BY_BLOCK || ROMFS_BACKED_BY_BOTH
59+
60+
config ROMFS_ON_MTD
61+
bool
62+
default y if ROMFS_BACKED_BY_MTD || ROMFS_BACKED_BY_BOTH

0 commit comments

Comments
 (0)