Browse Source

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>
master
Kairui Song 4 years ago committed by Daniel Molkentin
parent
commit
c050190f86
  1. 5
      dracut-functions.sh

5
dracut-functions.sh

@ -674,6 +674,11 @@ check_kernel_config() @@ -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

Loading…
Cancel
Save