[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [livepatch-build-tools 3/4] livepatch-build: Do not follow every symlink for patch file

On 4/29/19 4:24 PM, Wieczorkiewicz, Pawel wrote:

On 29. Apr 2019, at 14:40, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx> wrote:

On 4/8/19 9:32 AM, Pawel Wieczorkiewicz wrote:
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 <wipawel@xxxxxxxxx>
Reviewed-by: Martin Pohlack <mpohlack@xxxxxxxxx>
Reviewed-by: Bjoern Doebel <doebel@xxxxxxxxx>
Reviewed-by: Norbert Manthey <nmanthey@xxxxxxxxx>
  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")"

This works, but would it not be simpler to just pass $patcharg into 

No strong opinion here, but the readlink change felt less invasive (no changes 
to the existing semantics).

Thank you for looking into this.

OK, that's fine then.

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

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.