New approach on kernel of Fedora

Idea: Create a post-install service for fresh Fedora installations that automatically builds a custom Linux kernel based on the system’s detected hardware.

The process would be:

  1. Install Fedora with the standard kernel and modules.
  2. Detect the system hardware and determine which drivers are actually required.
  3. Ask the user once whether they want a kernel optimized specifically for their hardware.
  4. If the user agrees, automatically compile and install the custom kernel alongside the existing kernel.
  5. Whenever a new kernel is installed or an existing one is updated, notify the user and, on demand, restart the system to apply it.

I wouldnt say much but, after every kernel one would need to compile the kernel and its not just restart the system to apply it :smiley:
If machine gets 10 kernel updates you’ve potentially made the user perform 10 local kernel builds that Fedoras infrastructure did for them.

What if decline?

What if the hardware changes after 6 months? the original hardware analysis is outdated - the service would now need to decide whether adding a GPU, Wi-Fi adapter, USB device, etc. should trigger another offer. [ adds another state management complexity for a feature whose primary optimization is already questionable ]

Why is this useful for the general user?

First, for laptops, having fewer modules can mean lower power consumption, a more responsive system, and lower RAM usage.

This application could also be used to switch off unused services. It could provide a nice TUI/GUI for less technical users who simply want to enjoy the default system without having to understand or configure every component themselves.

This could also be combined with telemetry (some users do not disable it), providing benefits to the community, Fedora, and Red Hat Enterprise Linux by building profiles of different machines and collecting a detailed list of the features available in their kernels.

What do u mean ?

I had read it somewhere that the gain is neglibile for this.

What are you hoping to achieve.

Doing those two things might save < 0.5 second on the bootup time and nothing else

Why give users a even bigger chance to break their systems, currently they don’t even wait 2 - 5 minutes for akmods to build.

I doubt they will wait 30 - 60 minutes for a kernel.

That’s why we have modules in the first place, instead of a single monolithic kernel. This way, modules are present in the filesystem, but they are only loaded if needed for the current hardware. It makes no measurable difference for power consumption or RAM use, only the code needed for a given system is present in memory.

And even for loading times, I doubt it makes a difference on solid state storage if the kernel has to load additional modules instead of having all the necessary modules compiled in (resulting in a bigger monolithic kernel instead of a smaller kernel + modules).

It has a large number of modules available on disk → it loads the ones that are needed, plus those that have been explicitly configured to load (initramfs).

Modules+systemservice. As tight as possible; CPU instructions maxed as possible and/or GPU maxed as possiblke ( maximu instucion) set.

Yes and that is a great thing right?

The module in the initramfs are only loaded if you have the matching hardware.

I think what you would rather like is better support for injecting an optimized kernel (like the one from CachyOS) which should remain optional, personally I liked also the Gentoo approach, where every package was compiled exactly to the “arch” of the current CPU and optimized either for binary size or speed - but obviously this does not come for free… and e.g. it was impossible to compile LibreOffice with less than 16GB or RAM :smiley:

btw. unused kernel modules (as drivers for undetected HW) are not loaded into ram anyway (you can check it with the command lsmod)

