From 185ffd913f1ec7b4e77918c6942a9a1a750d89eb Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Sun, 30 Jul 2023 16:47:59 +0800 Subject: [PATCH] kernel-config: Allow specifying non-module style forcing for tristate instead of relying on unsound heuristic. --- kernel-config/kernel-config.py | 13 +++---------- .../filesystems/uefi-bootloaders/grub-setup.toml | 6 +++--- kernel-config/x/installing/libevdev.toml | 3 ++- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/kernel-config/kernel-config.py b/kernel-config/kernel-config.py index e018817b9d..fe3572cb04 100755 --- a/kernel-config/kernel-config.py +++ b/kernel-config/kernel-config.py @@ -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: - bracket = '{}' if forced else '<>' - - if klass == 'bool': + if klass == 'tristate' and forced != '*' : + bracket = '{}' if forced else '<>' + 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 '' diff --git a/kernel-config/postlfs/filesystems/uefi-bootloaders/grub-setup.toml b/kernel-config/postlfs/filesystems/uefi-bootloaders/grub-setup.toml index fab2d56ef5..fe17cc4fa1 100644 --- a/kernel-config/postlfs/filesystems/uefi-bootloaders/grub-setup.toml +++ b/kernel-config/postlfs/filesystems/uefi-bootloaders/grub-setup.toml @@ -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" diff --git a/kernel-config/x/installing/libevdev.toml b/kernel-config/x/installing/libevdev.toml index 61b15de3a2..88195a716f 100644 --- a/kernel-config/x/installing/libevdev.toml +++ b/kernel-config/x/installing/libevdev.toml @@ -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"