diff options
| author | Josh Poimboeuf <jpoimboe@kernel.org> | 2026-04-02 19:47:10 -0700 |
|---|---|---|
| committer | Josh Poimboeuf <jpoimboe@kernel.org> | 2026-05-04 21:16:02 -0700 |
| commit | cc39ccce7d5bc623100f07dcda070cef1bf690f6 (patch) | |
| tree | d9bdfbcefd2cec55aad4af7d8e0f10d3255be6dd | |
| parent | a375e327b63e0da29b82a92b569bfdf4628fa38a (diff) | |
klp-build: Fix hang on out-of-date .config
If .config is out of date with the kernel source, 'make syncconfig'
hangs while waiting for user input on new config options. Detect the
mismatch and return an error.
Fixes: 6f93f7b06810 ("livepatch/klp-build: Fix inconsistent kernel version")
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
| -rwxr-xr-x | scripts/livepatch/klp-build | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index 0ad7e6631314..e19d93b78fcb 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -306,7 +306,12 @@ set_kernelversion() { stash_file "$file" - kernelrelease="$(cd "$SRC" && make syncconfig &>/dev/null && make -s kernelrelease)" + if [[ -n "$(make -s listnewconfig 2>/dev/null)" ]]; then + die ".config mismatch, check your .config or run 'make olddefconfig'" + fi + make syncconfig &>/dev/null || die "make syncconfig failed" + + kernelrelease="$(make -s kernelrelease)" [[ -z "$kernelrelease" ]] && die "failed to get kernel version" sed -i "2i echo $kernelrelease; exit 0" scripts/setlocalversion |
