diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 9485fb7..f4a9013 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -248,11 +248,13 @@ cd "$TEMPDIR/orig" FILES="$(find * -type f)" cd "$TEMPDIR" mkdir output +changed=0 for i in $FILES; do mkdir -p "output/$(dirname $i)" "$TOOLSDIR"/create-diff-object "orig/$i" "patched/$i" "output/$i" 2>&1 |tee -a "$LOGFILE" - [[ "${PIPESTATUS[0]}" -eq 0 ]] || die + [[ "${PIPESTATUS[0]}" -eq 0 ]] && changed=$((changed+1)) done +[[ "$changed" -gt 0 ]] || die "Fatal: all generated objects has no changed function." echo "Building patch module: kpatch-$PATCHNAME.ko" cp "$OBJDIR/.config" "$SRCDIR"