From fb5dbc2fc56ff89835ff4a8629d6ccf5b53739e1 Mon Sep 17 00:00:00 2001 From: Seth Jennings Date: Fri, 8 Aug 2014 10:06:30 -0500 Subject: [PATCH] allow for unchanged objects There are situations in which an object may be rebuilt but have no functional changes, such as a change to an included header file. This commit changes kpatch-build to tolerate individual unchanged objects so long as there is, in the end, at least one changed object. Signed-off-by: Seth Jennings --- kpatch-build/kpatch-build | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 0d088bd..765cc77 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -417,11 +417,11 @@ FILES="$(find * -type f)" cd "$TEMPDIR" mkdir output declare -A objnames +CHANGED=0 for i in $FILES; do mkdir -p "output/$(dirname $i)" cd "$OBJDIR" find_kobj $i - objnames[$KOBJFILE]=1 if [[ $KOBJFILE = vmlinux ]]; then KOBJFILE=$VMLINUX else @@ -442,9 +442,18 @@ for i in $FILES; do fi exit 1 fi - [[ $rc -eq 0 ]] || die + # create-diff-object returns 3 if no functional change is found + [[ $rc -eq 0 ]] || [[ $rc -eq 3 ]] || die + if [[ $rc -eq 0 ]]; then + CHANGED=1 + objnames[$KOBJFILE]=1 + fi done +if [[ $CHANGED -eq 0 ]]; then + die "no functional changes found" +fi + echo -n "Patched objects:" for i in "${!objnames[@]}"; do echo -n " $(basename $i)"; done echo