Skip to content

Commit 6c42d37

Browse files
ryncsnaafeijoo-suse
authored andcommitted
fix(dracut-functions.sh): check_kernel_module should follow dracutsysrootdir
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>
1 parent f66a02e commit 6c42d37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dracut-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ check_kernel_config() {
731731
# 0 if the kernel module is either built-in or available
732732
# 1 if the kernel module is not enabled
733733
check_kernel_module() {
734-
modprobe -S "$kernel" --dry-run "$1" &> /dev/null || return 1
734+
modprobe -d "$dracutsysrootdir" -S "$kernel" --dry-run "$1" &> /dev/null || return 1
735735
}
736736
737737
# get_cpu_vendor

0 commit comments

Comments
 (0)