lsmod
Module                  Size  Used by
hid_samsung            28672  0
overlay               245760  0
exfat                 118784  1
uinput                 24576  1
tun                    77824  0
rfcomm                110592  9
snd_seq_dummy          12288  0
snd_hrtimer            12288  1
nft_masq               12288  2
evdi                  114688  8
bridge                417792  0
stp                    12288  1 bridge
llc                    16384  2 bridge,stp
nf_log_syslog          24576  6
nft_log                12288  3
nft_fib_inet           12288  1
nft_fib_ipv4           12288  1 nft_fib_inet
nft_fib_ipv6           12288  1 nft_fib_inet
nft_fib                12288  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet
nft_reject_inet        12288  16
nf_reject_ipv4         16384  1 nft_reject_inet
nf_reject_ipv6         20480  1 nft_reject_inet
nft_reject             12288  1 nft_reject_inet
nft_ct                 28672  8
nft_chain_nat          12288  5
nf_nat                 69632  2 nft_masq,nft_chain_nat
nf_conntrack          208896  3 nf_nat,nft_ct,nft_masq
nf_defrag_ipv6         24576  1 nf_conntrack
nf_defrag_ipv4         12288  1 nf_conntrack
nf_tables             405504  579 nft_ct,nft_log,nft_reject_inet,nft_fib_ipv6,nft_fib_ipv4,nft_masq,nft_chain_nat,nft_reject,nft_fib,nft_fib_inet
qrtr                   57344  2
uhid                   24576  2
bnep                   36864  2
binfmt_misc            28672  1
vfat                   28672  1
fat                   114688  1 vfat
squashfs               90112  12
iwlmvm                577536  0
snd_sof_amd_acp70      16384  0
snd_sof_amd_acp63      16384  0
snd_sof_amd_vangogh    16384  0
snd_sof_amd_rembrandt    16384  0
snd_sof_amd_renoir     16384  0
snd_sof_amd_acp        77824  5 snd_sof_amd_acp70,snd_sof_amd_rembrandt,snd_sof_amd_vangogh,snd_sof_amd_acp63,snd_sof_amd_renoir
mac80211             1527808  1 iwlmvm
snd_sof_pci            24576  5 snd_sof_amd_acp70,snd_sof_amd_rembrandt,snd_sof_amd_vangogh,snd_sof_amd_acp63,snd_sof_amd_renoir
snd_sof_xtensa_dsp     16384  1 snd_sof_amd_acp
snd_sof               503808  2 snd_sof_amd_acp,snd_sof_pci
snd_sof_utils          16384  1 snd_sof
snd_pci_ps             36864  0
amd_atl                69632  1
intel_rapl_msr         20480  0
snd_soc_acpi_amd_match    12288  3 snd_sof_amd_acp70,snd_sof_amd_acp63,snd_pci_ps
intel_rapl_common      57344  1 intel_rapl_msr
libarc4                12288  1 mac80211
snd_amd_sdw_acpi       16384  2 snd_sof_amd_acp,snd_pci_ps
snd_hda_codec_alc269   147456  1
soundwire_amd          45056  2 snd_sof_amd_acp,snd_pci_ps
soundwire_generic_allocation    20480  1 soundwire_amd
snd_hda_scodec_component    20480  1 snd_hda_codec_alc269
soundwire_bus        1216512  2 soundwire_generic_allocation,soundwire_amd
snd_hda_codec_realtek_lib    65536  1 snd_hda_codec_alc269
snd_hda_codec_generic   118784  2 snd_hda_codec_realtek_lib,snd_hda_codec_alc269
snd_soc_sdca          151552  1 soundwire_bus
snd_hda_codec_atihdmi    20480  1
edac_mce_amd           45056  0
snd_hda_codec_hdmi     65536  1 snd_hda_codec_atihdmi
snd_soc_core          434176  3 snd_sof,snd_soc_sdca,soundwire_amd
snd_usb_audio         622592  2
iwlwifi               466944  1 iwlmvm
snd_hda_intel          69632  4
kvm_amd               245760  0
snd_ctl_led            28672  0
snd_hda_codec         229376  6 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek_lib,snd_hda_codec_alc269,snd_hda_codec_atihdmi
snd_compress           32768  1 snd_soc_core
snd_rpl_pci_acp6x      20480  0
uvcvideo              192512  1
snd_hda_core          151552  7 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek_lib,snd_hda_codec_alc269,snd_hda_codec_atihdmi
snd_usbmidi_lib        49152  1 snd_usb_audio
snd_acp_pci            16384  0
kvm                  1400832  1 kvm_amd
snd_intel_dspcfg       45056  2 snd_hda_intel,snd_sof
snd_amd_acpi_mach      12288  1 snd_acp_pci
snd_ump                49152  1 snd_usb_audio
snd_intel_sdw_acpi     16384  1 snd_intel_dspcfg
snd_acp_legacy_common    24576  1 snd_acp_pci
cfg80211             1437696  3 iwlmvm,iwlwifi,mac80211
snd_hwdep              24576  2 snd_usb_audio,snd_hda_codec
snd_rawmidi            57344  2 snd_usbmidi_lib,snd_ump
snd_pci_acp6x          20480  0
uvc                    12288  1 uvcvideo
videobuf2_vmalloc      20480  1 uvcvideo
videobuf2_v4l2         45056  1 uvcvideo
snd_seq               135168  7 snd_seq_dummy
hid_multitouch         36864  0
videobuf2_memops       16384  1 videobuf2_vmalloc
btusb                  81920  0
snd_seq_device         16384  3 snd_seq,snd_ump,snd_rawmidi
videobuf2_common       98304  4 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
btrtl                  36864  1 btusb
videodev              413696  2 videobuf2_v4l2,uvcvideo
snd_pcm               200704  15 snd_sof_amd_acp,snd_hda_codec_hdmi,snd_pci_acp6x,snd_acp_legacy_common,snd_hda_intel,snd_usb_audio,snd_hda_codec,snd_sof,snd_soc_sdca,snd_compress,snd_soc_core,snd_sof_utils,soundwire_amd,snd_hda_core,snd_pci_ps
btintel                77824  1 btusb
asus_nb_wmi            32768  0
btbcm                  24576  1 btusb
asus_wmi              118784  1 asus_nb_wmi
btmtk                  36864  1 btusb
irqbypass              12288  1 kvm
snd_rn_pci_acp3x       24576  0
snd_timer              57344  3 snd_seq,snd_hrtimer,snd_pcm
snd_acp_config         24576  9 snd_rn_pci_acp3x,snd_sof_amd_acp70,snd_pci_acp6x,snd_sof_amd_rembrandt,snd_sof_amd_vangogh,snd_sof_amd_acp63,snd_acp_pci,snd_pci_ps,snd_sof_amd_renoir
i2c_piix4              36864  0
sparse_keymap          12288  1 asus_wmi
rapl                   24576  0
bluetooth            1155072  42 btrtl,btmtk,btintel,btbcm,bnep,btusb,rfcomm
platform_profile       16384  1 asus_wmi
snd                   155648  34 snd_ctl_led,snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_sof,snd_soc_sdca,snd_timer,snd_hda_codec_realtek_lib,snd_compress,snd_hda_codec_alc269,snd_soc_core,snd_ump,snd_pcm,snd_rawmidi
pcspkr                 12288  0
wmi_bmof               12288  0
mc                     94208  6 videodev,snd_usb_audio,videobuf2_v4l2,uvcvideo,videobuf2_common
k10temp                16384  0
joydev                 28672  0
i2c_smbus              20480  1 i2c_piix4
snd_soc_acpi           16384  5 snd_sof_amd_acp,snd_acp_legacy_common,snd_acp_config,snd_amd_acpi_mach,snd_pci_ps
sg                     53248  0
soundcore              16384  2 snd_ctl_led,snd
rfkill                 40960  10 iwlmvm,asus_wmi,bluetooth,cfg80211
i2c_designware_platform    12288  0
amd_pmc                57344  0
i2c_designware_core    45056  1 i2c_designware_platform
loop                   45056  24
zstd                   12288  0
zram                   61440  1
842_decompress         20480  1 zram
lz4hc_compress         20480  1 zram
842_compress           24576  1 zram
lz4_compress           24576  1 zram
zstd_compress         528384  2 zram,zstd
xfs                  3338240  3
sr_mod                 28672  0
sd_mod                 90112  1
cdrom                  90112  1 sr_mod
amdgpu              15532032  35
amdxcp                 12288  1 amdgpu
i2c_algo_bit           20480  1 amdgpu
drm_ttm_helper         16384  3 evdi,amdgpu
ttm                   126976  2 amdgpu,drm_ttm_helper
drm_exec               12288  1 amdgpu
drm_panel_backlight_quirks    12288  1 amdgpu
gpu_sched              69632  1 amdgpu
drm_suballoc_helper    16384  1 amdgpu
uas                    40960  0
drm_buddy              32768  1 amdgpu
usb_storage            94208  2 uas
drm_display_helper    319488  1 amdgpu
ccp                   192512  1 kvm_amd
cec                    81920  2 drm_display_helper,amdgpu
nvme                   77824  5
nvme_core             262144  6 nvme
crct10dif_pclmul       12288  1
crc32_pclmul           12288  0
crc32c_intel           12288  0
video                  81920  3 asus_wmi,amdgpu,asus_nb_wmi
nvme_keyring           20480  1 nvme_core
ghash_clmulni_intel    16384  0
nvme_auth              32768  1 nvme_core
sp5100_tco             20480  0
i2c_hid_acpi           12288  0
wmi                    32768  3 video,asus_wmi,wmi_bmof
i2c_hid                49152  1 i2c_hid_acpi
serio_raw              20480  0
sunrpc                913408  1
dm_mirror              28672  0
dm_region_hash         28672  1 dm_mirror
dm_log                 24576  2 dm_region_hash,dm_mirror
iscsi_tcp              28672  0
libiscsi_tcp           45056  1 iscsi_tcp
libiscsi               94208  2 libiscsi_tcp,iscsi_tcp
scsi_transport_iscsi   196608  3 libiscsi_tcp,iscsi_tcp,libiscsi
i2c_dev                28672  0
dm_multipath           53248  0
fuse                  253952  7
dm_mod                249856  11 dm_multipath,dm_log,dm_mirror
nfnetlink              20480  3 nf_tables

I think what you would rather like is better support for injecting an optimised kernel (like the one from CachyOS), which should remain optional

Yup - Daily i use Red Hat - but tried CachyOS even from an unbuffered pendrive, and the OS was faster thanks to the kernel than the Fedora one on ssd disk… so this it is good suggestion.