Skip to content

Commit

Permalink
dbginfo.sh: handle relative and absolute calling path
Browse files Browse the repository at this point in the history
include the dbginfo.sh script used - enabled for relative paths

Reviewed-by: Michael Storzer <mstorzer@de.ibm.com>
Signed-off-by: Joern Siglen <siglen@de.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
  • Loading branch information
jsiglen authored and hoeppnerj committed Jan 12, 2024
1 parent 43c3495 commit 58ef99f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -32,6 +32,7 @@ Release history for s390-tools (MIT version)
- zipl/boot: compile the bootloaders only if HOST_ARCH is s390x
- zipl: Add --no-compress option to zipl command
- zkey: Also check for deconfigured and check-stopped cards
- dbginfo.sh: fix relative path on script copy

Bug Fixes:
- ap_tools/ap-check: handle get-attributes between pre and post event
Expand Down
8 changes: 5 additions & 3 deletions scripts/dbginfo.sh
Expand Up @@ -15,6 +15,7 @@ export LC_ALL
########################################
# Global used variables
readonly SCRIPTNAME="${0##*/}" # general name of this script
readonly STARTDIR="$(pwd)" # save calling directory
#
readonly DATETIME="$(date +%Y-%m-%d-%H-%M-%S 2>/dev/null)"
readonly DOCKER=$(if type docker >/dev/null 2>&1; then echo "YES"; else echo "NO"; fi)
Expand Down Expand Up @@ -1411,10 +1412,11 @@ environment_setup() {
create_package() {
local rc_tar
pr_syslog_stdout ${step_num} "Finalizing: Creating archive with collected data"
# get a copy of the script used - enabled for relative path calls
cd "${STARTDIR}"
cp -p "${BASH_SOURCE[0]}" "${WORKPATH}"
# create the archive
cd "${WORKDIR_BASE}"
# get a copy of the script used
cp -p $0 "${WORKDIR_CURRENT}"

touch "${WORKARCHIVE}"
chmod 0600 "${WORKARCHIVE}"
tar -czf "${WORKARCHIVE}" "${WORKDIR_CURRENT}"
Expand Down

0 comments on commit 58ef99f

Please sign in to comment.