A tool for keeping kernel modules around after kernel updates. Unlike kernel-modules-hook and linux-keep-modules, the modules are kept in a temporary mount, so no manual cleanup after reboot is needed. On the other hand, this means the modules will occupy RAM until the files are unmounted or the system is rebooted.
Run makepkg in the checkout directory, and install the created package. This will automatically back up your modules when the kernel is upgraded.
- As root, run the
current-modules-tmpfs.shscript to back up your kernel modules to/lib/current-modules. To manually load modules, you can runmodprobe -d /lib/current-modules $module_name. - To allow automatic module loading (e.g. by udev when plugging in new hardware) run the
current-modules-overlay.shscript as root. This will overlay the backed up modules onto the regular modules directory, allowing scripts to usemodprobewithout specifying a custom module directory. - To undo the effects of the overlay script, run
umount current-modules-overlay. To undo the effects of the tmpfs script, runumount current-modules. Unmounting the overlay is non-destructive, and it can be remounted by re-running thecurrent-modules-overlay.shscript. Unmounting the tmpfs will discard the modules saved in RAM. If the modules have already been removed from the main filesystem, they will need to be restored before the tmpfs can be recreated.
By default, kernel modules are stored in /lib/modules. If your modprobe uses a different directory, you will need to install pkg-config to allow the script to detect the new location. The modules directory is listed in the output of modprobe --help.
After being populated, the tmpfs is recursively marked as immutable. This prevents you from accidentally removing or changing any of them. This is especially important when the overlay is mounted, since modifying the current modules directory will create files on disk which will need to be manually cleaned up.