kernel-config: Allow specifying non-module style forcing for tristate

instead of relying on unsound heuristic.
This commit is contained in:
Xi Ruoyao 2023-07-30 16:47:59 +08:00
parent 4955b595ba
commit 185ffd913f
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3
3 changed files with 8 additions and 14 deletions

View File

@ -103,18 +103,11 @@ def parse_config(buf):
if c not in 'M* ' or (c == 'M' and klass != 'tristate'):
raise Exception('unknown setting %s for %s' % (c, key))
bracket = None
if klass == 'tristate':
if forced and 'M' not in val:
# render this "as-is" a forced bool
klass = 'bool'
else:
if klass == 'tristate' and forced != '*' :
bracket = '{}' if forced else '<>'
if klass == 'bool':
else:
bracket = '--' if forced else '[]'
if not bracket:
raise Exception('should not reach here')
val = bracket[0] + '/'.join(val) + bracket[1]
arrow = ' --->' if is_menu else ''

View File

@ -5,12 +5,12 @@ SYSFB_SIMPLEFB="*"
DRM="*"
DRM_FBDEV_EMULATION="*"
DRM_SIMPLEDRM="*"
# forced by !EXPERT
FB="*"
# forced by VT && TTY, with !EXPERT VT and TTY are always set
FRAMEBUFFER_CONSOLE = { value = "*", forced = true }
VFAT_FS="*M"
EFIVAR_FS="*M"
# forced by ACPI, it's highly unlikely people will disable ACPI...
NLS = { value = "*", forced = true }
# forced by both ACPI and PCI on a typical x86 desktop/server system
NLS = { value = "*", forced = "*" }
NLS_CODEPAGE_437="*M"
NLS_ISO8859_1="*M"

View File

@ -1,2 +1,3 @@
INPUT = { value = "*", forced = true }
# forced by VT && TTY, with !EXPERT VT and TTY are always set
INPUT = { value = "*", forced = "*" }
INPUT_EVDEV="*M"