-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libkmod: tools: Introduce 'module fallback' directory #202
base: master
Are you sure you want to change the base?
Commits on Oct 22, 2024
-
Make it possible to use is_dir() helper outside of util.c. Signed-off-by: Vitaly Kuznetsov <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fd1c14f - Browse repository at this point
Copy the full SHA fd1c14fView commit details
Commits on Oct 23, 2024
-
libkmod: Introduce fallback module directory
Currently, traditional Linux systems using initramfs are forced to keep two copies of the modules which may be needed both during early boot and for normal system operation. This seems to be inevitable for the case when initramfs is built locally but with the rise of distro shipped UKIs the question whether it would be possible to avoid the redundancy arises. To make it possible to reuse modules from initramfs without copying them to the root filesystem (which may be read-only), the suggested approach is to preserve them on tmpfs, e.g. in /run/modules/`uname -r` but the challenge is to make kmod search there. It would certainly be possible to e.g. bind mount /run/modules/`uname -r` to /lib/modules/`uname -r` but this will make the destination read-only and traditional tools which are used to install packages with modules (e.g. rpm) will break. Instead, a 'fallback' directory approach is suggested: in case main /lib/modules/`uname -r` is completely missing, kmod tools will check whether /run/modules/`uname -r` exist and search there. In theory, it would've been possible to replace this fallback option with a dedicated config for kmod making modules location dynamic but this seems to be a more intrusive change and it will also require additional external actions to switch from 'fallback' to 'main' if/when modules get installed to the main system. Note, no merging of /run/modules/`uname -r` and /lib/modules/`uname -r` is performed. It is expected, that in case /lib/modules/`uname -r` exists, it is a superset and modules from initramfs are no longer needed. Signed-off-by: Vitaly Kuznetsov <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5fdaf03 - Browse repository at this point
Copy the full SHA 5fdaf03View commit details -
modprobe: support fallback module directory with -d/-S
By default, modprobe relies on libkmod to set up module search path (kmod_new(NULL, ...)) but in case -d/-S options are used, modprobe explicitly defines search path using MODULE_DIRECTORY. Add support for MODULE_FALLBACK_DIRECTORY when the main one is missing. Signed-off-by: Vitaly Kuznetsov <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bcc38fc - Browse repository at this point
Copy the full SHA bcc38fcView commit details -
testsuite: add modprobe fallback test
Check whether modprobe is able to load modules from /run/modules/`uname -r` when /lib/modules/`uname -r` is missing. Signed-off-by: Vitaly Kuznetsov <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 41738f5 - Browse repository at this point
Copy the full SHA 41738f5View commit details -
testsuite: add modprobe fallback custom ver test
Check whether modprobe --set-version is able to load modules from /run/modules/<custom-ver> when /lib/modules/<custom-ver> is missing. Signed-off-by: Vitaly Kuznetsov <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4e9f579 - Browse repository at this point
Copy the full SHA 4e9f579View commit details -
modinfo: support fallback module directory with -b/-k
By default, modinfo relies on libkmod to set up module search path (kmod_new(NULL, ...)) but in case -b/-k options are used, modinfo explicitly defines search path using MODULE_DIRECTORY. Add support for MODULE_FALLBACK_DIRECTORY when the main one is missing. Signed-off-by: Vitaly Kuznetsov <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d8a6030 - Browse repository at this point
Copy the full SHA d8a6030View commit details -
testsuite: add modinfo fallback test
Check whether modinfo is able to find modules in /run/modules/`uname -r` when /lib/modules/`uname -r` is missing. Signed-off-by: Vitaly Kuznetsov <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0155e2e - Browse repository at this point
Copy the full SHA 0155e2eView commit details -
testsuite: add modinfo fallback custom ver test
Check whether modinfo --set-version is able to find modules in /run/modules/<custom-ver> when /lib/modules/<custom-ver> is missing. Signed-off-by: Vitaly Kuznetsov <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6bf065d - Browse repository at this point
Copy the full SHA 6bf065dView commit details