diff options
author | 2020-08-03 00:01:21 +0200 | |
---|---|---|
committer | 2020-08-03 00:42:11 +0200 | |
commit | febeae936c626eb4c0a44654cda2a6351671098b (patch) | |
tree | eb26da6344db4a3d9e293c38df1b0af1f5089dab /gen_determineargs.sh | |
parent | Make use of expand_file() for --linuxrc option (diff) | |
download | genkernel-febeae936c626eb4c0a44654cda2a6351671098b.tar.gz genkernel-febeae936c626eb4c0a44654cda2a6351671098b.tar.bz2 genkernel-febeae936c626eb4c0a44654cda2a6351671098b.zip |
gen_determineargs.sh: determine_real_args(): Set KERNEL_MODULES_PREFIX to temporary location when --no-install is set
This will ensure that we won't install anything on user's system when
--no-install was set.
While here, make use of expand_file() for --kernel-modules-prefix.
Bug: https://bugs.gentoo.org/505810
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_determineargs.sh')
-rwxr-xr-x | gen_determineargs.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 3a7882d9..4457fe4e 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -1170,6 +1170,31 @@ determine_real_args() { fi fi + if ! isTrue "${CMD_INSTALL}" + then + if [ -n "${KERNEL_MODULES_PREFIX}" ] + then + print_warning 1 '--no-install is set; Ignoring --kernel-modules-prefix ...' + fi + + # User does not want that anything will get installed + # so install modules into our temporary directory instead. + KERNEL_MODULES_PREFIX="${TEMP}/mod_prefix" + elif [ -n "${KERNEL_MODULES_PREFIX}" ] + then + KERNEL_MODULES_PREFIX=$(expand_file "${CMD_KERNEL_MODULES_PREFIX}") + if [ -z "${KERNEL_MODULES_PREFIX}" ] + then + gen_die "Failed to expand set --kernel-modules-prefix '${CMD_KERNEL_MODULES_PREFIX}'!" + fi + + if [ ! -d "${KERNEL_MODULES_PREFIX}" ] + then + print_warning 3 "Set --kernel-modules-prefix '${KERNEL_MODULES_PREFIX}' does not exist; Will try to create ..." + mkdir -p "${KERNEL_MODULES_PREFIX}" || gen_die "Failed to create '${KERNEL_MODULES_PREFIX}'!" + fi + fi + MICROCODE=${MICROCODE,,} case "${MICROCODE}" in all|amd|intel) ;; |