properly handle user specified modules

This commit is contained in:
illiliti 2020-04-17 20:41:54 +03:00
parent 55fe9abfdc
commit 9f9ed09508
2 changed files with 16 additions and 9 deletions

View File

@ -342,11 +342,6 @@ install_hostonly_modules()
}
done < /proc/mounts || panic "failed to install root partition module"
fi
# install user specified modules if any
for _module in $modules; do
install_module "$_module"
done
}
install_all_modules()
@ -501,6 +496,18 @@ create_initramfs()
install_all_modules
fi
# install user specified modules if any
[ "$modules" ] && {
for _module in $modules; do
install_module "$_module"
done
# copy config
printf "%s\n" \
modules="$modules" \
>> "${workdir}/etc/config"
}
for _binary in find sort modprobe; do
install_binary "$_binary"
done

View File

@ -70,6 +70,8 @@ prepare_environment()
ln -s /proc/self/fd/2 /dev/stderr
trap 'panic "something went wrong"' EXIT
[ "$modules" ] && modprobe -a "$modules"
}
parse_cmdline()
@ -147,10 +149,8 @@ unlock_luks()
set -- \
"--disable-locks" \
"$luks_key" \
"$luks_header" \
"$luks_discard" \
"$device" \
"$luks_key" "$luks_header" \
"$luks_discard" "$device" \
"${luks_name:-luks-${device##*/}}"
cryptsetup open $@ || panic "failed to unlock LUKS"