From bee9c892fb31b3d690afa3579df31e19938d0523 Mon Sep 17 00:00:00 2001 From: Diogo Ferreira Date: Mon, 12 Jan 2026 16:53:12 +0000 Subject: [PATCH] kernel: Keep modules functional after a kernel upgrade When a kernel upgrade is taken in, we replace current modules with new ones and they are not available until we reboot. This can cause the system to appear broken, especially when plugging new hardwaare like a pen drive or odd input device. This patch adds kernel-modules-hook which keeps the current modules even if the package is replaced. A one-off clean-up service runs on startup to remove older modules. --- install/config/all.sh | 1 + install/config/kernel-modules-hook.sh | 1 + install/omarchy-base.packages | 1 + migrations/1768236764.sh | 4 ++++ 4 files changed, 7 insertions(+) create mode 100644 install/config/kernel-modules-hook.sh create mode 100644 migrations/1768236764.sh diff --git a/install/config/all.sh b/install/config/all.sh index 7ba72f71..b08f57e1 100644 --- a/install/config/all.sh +++ b/install/config/all.sh @@ -19,6 +19,7 @@ run_logged $OMARCHY_INSTALL/config/fast-shutdown.sh run_logged $OMARCHY_INSTALL/config/sudoless-asdcontrol.sh run_logged $OMARCHY_INSTALL/config/input-group.sh run_logged $OMARCHY_INSTALL/config/omarchy-ai-skill.sh +run_logged $OMARCHY_INSTALL/config/kernel-modules-hook.sh run_logged $OMARCHY_INSTALL/config/hardware/network.sh run_logged $OMARCHY_INSTALL/config/hardware/set-wireless-regdom.sh run_logged $OMARCHY_INSTALL/config/hardware/fix-fkeys.sh diff --git a/install/config/kernel-modules-hook.sh b/install/config/kernel-modules-hook.sh new file mode 100644 index 00000000..29d0ec4d --- /dev/null +++ b/install/config/kernel-modules-hook.sh @@ -0,0 +1 @@ +chrootable_systemctl_enable linux-modules-cleanup.service diff --git a/install/omarchy-base.packages b/install/omarchy-base.packages index d91ed9ad..e76d0185 100644 --- a/install/omarchy-base.packages +++ b/install/omarchy-base.packages @@ -61,6 +61,7 @@ inxi iwd jq kdenlive +kernel-modules-hook kvantum-qt5 lazydocker lazygit diff --git a/migrations/1768236764.sh b/migrations/1768236764.sh new file mode 100644 index 00000000..cfe6ba56 --- /dev/null +++ b/migrations/1768236764.sh @@ -0,0 +1,4 @@ +echo "Install kernel-modules-hook" + +omarchy-pkg-add kernel-modules-hook +sudo systemctl enable --now linux-modules-cleanup.service