diff mbox series

[livepatch-build-tools,v2,4/4] livepatch-build: Handle newly created object files

Message ID 20190807111029.67766-1-wipawel@amazon.de (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Wieczorkiewicz, Pawel Aug. 7, 2019, 11:10 a.m. UTC
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 <wipawel@amazon.de>
Reviewed-by: Andra-Irina Paraschiv <andraprs@amazon.com>
Reviewed-by: Bjoern Doebel <doebel@amazon.de>
Reviewed-by: Norbert Manthey <nmanthey@amazon.de>
---
v2:
* Fixed paths to process only hypervisor changes
* Changing directory in subshells to simplified the command
---
 livepatch-build | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Ross Lagerwall Aug. 16, 2019, 8:54 a.m. UTC | #1
On 8/7/19 12:10 PM, Pawel Wieczorkiewicz wrote:
> 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 <wipawel@amazon.de>
> Reviewed-by: Andra-Irina Paraschiv <andraprs@amazon.com>
> Reviewed-by: Bjoern Doebel <doebel@amazon.de>
> Reviewed-by: Norbert Manthey <nmanthey@amazon.de>
> ---
> v2:
> * Fixed paths to process only hypervisor changes
> * Changing directory in subshells to simplified the command

Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>

Thanks
diff mbox series

Patch

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