aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-01-10 18:10:08 +0100
committerThomas Deutschmann <whissi@gentoo.org>2020-01-11 20:54:40 +0100
commitda5a5fa797a5fffa6c4d694cbfe2edc83bab4890 (patch)
treeaf1d957fe64ad52eab51ec50f1d65d5ed21477d8 /gen_compile.sh
parentRework ZFS unlock (diff)
downloadgenkernel-da5a5fa797a5fffa6c4d694cbfe2edc83bab4890.tar.gz
genkernel-da5a5fa797a5fffa6c4d694cbfe2edc83bab4890.tar.bz2
genkernel-da5a5fa797a5fffa6c4d694cbfe2edc83bab4890.zip
--module-rebuild: Call emerge with --ignore-default-opts
It's possible that user has set conflicting emerge options like "--ask" in EMERGE_DEFAULT_OPTS which could break genkernel. Calling emerge with --ignore-default-opts will allow us to avoid such scenarios. In addition, --module-rebuild-cmd (MODULEREBUILD_CMD) option was added to allow user to alter default command. Closes: https://bugs.gentoo.org/705082 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_compile.sh')
-rwxr-xr-xgen_compile.sh18
1 files changed, 8 insertions, 10 deletions
diff --git a/gen_compile.sh b/gen_compile.sh
index 3f10adb..3b96f48 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -2,53 +2,51 @@
# $Id$
compile_external_modules() {
- local command="emerge --quiet @module-rebuild 2>&1"
-
if ! isTrue "${CMD_MODULEREBUILD}"
then
- print_info 3 "$(get_indent 1)>> --no-module-rebuild set; Skipping 'emerge @module-rebuild' ..."
+ print_info 3 "$(get_indent 1)>> --no-module-rebuild set; Skipping '${MODULEREBUILD_CMD}' ..."
return
fi
if isTrue "$(tc-is-cross-compiler)"
then
- print_info 3 "$(get_indent 1)>> Cross-compilation detected; Skipping 'emerge @module-rebuild' ..."
+ print_info 3 "$(get_indent 1)>> Cross-compilation detected; Skipping '${MODULEREBUILD_CMD}' ..."
return
fi
if ! isTrue "${CMD_INSTALL}"
then
- print_info 3 "$(get_indent 1)>> --no-install set; Skipping 'emerge @module-rebuild' ..."
+ print_info 3 "$(get_indent 1)>> --no-install set; Skipping '${MODULEREBUILD_CMD}' ..."
return
fi
if [ -n "${INSTALL_MOD_PATH}" ]
then
# emerge would install to a different location
- print_warning 1 "$(get_indent 1)>> INSTALL_MOD_PATH set; Skipping 'emerge @module-rebuild' ..."
+ print_warning 1 "$(get_indent 1)>> INSTALL_MOD_PATH set; Skipping '${MODULEREBUILD_CMD}' ..."
return
fi
local modulesdb_file="/var/lib/module-rebuild/moduledb"
if [ ! -s "${modulesdb_file}" ]
then
- print_info 2 "$(get_indent 1)>> '${modulesdb_file}' does not exist or is empty; Skipping 'emerge @module-rebuild' ..."
+ print_info 2 "$(get_indent 1)>> '${modulesdb_file}' does not exist or is empty; Skipping '${MODULEREBUILD_CMD}' ..."
return
fi
local -x KV_OUT_DIR="${KERNEL_OUTPUTDIR}"
print_info 1 "$(get_indent 1)>> Compiling out-of-tree module(s) ..."
- print_info 3 "COMMAND: ${command}" 1 0 1
+ print_info 3 "COMMAND: ${MODULEREBUILD_CMD}" 1 0 1
if [ "${LOGLEVEL}" -gt 3 ]
then
# Output to stdout and logfile
- eval ${command} | tee -a "${LOGFILE}"
+ eval ${MODULEREBUILD_CMD} 2>&1 | tee -a "${LOGFILE}"
RET=${PIPESTATUS[0]}
else
# Output to logfile only
- eval ${command} >> "${LOGFILE}"
+ eval ${MODULEREBUILD_CMD} 2>&1 >> "${LOGFILE}"
RET=$?
fi