History

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.

Josh Poimboeuf committed 7 months ago

Commit cc39ccc1 parent a375e321 file · +6 −1Browse files

Showing the changes to scripts/livepatch (1 of 1 file). Show all

Unified · Split

scripts/livepatch/klp-build+6−1
@@ -306,7 +306,12 @@ set_kernelversion() { · 305 unmodified lines
306 306
307 stash_file "$file"307 stash_file "$file"
308 308
309 kernelrelease="$(cd "$SRC" && make syncconfig &>/dev/null && make -s kernelrelease)"309 if [[ -n "$(make -s listnewconfig 2>/dev/null)" ]]; then
310 die ".config mismatch, check your .config or run 'make olddefconfig'"
311 fi
312 make syncconfig &>/dev/null || die "make syncconfig failed"
313
314 kernelrelease="$(make -s kernelrelease)"
310 [[ -z "$kernelrelease" ]] && die "failed to get kernel version"315 [[ -z "$kernelrelease" ]] && die "failed to get kernel version"
311 316
312 sed -i "2i echo $kernelrelease; exit 0" scripts/setlocalversion317 sed -i "2i echo $kernelrelease; exit 0" scripts/setlocalversion