From 0dc351b79b648c9444257766d345135a910f2b0b Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Fri, 8 Dec 2023 17:35:08 +0400 Subject: [PATCH] feat: split more device drivers into modules I went over all options which are `=y` in Talos, but `=m` in e.g. Ubuntu, and cross-referenced with lkddb to make sure each option is a driver loadable by PCI or USB IDs. The goal is to have smaller kernel, less stuff loaded by default, and shorter boot times. The final diff on modules: ``` 22a23,64 > ./lib/modules/6.1.65-talos/kernel/drivers/ata > ./lib/modules/6.1.65-talos/kernel/drivers/ata/ahci.ko > ./lib/modules/6.1.65-talos/kernel/drivers/ata/libahci.ko > ./lib/modules/6.1.65-talos/kernel/drivers/ata/pata_amd.ko > ./lib/modules/6.1.65-talos/kernel/drivers/ata/pata_marvell.ko > ./lib/modules/6.1.65-talos/kernel/drivers/ata/pata_oldpiix.ko > ./lib/modules/6.1.65-talos/kernel/drivers/ata/pata_sch.ko > ./lib/modules/6.1.65-talos/kernel/drivers/gpu > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/amd > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/amd/amdgpu > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/amd/amdgpu/amdgpu.ko > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/display > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/display/drm_display_helper.ko > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/drm_buddy.ko > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/drm_ttm_helper.ko > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/i915 > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/i915/i915.ko > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/scheduler > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/scheduler/gpu-sched.ko > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/ttm > ./lib/modules/6.1.65-talos/kernel/drivers/gpu/drm/ttm/ttm.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-a4tech.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-apple.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-belkin.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-cherry.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-chicony.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-cypress.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-ezkey.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-gyration.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-ite.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-kensington.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-lg-g15.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-logitech.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-microsoft.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-monterey.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-petalynx.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-pl.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-samsung.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-sunplus.ko > ./lib/modules/6.1.65-talos/kernel/drivers/hid/hid-topseed.ko 28a71,74 > ./lib/modules/6.1.65-talos/kernel/drivers/i2c > ./lib/modules/6.1.65-talos/kernel/drivers/i2c/busses > ./lib/modules/6.1.65-talos/kernel/drivers/i2c/busses/i2c-i801.ko > ./lib/modules/6.1.65-talos/kernel/drivers/i2c/i2c-smbus.ko 41a88,101 > ./lib/modules/6.1.65-talos/kernel/drivers/message > ./lib/modules/6.1.65-talos/kernel/drivers/message/fusion > ./lib/modules/6.1.65-talos/kernel/drivers/message/fusion/mptbase.ko > ./lib/modules/6.1.65-talos/kernel/drivers/message/fusion/mptsas.ko > ./lib/modules/6.1.65-talos/kernel/drivers/message/fusion/mptscsih.ko > ./lib/modules/6.1.65-talos/kernel/drivers/misc > ./lib/modules/6.1.65-talos/kernel/drivers/misc/hpilo.ko > ./lib/modules/6.1.65-talos/kernel/drivers/mmc > ./lib/modules/6.1.65-talos/kernel/drivers/mmc/host > ./lib/modules/6.1.65-talos/kernel/drivers/mmc/host/sdhci-acpi.ko > ./lib/modules/6.1.65-talos/kernel/drivers/mmc/host/sdhci_f_sdh30.ko > ./lib/modules/6.1.65-talos/kernel/drivers/mmc/host/sdhci-pci.ko > ./lib/modules/6.1.65-talos/kernel/drivers/mmc/host/sdhci-pltfm.ko > ./lib/modules/6.1.65-talos/kernel/drivers/mmc/host/sdhci-xenon-driver.ko 55a116,119 > ./lib/modules/6.1.65-talos/kernel/drivers/net/ethernet/broadcom/tg3.ko > ./lib/modules/6.1.65-talos/kernel/drivers/net/ethernet/cavium > ./lib/modules/6.1.65-talos/kernel/drivers/net/ethernet/cavium/common > ./lib/modules/6.1.65-talos/kernel/drivers/net/ethernet/cavium/common/cavium_ptp.ko 118a183,184 > ./lib/modules/6.1.65-talos/kernel/drivers/net/ethernet/qlogic/netxen > ./lib/modules/6.1.65-talos/kernel/drivers/net/ethernet/qlogic/netxen/netxen_nic.ko 131a198 > ./lib/modules/6.1.65-talos/kernel/drivers/net/mii.ko 156a224 > ./lib/modules/6.1.65-talos/kernel/drivers/net/usb/r8152.ko 167a236,238 > ./lib/modules/6.1.65-talos/kernel/drivers/nvme > ./lib/modules/6.1.65-talos/kernel/drivers/nvme/host > ./lib/modules/6.1.65-talos/kernel/drivers/nvme/host/nvme.ko 171a243,244 > ./lib/modules/6.1.65-talos/kernel/drivers/scsi/isci > ./lib/modules/6.1.65-talos/kernel/drivers/scsi/isci/isci.ko 184a258,260 > ./lib/modules/6.1.65-talos/kernel/drivers/usb/serial/ch341.ko > ./lib/modules/6.1.65-talos/kernel/drivers/usb/serial/cp210x.ko > ./lib/modules/6.1.65-talos/kernel/drivers/usb/serial/ftdi_sio.ko 185a262 > ./lib/modules/6.1.65-talos/kernel/drivers/usb/serial/pl2303.ko 224c301 < 86 directories, 136 files --- > 109 directories, 190 files ``` Signed-off-by: Andrey Smirnov --- kernel/build/config-amd64 | 100 +++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/kernel/build/config-amd64 b/kernel/build/config-amd64 index 28398e7d2..0e3b7b678 100644 --- a/kernel/build/config-amd64 +++ b/kernel/build/config-amd64 @@ -1981,7 +1981,7 @@ CONFIG_BLK_DEV_RBD=y # CONFIG_NVME_COMMON=y CONFIG_NVME_CORE=y -CONFIG_BLK_DEV_NVME=y +CONFIG_BLK_DEV_NVME=m CONFIG_NVME_MULTIPATH=y # CONFIG_NVME_VERBOSE_ERRORS is not set CONFIG_NVME_HWMON=y @@ -2002,7 +2002,7 @@ CONFIG_NVME_AUTH=y # CONFIG_TIFM_CORE is not set # CONFIG_ICS932S401 is not set CONFIG_ENCLOSURE_SERVICES=y -CONFIG_HP_ILO=y +CONFIG_HP_ILO=m # CONFIG_APDS9802ALS is not set # CONFIG_ISL29003 is not set # CONFIG_ISL29020 is not set @@ -2132,7 +2132,7 @@ CONFIG_HYPERV_STORAGE=y # CONFIG_SCSI_SNIC is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_FDOMAIN_PCI is not set -CONFIG_SCSI_ISCI=y +CONFIG_SCSI_ISCI=m # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set @@ -2163,7 +2163,7 @@ CONFIG_SATA_PMP=y # # Controllers with non-SFF native interface # -CONFIG_SATA_AHCI=y +CONFIG_SATA_AHCI=m CONFIG_SATA_MOBILE_LPM_POLICY=0 # CONFIG_SATA_AHCI_PLATFORM is not set # CONFIG_AHCI_DWC is not set @@ -2199,7 +2199,7 @@ CONFIG_ATA_PIIX=y # PATA SFF controllers with BMDMA # # CONFIG_PATA_ALI is not set -CONFIG_PATA_AMD=y +CONFIG_PATA_AMD=m # CONFIG_PATA_ARTOP is not set # CONFIG_PATA_ATIIXP is not set # CONFIG_PATA_ATP867X is not set @@ -2213,17 +2213,17 @@ CONFIG_PATA_AMD=y # CONFIG_PATA_IT8213 is not set # CONFIG_PATA_IT821X is not set # CONFIG_PATA_JMICRON is not set -CONFIG_PATA_MARVELL=y +CONFIG_PATA_MARVELL=m # CONFIG_PATA_NETCELL is not set # CONFIG_PATA_NINJA32 is not set # CONFIG_PATA_NS87415 is not set -CONFIG_PATA_OLDPIIX=y +CONFIG_PATA_OLDPIIX=m # CONFIG_PATA_OPTIDMA is not set # CONFIG_PATA_PDC2027X is not set # CONFIG_PATA_PDC_OLD is not set # CONFIG_PATA_RADISYS is not set # CONFIG_PATA_RDC is not set -CONFIG_PATA_SCH=y +CONFIG_PATA_SCH=m # CONFIG_PATA_SERVERWORKS is not set # CONFIG_PATA_SIL680 is not set # CONFIG_PATA_SIS is not set @@ -2296,7 +2296,7 @@ CONFIG_DM_MULTIPATH=m # CONFIG_TARGET_CORE is not set CONFIG_FUSION=y # CONFIG_FUSION_SPI is not set -CONFIG_FUSION_SAS=y +CONFIG_FUSION_SAS=m CONFIG_FUSION_MAX_SGE=128 # CONFIG_FUSION_CTL is not set # CONFIG_FUSION_LOGGING is not set @@ -2310,7 +2310,7 @@ CONFIG_FUSION_MAX_SGE=128 # CONFIG_MACINTOSH_DRIVERS is not set CONFIG_NETDEVICES=y -CONFIG_MII=y +CONFIG_MII=m CONFIG_NET_CORE=y CONFIG_BONDING=y CONFIG_DUMMY=y @@ -2413,7 +2413,7 @@ CONFIG_NET_VENDOR_BROADCOM=y # CONFIG_BCMGENET is not set CONFIG_BNX2=m # CONFIG_CNIC is not set -CONFIG_TIGON3=y +CONFIG_TIGON3=m CONFIG_TIGON3_HWMON=y CONFIG_BNX2X=m CONFIG_BNX2X_SRIOV=y @@ -2430,7 +2430,7 @@ CONFIG_NET_VENDOR_CAVIUM=y # CONFIG_THUNDER_NIC_VF is not set # CONFIG_THUNDER_NIC_BGX is not set # CONFIG_THUNDER_NIC_RGX is not set -CONFIG_CAVIUM_PTP=y +CONFIG_CAVIUM_PTP=m # CONFIG_LIQUIDIO is not set # CONFIG_LIQUIDIO_VF is not set CONFIG_NET_VENDOR_CHELSIO=y @@ -2580,7 +2580,7 @@ CONFIG_QLCNIC=m CONFIG_QLCNIC_SRIOV=y CONFIG_QLCNIC_DCB=y CONFIG_QLCNIC_HWMON=y -CONFIG_NETXEN_NIC=y +CONFIG_NETXEN_NIC=m CONFIG_QED=m CONFIG_QED_SRIOV=y CONFIG_QEDE=m @@ -2735,7 +2735,7 @@ CONFIG_USB_NET_DRIVERS=y # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set -CONFIG_USB_RTL8152=y +CONFIG_USB_RTL8152=m # CONFIG_USB_LAN78XX is not set CONFIG_USB_USBNET=m CONFIG_USB_NET_AX8817X=m @@ -3162,7 +3162,7 @@ CONFIG_I2C_COMPAT=y # CONFIG_I2C_CHARDEV is not set # CONFIG_I2C_MUX is not set CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_SMBUS=y +CONFIG_I2C_SMBUS=m CONFIG_I2C_ALGOBIT=y # @@ -3178,7 +3178,7 @@ CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_AMD_MP2 is not set -CONFIG_I2C_I801=y +CONFIG_I2C_I801=m # CONFIG_I2C_ISCH is not set # CONFIG_I2C_ISMT is not set # CONFIG_I2C_PIIX4 is not set @@ -3730,17 +3730,17 @@ CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 # CONFIG_DRM_LOAD_EDID_FIRMWARE is not set -CONFIG_DRM_DISPLAY_HELPER=y +CONFIG_DRM_DISPLAY_HELPER=m CONFIG_DRM_DISPLAY_DP_HELPER=y CONFIG_DRM_DISPLAY_HDCP_HELPER=y CONFIG_DRM_DISPLAY_HDMI_HELPER=y # CONFIG_DRM_DP_AUX_CHARDEV is not set # CONFIG_DRM_DP_CEC is not set -CONFIG_DRM_TTM=y -CONFIG_DRM_BUDDY=y -CONFIG_DRM_TTM_HELPER=y +CONFIG_DRM_TTM=m +CONFIG_DRM_BUDDY=m +CONFIG_DRM_TTM_HELPER=m CONFIG_DRM_GEM_SHMEM_HELPER=y -CONFIG_DRM_SCHED=y +CONFIG_DRM_SCHED=m # # I2C encoder or helper chips @@ -3757,7 +3757,7 @@ CONFIG_DRM_SCHED=y # end of ARM devices # CONFIG_DRM_RADEON is not set -CONFIG_DRM_AMDGPU=y +CONFIG_DRM_AMDGPU=m CONFIG_DRM_AMDGPU_SI=y CONFIG_DRM_AMDGPU_CIK=y CONFIG_DRM_AMDGPU_USERPTR=y @@ -3780,7 +3780,7 @@ CONFIG_DRM_AMD_DC_DCN=y # CONFIG_HSA_AMD is not set # CONFIG_DRM_NOUVEAU is not set -CONFIG_DRM_I915=y +CONFIG_DRM_I915=m CONFIG_DRM_I915_FORCE_PROBE="" CONFIG_DRM_I915_CAPTURE_ERROR=y CONFIG_DRM_I915_COMPRESS_ERROR=y @@ -3957,30 +3957,30 @@ CONFIG_HID_GENERIC=y # # Special HID drivers # -CONFIG_HID_A4TECH=y +CONFIG_HID_A4TECH=m # CONFIG_HID_ACCUTOUCH is not set # CONFIG_HID_ACRUX is not set -CONFIG_HID_APPLE=y +CONFIG_HID_APPLE=m # CONFIG_HID_APPLEIR is not set # CONFIG_HID_ASUS is not set # CONFIG_HID_AUREAL is not set -CONFIG_HID_BELKIN=y +CONFIG_HID_BELKIN=m # CONFIG_HID_BETOP_FF is not set # CONFIG_HID_BIGBEN_FF is not set -CONFIG_HID_CHERRY=y -CONFIG_HID_CHICONY=y +CONFIG_HID_CHERRY=m +CONFIG_HID_CHICONY=m # CONFIG_HID_CORSAIR is not set # CONFIG_HID_COUGAR is not set # CONFIG_HID_MACALLY is not set # CONFIG_HID_CMEDIA is not set # CONFIG_HID_CREATIVE_SB0540 is not set -CONFIG_HID_CYPRESS=y +CONFIG_HID_CYPRESS=m # CONFIG_HID_DRAGONRISE is not set # CONFIG_HID_EMS_FF is not set # CONFIG_HID_ELAN is not set # CONFIG_HID_ELECOM is not set # CONFIG_HID_ELO is not set -CONFIG_HID_EZKEY=y +CONFIG_HID_EZKEY=m # CONFIG_HID_FT260 is not set # CONFIG_HID_GEMBIRD is not set # CONFIG_HID_GFRM is not set @@ -3995,17 +3995,17 @@ CONFIG_HID_EZKEY=y # CONFIG_HID_VIEWSONIC is not set # CONFIG_HID_VRC2 is not set # CONFIG_HID_XIAOMI is not set -CONFIG_HID_GYRATION=y +CONFIG_HID_GYRATION=m # CONFIG_HID_ICADE is not set -CONFIG_HID_ITE=y +CONFIG_HID_ITE=m # CONFIG_HID_JABRA is not set # CONFIG_HID_TWINHAN is not set -CONFIG_HID_KENSINGTON=y +CONFIG_HID_KENSINGTON=m # CONFIG_HID_LCPOWER is not set # CONFIG_HID_LED is not set # CONFIG_HID_LENOVO is not set # CONFIG_HID_LETSKETCH is not set -CONFIG_HID_LOGITECH=y +CONFIG_HID_LOGITECH=m # CONFIG_HID_LOGITECH_DJ is not set # CONFIG_HID_LOGITECH_HIDPP is not set CONFIG_LOGITECH_FF=y @@ -4017,17 +4017,17 @@ CONFIG_LOGIWHEELS_FF=y # CONFIG_HID_MAYFLASH is not set # CONFIG_HID_MEGAWORLD_FF is not set CONFIG_HID_REDRAGON=y -CONFIG_HID_MICROSOFT=y -CONFIG_HID_MONTEREY=y +CONFIG_HID_MICROSOFT=m +CONFIG_HID_MONTEREY=m # CONFIG_HID_MULTITOUCH is not set # CONFIG_HID_NINTENDO is not set # CONFIG_HID_NTI is not set # CONFIG_HID_NTRIG is not set # CONFIG_HID_ORTEK is not set -CONFIG_HID_PANTHERLORD=y +CONFIG_HID_PANTHERLORD=m CONFIG_PANTHERLORD_FF=y # CONFIG_HID_PENMOUNT is not set -CONFIG_HID_PETALYNX=y +CONFIG_HID_PETALYNX=m # CONFIG_HID_PICOLCD is not set # CONFIG_HID_PLANTRONICS is not set # CONFIG_HID_PXRC is not set @@ -4036,20 +4036,20 @@ CONFIG_HID_PETALYNX=y # CONFIG_HID_RETRODE is not set # CONFIG_HID_ROCCAT is not set # CONFIG_HID_SAITEK is not set -CONFIG_HID_SAMSUNG=y +CONFIG_HID_SAMSUNG=m # CONFIG_HID_SEMITEK is not set # CONFIG_HID_SIGMAMICRO is not set # CONFIG_HID_SONY is not set # CONFIG_HID_SPEEDLINK is not set # CONFIG_HID_STEAM is not set # CONFIG_HID_STEELSERIES is not set -CONFIG_HID_SUNPLUS=y +CONFIG_HID_SUNPLUS=m # CONFIG_HID_RMI is not set # CONFIG_HID_GREENASIA is not set # CONFIG_HID_HYPERV_MOUSE is not set # CONFIG_HID_SMARTJOYPLUS is not set # CONFIG_HID_TIVO is not set -CONFIG_HID_TOPSEED=y +CONFIG_HID_TOPSEED=m # CONFIG_HID_TOPRE is not set # CONFIG_HID_THINGM is not set # CONFIG_HID_THRUSTMASTER is not set @@ -4193,13 +4193,13 @@ CONFIG_USB_SERIAL_GENERIC=y # CONFIG_USB_SERIAL_AIRCABLE is not set # CONFIG_USB_SERIAL_ARK3116 is not set # CONFIG_USB_SERIAL_BELKIN is not set -CONFIG_USB_SERIAL_CH341=y +CONFIG_USB_SERIAL_CH341=m # CONFIG_USB_SERIAL_WHITEHEAT is not set # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set -CONFIG_USB_SERIAL_CP210X=y +CONFIG_USB_SERIAL_CP210X=m # CONFIG_USB_SERIAL_CYPRESS_M8 is not set # CONFIG_USB_SERIAL_EMPEG is not set -CONFIG_USB_SERIAL_FTDI_SIO=y +CONFIG_USB_SERIAL_FTDI_SIO=m # CONFIG_USB_SERIAL_VISOR is not set # CONFIG_USB_SERIAL_IPAQ is not set # CONFIG_USB_SERIAL_IR is not set @@ -4220,7 +4220,7 @@ CONFIG_USB_SERIAL_FTDI_SIO=y # CONFIG_USB_SERIAL_MOS7840 is not set # CONFIG_USB_SERIAL_MXUPORT is not set # CONFIG_USB_SERIAL_NAVMAN is not set -CONFIG_USB_SERIAL_PL2303=y +CONFIG_USB_SERIAL_PL2303=m # CONFIG_USB_SERIAL_OTI6858 is not set # CONFIG_USB_SERIAL_QCAUX is not set # CONFIG_USB_SERIAL_QUALCOMM is not set @@ -4295,11 +4295,11 @@ CONFIG_MMC_BLOCK_MINORS=32 # CONFIG_MMC_DEBUG is not set CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_IO_ACCESSORS=y -CONFIG_MMC_SDHCI_PCI=y +CONFIG_MMC_SDHCI_PCI=m CONFIG_MMC_RICOH_MMC=y -CONFIG_MMC_SDHCI_ACPI=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MMC_SDHCI_F_SDH30=y +CONFIG_MMC_SDHCI_ACPI=m +CONFIG_MMC_SDHCI_PLTFM=m +CONFIG_MMC_SDHCI_F_SDH30=m # CONFIG_MMC_WBSD is not set # CONFIG_MMC_TIFM_SD is not set # CONFIG_MMC_CB710 is not set @@ -4311,7 +4311,7 @@ CONFIG_MMC_CQHCI=y # CONFIG_MMC_HSQ is not set # CONFIG_MMC_TOSHIBA_PCI is not set # CONFIG_MMC_MTK is not set -CONFIG_MMC_SDHCI_XENON=y +CONFIG_MMC_SDHCI_XENON=m # CONFIG_SCSI_UFSHCD is not set # CONFIG_MEMSTICK is not set CONFIG_NEW_LEDS=y