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.
Unified · Split
| @@ -306,7 +306,12 @@ set_kernelversion() { · 305 unmodified lines | ||
| 306 | 306 | |
| 307 | 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 | 315 | [[ -z "$kernelrelease" ]] && die "failed to get kernel version" |
| 311 | 316 | |
| 312 | 317 | sed -i "2i echo $kernelrelease; exit 0" scripts/setlocalversion |