From 3c268ffdccfac711ef3d82e2b2f57be4fe79181c Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Tue, 19 May 2026 10:46:15 -0600 Subject: [PATCH] Remove DKMS machinery We can't use DKMS to load out-of-tree modules into our kernel by default without incurring negative consequences we don't want to deal with. Remove the machinery for now since we won't be using it. Reverts 7f3f03a19fa7801d8f4bf78e3ba6c809dc56b620 Related to #3 --- mkosi.conf.d/00-packages-core.conf | 1 - mkosi.extra/usr/lib/rebuild-efi | 6 ------ mkosi.finalize.d/40-core.sh.chroot | 6 ------ 3 files changed, 13 deletions(-) diff --git a/mkosi.conf.d/00-packages-core.conf b/mkosi.conf.d/00-packages-core.conf index f96d53f..369e806 100644 --- a/mkosi.conf.d/00-packages-core.conf +++ b/mkosi.conf.d/00-packages-core.conf @@ -16,7 +16,6 @@ Packages= kmod kmscon # modern userspace getty and virtual terminal replacement linux-firmware - linux-headers # For DKMS linux # It's the kernel! plymouth realtime-privileges # `realtime` group and realtime privileges for processes using it diff --git a/mkosi.extra/usr/lib/rebuild-efi b/mkosi.extra/usr/lib/rebuild-efi index f9467e1..94a284c 100755 --- a/mkosi.extra/usr/lib/rebuild-efi +++ b/mkosi.extra/usr/lib/rebuild-efi @@ -18,12 +18,6 @@ if [ -z "$kernel_version" ]; then exit 1 fi -# Ensure all DKMS modules are built for this kernel before we generate the initramfs -if ! dkms autoinstall -k "$kernel_version"; then - echo "Error: DKMS autoinstall failed" >&2 - exit 1 -fi - # NOTE: plymouth MUST be after systemd as per the wiki! cat <<- EOF > mkinitcpio.conf MODULES=(overlay) diff --git a/mkosi.finalize.d/40-core.sh.chroot b/mkosi.finalize.d/40-core.sh.chroot index 71dc373..5c19f46 100755 --- a/mkosi.finalize.d/40-core.sh.chroot +++ b/mkosi.finalize.d/40-core.sh.chroot @@ -120,12 +120,6 @@ rm -rf /boot/* ## Don't expose any X11 sessions; we're all-in on Wayland. rm -rf /usr/share/xsessions/ -## Get rid of the beefy Kernel Headers as DKMS happens at build time and after that is useless -rm -rf \ - /usr/lib/modules/*/build \ - /usr/lib/modules/*/vdso \ - /usr/src/* - # Prevent tuned from messing with the vm.swappiness parameter we already set sed --in-place 's|^vm.swappiness.*||' /usr/lib/tuned/profiles/*/*