Skip to content

Commit

Permalink
fix(dracut-functions.sh): check_kernel_module should follow dracutsys…
Browse files Browse the repository at this point in the history
…rootdir

check_kernel_module calls modprobe and tries to dry-run a module load to
check if a module is available. modprobe supports `-d` to specify a
rootdir, so just pass dracutsysrootdir to it to make it work as expected
when building initramfs for another rootfs.

Signed-off-by: Kairui Song <kasong@tencent.com>
  • Loading branch information
ryncsn authored and aafeijoo-suse committed Dec 21, 2022
1 parent f66a02e commit 6c42d37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dracut-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ check_kernel_config() {
# 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
modprobe -d "$dracutsysrootdir" -S "$kernel" --dry-run "$1" &> /dev/null || return 1
}
# get_cpu_vendor
Expand Down

0 comments on commit 6c42d37

Please sign in to comment.