From 3c7bb4181fa4ea1a4bc74afaf453cadcfa19f201 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Thu, 18 Jul 2024 09:53:34 +0200 Subject: [PATCH] rename log files to .log, fix locale-archive false positive in testsuite --- usr/bin/archboot-binary-check.sh | 6 +++--- usr/bin/archboot-fw-check.sh | 14 ++++++------- usr/bin/archboot-not-installed.sh | 6 +++--- usr/bin/archboot-testsuite.sh | 34 +++++++++++++++---------------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/usr/bin/archboot-binary-check.sh b/usr/bin/archboot-binary-check.sh index 71ce682d9..352ef2090 100755 --- a/usr/bin/archboot-binary-check.sh +++ b/usr/bin/archboot-binary-check.sh @@ -7,7 +7,7 @@ _usage () { echo "Check on missing binaries in archboot environment" echo "-------------------------------------------------" echo "This will check binaries from package, if they exist" - echo "and report missing to binary.txt" + echo "and report missing to binary.log" echo "" echo "usage: ${_APPNAME} " exit 0 @@ -22,9 +22,9 @@ if [[ "${1}" == "base" ]]; then else _PACKAGE="${1}" fi -echo "${_PACKAGE}" >binary.txt +echo "${_PACKAGE}" >binary.log #shellcheck disable=SC2086 for i in $(pacman -Ql ${_PACKAGE} | rg -o '/usr/bin/..*$'); do - command -v "${i}" &>"${_NO_LOG}" || echo "${i}" >>binary.txt + command -v "${i}" &>"${_NO_LOG}" || echo "${i}" >>binary.log done # vim: set ft=sh ts=4 sw=4 et: diff --git a/usr/bin/archboot-fw-check.sh b/usr/bin/archboot-fw-check.sh index fad4e73bf..1b414b77f 100755 --- a/usr/bin/archboot-fw-check.sh +++ b/usr/bin/archboot-fw-check.sh @@ -15,15 +15,15 @@ _usage () { } [[ -z "${1}" || "${1}" != "run" ]] && _usage for i in $(fd -u -t f '.ko' "${_MODULE_DIR}"); do - modinfo -F firmware "${i}" >>modules.txt + modinfo -F firmware "${i}" >>modules.log done -fd -u -t f 'zst' "${_FIRMWARE}" >firmware.txt -cp firmware.txt firmware.orig.txt +fd -u -t f 'zst' "${_FIRMWARE}" >firmware.log +cp firmware.log firmware.orig.log while read -r i; do - sd "${i}" '' firmware.txt -done < modules.txt -rg -v 'amd|amss|atmel|ath[0-9]|board-2|brcm|cs42l43|htc_*|i915|imx|intel|iwlwifi|libertas|m3\.bin|mediatek|mrvl|mwl.*|mt7650|nvidia|radeon|regdb|rsi|rt[0-9][0-9]*|rtl|rtw8[8-9]|slicoss|ti-connect|ti_*|vpu_*|/.zst' firmware.txt > fw-error.txt -if [[ -s fw-error.txt ]]; then + sd "${i}" '' firmware.log +done < modules.log +rg -v 'amd|amss|atmel|ath[0-9]|board-2|brcm|cs42l43|htc_*|i915|imx|intel|iwlwifi|libertas|m3\.bin|mediatek|mrvl|mwl.*|mt7650|nvidia|radeon|regdb|rsi|rt[0-9][0-9]*|rtl|rtw8[8-9]|slicoss|ti-connect|ti_*|vpu_*|/.zst' firmware.log > fw-error.log +if [[ -s fw-error.log ]]; then exit 1 fi exit 0 diff --git a/usr/bin/archboot-not-installed.sh b/usr/bin/archboot-not-installed.sh index a706e55b7..04465c3ba 100755 --- a/usr/bin/archboot-not-installed.sh +++ b/usr/bin/archboot-not-installed.sh @@ -13,8 +13,8 @@ for i in $(pacman -Q | cut -d ' ' -f1); do #shellcheck disable=SC2086 rm -r "${_PACMAN_LIB}"/local/"$(pacman -Q ${i} | sd ' ' '-')" #shellcheck disable=SC2086 - if pacman -Sdd ${i} --noconfirm >>log.txt; then - echo "${i}" >> not-installed.orig.txt + if pacman -Sdd ${i} --noconfirm >>pacman.log; then + echo "${i}" >> not-installed.orig.log else #shellcheck disable=SC2086 pacman -Sdd ${i} --noconfirm --overwrite '*' @@ -28,5 +28,5 @@ done # linux-firmware-whence only license files # pacman-mirrorlist only /etc file # pambase only /etc files -rg -v "ca-certificates|dbus-broker-units|iana-etc|licenses|linux-firmware-whence|pacman-mirrorlist|pambase" not-installed.orig.txt >not-installed.txt +rg -v "ca-certificates|dbus-broker-units|iana-etc|licenses|linux-firmware-whence|pacman-mirrorlist|pambase" not-installed.orig.log >not-installed.log # vim: set ft=sh ts=4 sw=4 et: diff --git a/usr/bin/archboot-testsuite.sh b/usr/bin/archboot-testsuite.sh index ce1e6c1fa..ec5f62fd6 100755 --- a/usr/bin/archboot-testsuite.sh +++ b/usr/bin/archboot-testsuite.sh @@ -38,32 +38,32 @@ echo "Available Memory (M): $(rg -o 'Ava.* (.*)[0-9]{3} k' -r '$1' "${_NO_LOG}" | rg -o '(.*)M' -r '$1')" _run_test "journal" if ! journalctl -p3 -xb | rg -q 'No entries'; then - journalctl -p3 -xb >>journal-error.txt + journalctl -p3 -xb >>journal-error.log fi -_result journal-error.txt +_result journal-error.log _run_test "ldd" echo -n "/usr/bin " for i in /usr/bin/*; do if ldd "${i}" 2>"${_NO_LOG}" | rg -q 'not found'; then - echo "${i}" >>ldd-error.txt - ldd "${i}" | rg 'not found' >>ldd-error.txt + echo "${i}" >>ldd-error.log + ldd "${i}" | rg 'not found' >>ldd-error.log fi done echo -n "/usr/lib " for i in $(fd -u -t x -E '*.so.*' -E '*.so' -E 'ssh-sk-helper' . /usr/lib); do if ldd "${i}" 2>"${_NO_LOG}" | rg -q 'not found'; then - echo "${i}" >>ldd-error.txt - ldd "${i}" | rg 'not found' >>ldd-error.txt + echo "${i}" >>ldd-error.log + ldd "${i}" | rg 'not found' >>ldd-error.log fi done # ignore wrong reported libsystemd-shared by libsystemd-core for i in $(fd -u '.so' /usr/lib); do if ldd "${i}" 2>"${_NO_LOG}" | rg -v 'tree_sitter|libsystemd-shared' | rg -q 'not found'; then - echo "${i}" >>ldd-error.txt - ldd "${i}" | rg 'not found' >>ldd-error.txt + echo "${i}" >>ldd-error.log + ldd "${i}" | rg 'not found' >>ldd-error.log fi done -_result ldd-error.txt +_result ldd-error.log _run_test "on missing base binaries" # not needed binaries, that are tolerated _BASE_BLACKLIST="arpd backup bashbug enosys exch fsck.cramfs fsck.minix gawk-5.3.0 \ @@ -74,22 +74,22 @@ systemd-confext systemd-cryptsetup systemd-delta systemd-home-fallback-shell sys systemd-run systemd-vmspawn systemd-vpick varlinkctl xtrace" archboot-binary-check.sh base &>>"${_LOG}" #shellcheck disable=SC2013 -for i in $(rg '/usr/bin/(.*)' -r '$1' binary.txt); do +for i in $(rg '/usr/bin/(.*)' -r '$1' binary.log); do if ! echo "${_BASE_BLACKLIST}" | rg -qw "${i}"; then - echo "${i}" >> base-binary-error.txt + echo "${i}" >> base-binary-error.log fi done -_result base-binary-error.txt +_result base-binary-error.log _run_test "modules included /usr/lib/firmware" archboot-fw-check.sh run -_result fw-error.txt +_result fw-error.log # uninstall base again! pacman --noconfirm -Rdd base gettext &>>"${_LOG}" _run_test "licenses" for i in $(pacman -Ql $(pacman -Q | sd ' .*' '') | rg -o '/usr/share/licenses/.*'); do - [[ -e "${i}" ]] || echo "${i}" | rg -v '/xz/' >>license-error.txt + [[ -e "${i}" ]] || echo "${i}" | rg -v '/xz/' >>license-error.log done -_result license-error.txt +_result license-error.log _run_test "filesystems" dd if=/dev/zero of="${_IMG}" bs=1M count=1000 &>"${_NO_LOG}" sync @@ -161,7 +161,7 @@ _result iwctl-error.log echo -e "Starting none tracked files in \e[1m10\e[m seconds... \e[1;92mCTRL-C\e[m to stop now." sleep 10 _run_test "none tracked files in /usr/lib... this takes a while" -for i in $(fd -u -E '/modules/' -E '/udev/' -E 'gconv-modules.cache' -E '/locale-archive' . /usr/lib); do +for i in $(fd -u -E '/modules/' -E '/udev/' -E 'gconv-modules.cache' -E 'locale-archive' . /usr/lib); do #shellcheck disable=SC2086 pacman -Qo ${i} &>${_NO_LOG} || echo ${i} >> pacman-error.log done @@ -170,7 +170,7 @@ echo -e "Starting pacman database check in \e[1m10\e[m seconds... \e[1;92mCTRL-C sleep 10 _run_test "pacman database... this takes a while" archboot-not-installed.sh &>>"${_LOG}" -_result not-installed.txt +_result not-installed.log echo -e "\e[1mResult:\e[m" if [[ -z "${_TEST_FAIL}" ]]; then echo -e "\e[1;94m=> \e[1;92mAll tests finished successfully.\e[m"