From 2fd23726050b2dc6d56928bea9bc3553935db201 Mon Sep 17 00:00:00 2001 From: "Guilherme G. Piccoli" Date: Wed, 26 Jan 2022 15:46:09 -0300 Subject: [PATCH] Change dump compression to ZIP In order to make the dump "tarball" easy for consumption in both Windows and Linux (and maybe more OS styles), we changed here the compression format to ZIP; also, we're not creating a tarball anymore, just a simple ZIP file with all the logs collected, no directory structure. Signed-off-by: Guilherme G. Piccoli --- PKGBUILD | 4 ++-- submit_report.sh | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 62af08f..299a91b 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -7,7 +7,7 @@ pkgname=kdump-steamos pkgver=0.3 pkgrel=1 pkgdesc="Kdump scripts to collect vmcore/dmesg in a small dracut-based initramfs" -depends=('dmidecode' 'dracut' 'kexec-tools' 'makedumpfile' 'systemd' 'zstd') +depends=('dmidecode' 'dracut' 'kexec-tools' 'makedumpfile' 'systemd' 'zip' 'zstd') arch=('x86_64') license=('GPL2') install=kdump-steamos.install @@ -31,7 +31,7 @@ sha256sums=('dbedff54addfb5dce51614c73df04c90fca9f27d0d3a690243259ccbbfcca07c' '12a9124b907f208471ba7aaac0f3261cbbd34a168cce3260fa9e7793994beebd' '26bc2b64af0d468f050c0e0dd9e2053176d56886edad9146bc495797bf2c5810' 'b87fb8e4c4602f8ddc3b0bf6d6175d0ee7b9e0942f4dca8f1b958ed3ad445470' - 'd8b432dc1602e330e61c91a8f9e6761273ff2ca8129f457828ff0d20ac6d5b25' + '8f974b51f6fcf5ec4ae8bb9d585390d4354cf8d99ae98e0efe9484f08abb1949' 'cbb207ecc0f6bacefbeed41f0d4910daac6500ac2345366e1f95f09a7653c65a') package() { diff --git a/submit_report.sh b/submit_report.sh index 33ceac3..e77cd14 100755 --- a/submit_report.sh +++ b/submit_report.sh @@ -57,6 +57,9 @@ if [ "${PSTORE_CNT}" -ne 0 ]; then done LOGS_FOUND=${LOOP_CNT} + # Logs should live on logs/ folder (no subfolders), due to the zip file + mv ${PSTORE_FOLDER}/* "${KDUMP_LOGS_FOLDER}/" 2>/dev/null + # Enter the else block in case we don't have pstore logs - maybe we # have kdump logs then. else @@ -94,6 +97,9 @@ else done LOGS_FOUND=$((LOGS_FOUND + LOOP_CNT)) + + # Logs should live on logs/ folder (no subfolders), due to the zip file + mv ${KD_FOLDER}/* "${KDUMP_LOGS_FOLDER}/" 2>/dev/null fi fi @@ -135,14 +141,13 @@ if [ ${LOGS_FOUND} -ne 0 ]; then uname -r > "${KDUMP_LOGS_FOLDER}/version.${CURRENT_TSTAMP}" # Create the dump compressed pack. - LOG_FNAME="steamos-${SN}-${STEAM_ACCOUNT}.${CURRENT_TSTAMP}.tar" + LOG_FNAME="steamos-${SN}-${STEAM_ACCOUNT}.${CURRENT_TSTAMP}.zip" LOG_FNAME="${KDUMP_MAIN_FOLDER}/${LOG_FNAME}" - tar cf "${LOG_FNAME}" "${KDUMP_LOGS_FOLDER}" 1>/dev/null 2>&1 - zstd < "${LOG_FNAME}" > "${LOG_FNAME}.zst" - sync "${LOG_FNAME}.zst" - rm -rf "${KDUMP_LOGS_FOLDER}" "${LOG_FNAME}" + zip -9 -jq "${LOG_FNAME}" ${KDUMP_LOGS_FOLDER}/* 1>/dev/null 2>&1 + sync "${LOG_FNAME}" + rm -rf "${KDUMP_LOGS_FOLDER}" - # TODO: implement a log submission mechanism, in order to send the zstd file + # TODO: implement a log submission mechanism, in order to send the zip file # to Valve servers through an API. fi