dracut-functions: add a helper to check if kernel module is available

It's like check_kernel_config, help to check if a kernel module is
enabled (cover built-in or compiled module case).

Signed-off-by: Kairui Song <kasong@redhat.com>
This commit is contained in:
Kairui Song 2020-10-20 16:58:01 +08:00 committed by Daniel Molkentin
parent 8f56daa8c3
commit c050190f86

View File

@ -674,6 +674,11 @@ check_kernel_config()
return 1
}
# 0 if the kernel module is either built-in or available
# 1 if the kernel module is not enabled
check_kernel_module() {
modprobe -S $kernel --dry-run $1 &>/dev/null || return 1
}
# get_cpu_vendor
# Only two values are returned: AMD or Intel