From: Kairui Song Date: Tue, 6 Dec 2022 09:20:26 +0000 (+0800) Subject: fix(dracut-functions.sh): check_kernel_module should follow dracutsysrootdir X-Git-Tag: 058~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c42d378abe528ee6f10c8272080eec5f3f44acb;p=thirdparty%2Fdracut.git 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 --- diff --git a/dracut-functions.sh b/dracut-functions.sh index adef37f73..6ab31aa87 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -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