commit:     bae8d8db8d8a49279f214c90c36ea5b64a982622
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 26 05:22:42 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Tue Mar 26 08:03:58 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=bae8d8db

config_kernel(): run def/oldconfig when we have modified .config

This is needed to avoid a prompt if a newly added/modified kernel
config option adds additional option(s) not yet found in .config.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_configkernel.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index a5266e4..016d5b2 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -124,6 +124,8 @@ config_kernel() {
                [ "$?" ] || gen_die "Error: ${add_config} failed!"
        fi
 
+       [ -f "${TEMP}/.kconfig_modified" ] && rm "${TEMP}/.kconfig_modified"
+
        # Force this on if we are using --genzimage
        if isTrue "${CMD_GENZIMAGE}"
        then
@@ -555,4 +557,18 @@ config_kernel() {
                        kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "$k" 
"${cfg}"
                done
        fi
+
+       if [ -f "${TEMP}/.kconfig_modified" ]
+       then
+               if isTrue "${OLDCONFIG}"
+               then
+                       print_info 1 "$(getIndent 1)>> Re-running oldconfig due 
to changed kernel options..."
+                       yes '' 2>/dev/null | compile_generic oldconfig kernel 
2>/dev/null
+               else
+                       print_info 1 "$(getIndent 1)>> Running olddefconfig due 
to changed kernel options..."
+                       compile_generic olddefconfig kernel 2>/dev/null
+               fi
+       else
+               print_info 2 "$(getIndent 1)>> genkernel did not need to 
add/modify any kernel options."
+       fi
 }

Reply via email to