It's incorrect to assume that the script directory will always match the
directory the script is executed from. Instead cache the directory at the
start of script execution in order to be able to get back to it if needed.
Fixes: 629ab8ddb775 ('livepatch-build-tools: do not use readlink -m option')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
# script.
SCRIPTDIR="$(readlink -f $(dirname $(type -p $0)))"
+WORKDIR="$(readlink -f -- .)"
CPUS="$(getconf _NPROCESSORS_ONLN)"
DEBUG=n
XEN_DEBUG=n
fi
if [ "${SKIP}" != "diff" ]; then
- cd "${SCRIPTDIR}" || die
+ cd "${WORKDIR}" || die
[ -d "$outputarg" ] || die "Output directory does not exist"
OUTPUT="$(readlink -f -- "$outputarg")"