From: Pawel Wieczorkiewicz Date: Wed, 21 Aug 2019 08:20:40 +0000 (+0000) Subject: livepatch-build: Handle newly created object files X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0e996c7a0c943d15d64265896e1ad53e3fa3f089;p=livepatch-build-tools.git livepatch-build: Handle newly created object files Up to now the livepatch-build ignores newly created object files. When patch applies new .c file and augments its Makefile to build it the resulting object file is not taken into account for final linking step. Such newly created object files can be detected by comparing patched/ and original/ directories and copied over to the output directory for the final linking step. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Norbert Manthey Reviewed-by: Ross Lagerwall Signed-off-by: Ross Lagerwall --- diff --git a/livepatch-build b/livepatch-build index 796838c..3c4bf13 100755 --- a/livepatch-build +++ b/livepatch-build @@ -146,6 +146,12 @@ function create_patch() fi done + NEW_FILES=$(comm -23 <(cd patched/xen && find . -type f -name '*.o' | sort) <(cd original/xen && find . -type f -name '*.o' | sort)) + for i in $NEW_FILES; do + cp "patched/$i" "output/$i" + CHANGED=1 + done + if [[ $ERROR -ne 0 ]]; then die "$ERROR error(s) encountered" fi