In some build systems symlinks might be used for patch file names
to point from target directories to actual patches. Following those
symlinks breaks naming convention as the resulting built modules
would be named after the actual hardlink insteads of the symlink.

Livepatch-build obtains hotpatch name from the patch file, so it
should not canonicalize the file path resolving all the symlinks to
not lose the original symlink name.

Signed-off-by: Pawel Wieczorkiewicz <wipa...@amazon.de>
Reviewed-by: Martin Pohlack <mpohl...@amazon.de>
Reviewed-by: Bjoern Doebel <doe...@amazon.de>
Reviewed-by: Norbert Manthey <nmant...@amazon.de>
Reviewed-by: Ross Lagerwall <ross.lagerw...@citrix.com>
---
 livepatch-build | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/livepatch-build b/livepatch-build
index c057fa1..796838c 100755
--- a/livepatch-build
+++ b/livepatch-build
@@ -265,7 +265,9 @@ done
 [ -z "$DEPENDS" ] && die "Build-id dependency not given"
 
 SRCDIR="$(readlink -m -- "$srcarg")"
-PATCHFILE="$(readlink -m -- "$patcharg")"
+# We need an absolute path because we move around, but we need to
+# retain the name of the symlink (= realpath -s)
+PATCHFILE="$(readlink -f "$(dirname "$patcharg")")/$(basename "$patcharg")"
 CONFIGFILE="$(readlink -m -- "$configarg")"
 OUTPUT="$(readlink -m -- "$outputarg")"
 
-- 
2.16.5




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to