These Pacman hooks can be used to keep old kernel modules active without rebooting. This can work around issues like new USB devices and Docker images not working properly after a kernel upgrade, but before a reboot.
Add the files to
/etc/pacman.d/hooks to enable the functionality. It works by making a backup of your current kernel's
/lib/modules/... directory before the new kernel is installed, and then moving it back to the
/lib/modules directory after the installation completes, working around the default behavior of deleting the old modules.
You can manually clean up the files after a reboot if you're concerned about the disk space used.