Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Howells and committed by
David Woodhouse
f52fd5b7 da4458bd

+28 -6
+28 -6
fs/romfs/Kconfig
··· 1 1 config ROMFS_FS 2 2 tristate "ROM file system support" 3 - depends on BLOCK 3 + depends on BLOCK || MTD 4 4 ---help--- 5 5 This is a very small read-only file system mainly intended for 6 6 initial ram disks of installation disks, but it could be used for ··· 15 15 If you don't know whether you need it, then you don't need it: 16 16 answer N. 17 17 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 21 31 help 22 32 This permits ROMFS to use block devices buffered through the page 23 33 cache as the medium from which to retrieve data. It does not allow ··· 35 25 36 26 If unsure, answer Y. 37 27 38 - config ROMFS_ON_MTD 28 + config ROMFS_BACKED_BY_MTD 39 29 bool "MTD-backed ROM file system support" 40 - depends on ROMFS_FS 41 30 depends on MTD=y || (ROMFS_FS=m && MTD) 42 31 help 43 32 This permits ROMFS to use MTD based devices directly, without the ··· 47 38 48 39 If unsure, answer Y. 49 40 41 + config ROMFS_BACKED_BY_BOTH 42 + bool "Both the above" 43 + depends on BLOCK && (MTD=y || (ROMFS_FS=m && MTD)) 44 + endchoice 45 + 46 + 47 + config ROMFS_ON_BLOCK 48 + bool 49 + default y if ROMFS_BACKED_BY_BLOCK || ROMFS_BACKED_BY_BOTH 50 + 51 + config ROMFS_ON_MTD 52 + bool 53 + default y if ROMFS_BACKED_BY_MTD || ROMFS_BACKED_BY_BOTH