mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 04:06:33 +02:00
common: Kill the verbose mount, df and dmesg logging on every failure
This was introduced to see if it can help us pinpoint some weird issues we used to have when suddenly we were not able to create a directory or stuff like that. It was actually never useful, and is always annoying to scroll through this output to see the actual error that caused the build to fail. Signed-off-by: Krzesimir Nowak <knowak@microsoft.com>
This commit is contained in:
parent
7c3ca9c250
commit
52c5134e1c
33
common.sh
33
common.sh
@ -164,40 +164,9 @@ die_notrace() {
|
||||
for line in "$@"; do
|
||||
error "${DIE_PREFIX}${line}"
|
||||
done
|
||||
if [[ ! -e "${SCRIPTS_DIR}/NO_DEBUG_OUTPUT_DELETE_ME" ]]; then
|
||||
error "${DIE_PREFIX}!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
error "${DIE_PREFIX}!! BEGIN DEBUG OUTPUT: !!"
|
||||
error "${DIE_PREFIX}!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
error
|
||||
error "${DIE_PREFIX}== MOUNT =="
|
||||
error "${DIE_PREFIX}==========="
|
||||
error_command_output "${DIE_PREFIX}" mount
|
||||
error
|
||||
error "${DIE_PREFIX}== DF =="
|
||||
error "${DIE_PREFIX}========"
|
||||
error_command_output "${DIE_PREFIX}" df -h
|
||||
error
|
||||
error "${DIE_PREFIX}== DMESG =="
|
||||
error "${DIE_PREFIX}==========="
|
||||
error_command_output "${DIE_PREFIX}" sudo dmesg
|
||||
error
|
||||
error "${DIE_PREFIX}!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
error "${DIE_PREFIX}!! END DEBUG OUTPUT: !!"
|
||||
error "${DIE_PREFIX}!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
touch "${SCRIPTS_DIR}/NO_DEBUG_OUTPUT_DELETE_ME"
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
|
||||
error_command_output() {
|
||||
local prefix=${1}; shift
|
||||
# rest are a command to execute
|
||||
local REPLY
|
||||
while read -r; do
|
||||
error "${prefix}${REPLY}"
|
||||
done < <("${@}" 2>&1)
|
||||
}
|
||||
|
||||
# Simple version comparison routine
|
||||
# Note: not a true semver comparison and build revisions are ignored
|
||||
cmp_ver() {
|
||||
@ -325,8 +294,6 @@ BUILD_LIBRARY_DIR="${SCRIPTS_DIR}/build_library"
|
||||
REPO_CACHE_DIR="${REPO_ROOT}/.cache"
|
||||
REPO_MANIFESTS_DIR="${REPO_ROOT}/.repo/manifests"
|
||||
|
||||
rm -f "${SCRIPTS_DIR}/NO_DEBUG_OUTPUT_DELETE_ME" || :
|
||||
|
||||
# Source FLATCAR_VERSION_ID from manifest.
|
||||
if [[ -f "${REPO_MANIFESTS_DIR}/version.txt" ]]; then
|
||||
# The build id may be provided externally by the build system.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user