linux-megous: remove some unneeded options (i.e. PCI)

This commit is contained in:
Colin 2024-05-22 20:25:17 +00:00
parent 5952c275a0
commit 0a1b1ae52f

View File

@ -19,9 +19,9 @@
, withModemPower ? true
# WARNING: NOT ALL COMBINATIONS OF THESE FLAGS YIELDS A BOOTABLE SYSTEM.
# even the combinations you'd expect to work, often don't.
, withMegiPinephoneConfig ? false #< start with megi's pinephone_defconfig ?
, withNixpkgsConfig ? true #< apply default config options from <repo:nixos/nixpkgs:pkgs/os-specific/linux/kernel/common-config.nix> ?
, withFullConfig ? true #< try to build every unspecified option, as a module?
, withMegiPinephoneConfig ? false #< if true, then start with megi's pinephone_defconfig
, withNixpkgsConfig ? true #< if true, then apply default config options from <repo:nixos/nixpkgs:pkgs/os-specific/linux/kernel/common-config.nix>
, withFullConfig ? true #< if true, then try to build every unspecified option
# something inside nixpkgs calls `override` on the kernel and passes in extra arguments
, ...
}@args:
@ -165,7 +165,7 @@ let
RAID6_PQ_BENCHMARK = no;
};
### OPTIONS ONLY NEEDED IF `withFullConfig`/`autoModules` IS TRUE:
### OPTIONS ONLY NEEDED IF `withFullConfig` (i.e. `autoModules`) IS TRUE:
fullConfigFixes = with lib.kernel; {
### BUILD FIXES, NOT SPECIFIC TO MY PREFERENCES
#
@ -185,7 +185,7 @@ let
# options needed if `withNixpkgsConfig` is enabled... even if `withFullConfig` is as well
nixpkgsFixes = with lib.kernel; {
SUN8I_DE2_CCU = lib.mkForce yes; #< nixos' default `Y` confuses its own config parser
SUN8I_DE2_CCU = lib.mkForce yes; #< nixpkgs' option parser gets confused on this one, somehow
#v XXX: required for e.g. SECURITY_LANDLOCK (specified by upstream nixpkgs) to take effect if `autoModules = false`
#v seems that upstream linux (the defconfigs?), it defaults to Yes for:
# - arch/x86/configs/x86_64_defconfig
@ -196,102 +196,61 @@ let
# SECURITY_SELINUX_BOOTPARAM = yes;
# PCI needed because of the dependency on module `ahci`
# like SECURITY, it's present for the default x86, arm64 defconfigs, but not the flavored ones.
PCI = yes;
# PCI = yes;
};
### OPTIONS ONLY NEEDED IF `withFullConfig`/`autoModules` IS FALSE:
nixpkgsRequirements = with lib.kernel; {
# necessary for nixpkgs' initrd to build.
# see <repo:nixos/nixpkgs:nixos/modules/system/boot/kernel.nix> for a list of the default modules it includes in the initrd
ATA = module;
PCI = yes;
SATA_AHCI = module;
SATA_NV = module;
SATA_VIA = module;
SATA_SIS = module;
SATA_ULI = module;
ATA_PIIX = module;
PATA_MARVELL = module;
BLK_DEV_NVME = module;
BLK_DEV_SD = module;
BLK_DEV_SR = module;
MMC_BLOCK = module;
USB_UHCI_HCD = module;
USB_EHCI_HCD = module;
USB_EHCI_PCI = module;
USB_OHCI_HCD = module;
USB_OHCI_HCD_PCI = module; #< yep, HCD_PCI -- not just PCI
USB_XHCI_HCD = module;
USB_XHCI_PCI = module;
HID_APPLE = module;
HID_CHERRY = module;
HID_CORSAIR = module;
HID_LENOVO = module;
HID_LOGITECH = module;
HID_LOGITECH_DJ = module;
HID_LOGITECH_HIDPP = module;
HID_MICROSOFT = module;
HID_ROCCAT = module;
# for iio, see: <nixos/modules/hardware/sensor/iio.nix>
HID_SENSOR_HUB = module;
# see: <nixos/modules/system/etc/etc-activation.nix>
EROFS_FS = module;
# for unl0kr, see: <nixos/tests/systemd-initrd-luks-unl0kr.nix>
DRM_BOCHS = module;
### RELEVANT CONFIGS INHERITED FROM NIXOS DEFAULTS (OR ABOVE ADDITIONS):
#
# CONFIG_BT=m
# CONFIG_BT_BREDR=y
# CONFIG_BT_RFCOMM=m
# CONFIG_BT_RFCOMM_TTY=y
# CONFIG_BT_BNEP=m
# CONFIG_BT_HIDP=m
# CONFIG_BT_RTL=m
# CONFIG_BT_HCIBTUSB=m
# CONFIG_BT_HCIBTUSB_BCM=y
# CONFIG_BT_HCIBTUSB_RTL=y
# CONFIG_BT_HCIUART=m
# CONFIG_BT_HCIUART_SERDEV=y
# CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_LL=y
# CONFIG_DRM_LIMA=m
# CONFIG_DRM_BRIDGE=y
# CONFIG_DRM_PANEL_BRIDGE=y
# CONFIG_DRM_PANFROST=m
# CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
# CONFIG_DRM_PANEL_SIMPLE=m
# CONFIG_DRM_PANEL_SITRONIX_ST7703=m
# CONFIG_DRM_SUN4I=m
# CONFIG_DRM_SUN6I_DSI=m
# CONFIG_DRM_SUN8I_DW_HDMI=m
# CONFIG_DRM_SUN8I_MIXER=m
# CONFIG_DRM_SUN8I_TCON_TOP=m
# CONFIG_FB_CORE=y
# CONFIG_FB_DEVICE=y
# CONFIG_FB_NOTIFY=y
# CONFIG_FB_MODE_HELPERS=y
# CONFIG_RTL_CARDS=m
# CONFIG_RTLWIFI=m
# CONFIG_RTLWIFI_PCI=m
# CONFIG_RTLWIFI_USB=m
# CONFIG_RTLWIFI_DEBUG=y
# CONFIG_RTL8723_COMMON=m
# CONFIG_RTLBTCOEXIST=m
# CONFIG_RTL8XXXU=m
# CONFIG_RTLLIB=m
# consider adding (from mobile-nixos):
# maybe: CONFIG_BT_HCIUART_3WIRE=y
# maybe: CONFIG_BT_HCIUART_RTL=y
# maybe: CONFIG_RTL8XXXU_UNTESTED=y
# consider adding (from manjaro):
# CONFIG_BT_6LOWPAN=m (not listed as option in nixos kernel)
# these are referenced in the rtl8723 source, but not known to config (and not in mobile-nixos config
# maybe: CONFIG_RTL_ODM_WLAN_DRIVER
# maybe: CONFIG_RTL_TRIBAND_SUPPORT
# maybe: CONFIG_SDIO_HCI
# maybe: CONFIG_USB_HCI
};
### RELEVANT CONFIGS INHERITED FROM NIXOS DEFAULTS (OR ABOVE ADDITIONS):
#
# CONFIG_BT=m
# CONFIG_BT_BREDR=y
# CONFIG_BT_RFCOMM=m
# CONFIG_BT_RFCOMM_TTY=y
# CONFIG_BT_BNEP=m
# CONFIG_BT_HIDP=m
# CONFIG_BT_RTL=m
# CONFIG_BT_HCIBTUSB=m
# CONFIG_BT_HCIBTUSB_BCM=y
# CONFIG_BT_HCIBTUSB_RTL=y
# CONFIG_BT_HCIUART=m
# CONFIG_BT_HCIUART_SERDEV=y
# CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_LL=y
# CONFIG_DRM_LIMA=m
# CONFIG_DRM_BRIDGE=y
# CONFIG_DRM_PANEL_BRIDGE=y
# CONFIG_DRM_PANFROST=m
# CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
# CONFIG_DRM_PANEL_SIMPLE=m
# CONFIG_DRM_PANEL_SITRONIX_ST7703=m
# CONFIG_DRM_SUN4I=m
# CONFIG_DRM_SUN6I_DSI=m
# CONFIG_DRM_SUN8I_DW_HDMI=m
# CONFIG_DRM_SUN8I_MIXER=m
# CONFIG_DRM_SUN8I_TCON_TOP=m
# CONFIG_FB_CORE=y
# CONFIG_FB_DEVICE=y
# CONFIG_FB_NOTIFY=y
# CONFIG_FB_MODE_HELPERS=y
# CONFIG_RTL_CARDS=m
# CONFIG_RTLWIFI=m
# CONFIG_RTLWIFI_PCI=m
# CONFIG_RTLWIFI_USB=m
# CONFIG_RTLWIFI_DEBUG=y
# CONFIG_RTL8723_COMMON=m
# CONFIG_RTLBTCOEXIST=m
# CONFIG_RTL8XXXU=m
# CONFIG_RTLLIB=m
# consider adding (from mobile-nixos):
# maybe: CONFIG_BT_HCIUART_3WIRE=y
# maybe: CONFIG_BT_HCIUART_RTL=y
# maybe: CONFIG_RTL8XXXU_UNTESTED=y
# consider adding (from manjaro):
# CONFIG_BT_6LOWPAN=m (not listed as option in nixos kernel)
# these are referenced in the rtl8723 source, but not known to config (and not in mobile-nixos config
# maybe: CONFIG_RTL_ODM_WLAN_DRIVER
# maybe: CONFIG_RTL_TRIBAND_SUPPORT
# maybe: CONFIG_SDIO_HCI
# maybe: CONFIG_USB_HCI
# `pkgs.kernelPatches` is a set of common patches
# while `kernelPatches` callarg is a list.
@ -417,7 +376,6 @@ in (buildLinux {
structuredExtraConfig =
lib.optionalAttrs withMegiPinephoneConfig megiFixes
// lib.optionalAttrs (!withFullConfig) nixpkgsRequirements
// lib.optionalAttrs withNixpkgsConfig nixpkgsFixes
// lib.optionalAttrs withFullConfig fullConfigFixes
// qualityOfLife
@ -428,5 +386,8 @@ in (buildLinux {
enableCommonConfig = withNixpkgsConfig;
autoModules = withFullConfig;
preferBuiltin = withFullConfig; #< TODO: set this to false! it's the more extreme version of autoModules, which answers `Y` to everything which would default to `Y` (wait, that sounds ok, actually?)
# for every module which was autoselected, if it supports being compiled into the kernel (i.e. has a `y` option), then do that instead of building it as a module.
# so, this option has no effect when `autoModules` is false.
# the benefit i think is mostly that such modules get automatically included in the initrd?
preferBuiltin = withFullConfig;
})