From: Pawel Wieczorkiewicz Date: Wed, 21 Aug 2019 08:20:39 +0000 (+0000) Subject: livepatch-build: Do not follow every symlink for patch file X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7b48f53cb287e753791b282e8a67c55961f49532;p=livepatch-build-tools.git livepatch-build: Do not follow every symlink for patch file 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 Reviewed-by: Martin Pohlack 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 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")"