mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
rename log files to .log, fix locale-archive false positive in testsuite
This commit is contained in:
parent
8b3618a991
commit
3c7bb4181f
4 changed files with 30 additions and 30 deletions
|
@ -7,7 +7,7 @@ _usage () {
|
||||||
echo "Check on missing binaries in archboot environment"
|
echo "Check on missing binaries in archboot environment"
|
||||||
echo "-------------------------------------------------"
|
echo "-------------------------------------------------"
|
||||||
echo "This will check binaries from package, if they exist"
|
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 ""
|
||||||
echo "usage: ${_APPNAME} <package>"
|
echo "usage: ${_APPNAME} <package>"
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -22,9 +22,9 @@ if [[ "${1}" == "base" ]]; then
|
||||||
else
|
else
|
||||||
_PACKAGE="${1}"
|
_PACKAGE="${1}"
|
||||||
fi
|
fi
|
||||||
echo "${_PACKAGE}" >binary.txt
|
echo "${_PACKAGE}" >binary.log
|
||||||
#shellcheck disable=SC2086
|
#shellcheck disable=SC2086
|
||||||
for i in $(pacman -Ql ${_PACKAGE} | rg -o '/usr/bin/..*$'); do
|
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
|
done
|
||||||
# vim: set ft=sh ts=4 sw=4 et:
|
# vim: set ft=sh ts=4 sw=4 et:
|
||||||
|
|
|
@ -15,15 +15,15 @@ _usage () {
|
||||||
}
|
}
|
||||||
[[ -z "${1}" || "${1}" != "run" ]] && _usage
|
[[ -z "${1}" || "${1}" != "run" ]] && _usage
|
||||||
for i in $(fd -u -t f '.ko' "${_MODULE_DIR}"); do
|
for i in $(fd -u -t f '.ko' "${_MODULE_DIR}"); do
|
||||||
modinfo -F firmware "${i}" >>modules.txt
|
modinfo -F firmware "${i}" >>modules.log
|
||||||
done
|
done
|
||||||
fd -u -t f 'zst' "${_FIRMWARE}" >firmware.txt
|
fd -u -t f 'zst' "${_FIRMWARE}" >firmware.log
|
||||||
cp firmware.txt firmware.orig.txt
|
cp firmware.log firmware.orig.log
|
||||||
while read -r i; do
|
while read -r i; do
|
||||||
sd "${i}" '' firmware.txt
|
sd "${i}" '' firmware.log
|
||||||
done < modules.txt
|
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.txt > fw-error.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.log > fw-error.log
|
||||||
if [[ -s fw-error.txt ]]; then
|
if [[ -s fw-error.log ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -13,8 +13,8 @@ for i in $(pacman -Q | cut -d ' ' -f1); do
|
||||||
#shellcheck disable=SC2086
|
#shellcheck disable=SC2086
|
||||||
rm -r "${_PACMAN_LIB}"/local/"$(pacman -Q ${i} | sd ' ' '-')"
|
rm -r "${_PACMAN_LIB}"/local/"$(pacman -Q ${i} | sd ' ' '-')"
|
||||||
#shellcheck disable=SC2086
|
#shellcheck disable=SC2086
|
||||||
if pacman -Sdd ${i} --noconfirm >>log.txt; then
|
if pacman -Sdd ${i} --noconfirm >>pacman.log; then
|
||||||
echo "${i}" >> not-installed.orig.txt
|
echo "${i}" >> not-installed.orig.log
|
||||||
else
|
else
|
||||||
#shellcheck disable=SC2086
|
#shellcheck disable=SC2086
|
||||||
pacman -Sdd ${i} --noconfirm --overwrite '*'
|
pacman -Sdd ${i} --noconfirm --overwrite '*'
|
||||||
|
@ -28,5 +28,5 @@ done
|
||||||
# linux-firmware-whence only license files
|
# linux-firmware-whence only license files
|
||||||
# pacman-mirrorlist only /etc file
|
# pacman-mirrorlist only /etc file
|
||||||
# pambase only /etc files
|
# 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:
|
# vim: set ft=sh ts=4 sw=4 et:
|
||||||
|
|
|
@ -38,32 +38,32 @@ echo "Available Memory (M): $(rg -o 'Ava.* (.*)[0-9]{3} k' -r '$1' </proc/meminf
|
||||||
Rootfs Size (M): $(du -sh / 2>"${_NO_LOG}" | rg -o '(.*)M' -r '$1')"
|
Rootfs Size (M): $(du -sh / 2>"${_NO_LOG}" | rg -o '(.*)M' -r '$1')"
|
||||||
_run_test "journal"
|
_run_test "journal"
|
||||||
if ! journalctl -p3 -xb | rg -q 'No entries'; then
|
if ! journalctl -p3 -xb | rg -q 'No entries'; then
|
||||||
journalctl -p3 -xb >>journal-error.txt
|
journalctl -p3 -xb >>journal-error.log
|
||||||
fi
|
fi
|
||||||
_result journal-error.txt
|
_result journal-error.log
|
||||||
_run_test "ldd"
|
_run_test "ldd"
|
||||||
echo -n "/usr/bin "
|
echo -n "/usr/bin "
|
||||||
for i in /usr/bin/*; do
|
for i in /usr/bin/*; do
|
||||||
if ldd "${i}" 2>"${_NO_LOG}" | rg -q 'not found'; then
|
if ldd "${i}" 2>"${_NO_LOG}" | rg -q 'not found'; then
|
||||||
echo "${i}" >>ldd-error.txt
|
echo "${i}" >>ldd-error.log
|
||||||
ldd "${i}" | rg 'not found' >>ldd-error.txt
|
ldd "${i}" | rg 'not found' >>ldd-error.log
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo -n "/usr/lib "
|
echo -n "/usr/lib "
|
||||||
for i in $(fd -u -t x -E '*.so.*' -E '*.so' -E 'ssh-sk-helper' . /usr/lib); do
|
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
|
if ldd "${i}" 2>"${_NO_LOG}" | rg -q 'not found'; then
|
||||||
echo "${i}" >>ldd-error.txt
|
echo "${i}" >>ldd-error.log
|
||||||
ldd "${i}" | rg 'not found' >>ldd-error.txt
|
ldd "${i}" | rg 'not found' >>ldd-error.log
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# ignore wrong reported libsystemd-shared by libsystemd-core
|
# ignore wrong reported libsystemd-shared by libsystemd-core
|
||||||
for i in $(fd -u '.so' /usr/lib); do
|
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
|
if ldd "${i}" 2>"${_NO_LOG}" | rg -v 'tree_sitter|libsystemd-shared' | rg -q 'not found'; then
|
||||||
echo "${i}" >>ldd-error.txt
|
echo "${i}" >>ldd-error.log
|
||||||
ldd "${i}" | rg 'not found' >>ldd-error.txt
|
ldd "${i}" | rg 'not found' >>ldd-error.log
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
_result ldd-error.txt
|
_result ldd-error.log
|
||||||
_run_test "on missing base binaries"
|
_run_test "on missing base binaries"
|
||||||
# not needed binaries, that are tolerated
|
# not needed binaries, that are tolerated
|
||||||
_BASE_BLACKLIST="arpd backup bashbug enosys exch fsck.cramfs fsck.minix gawk-5.3.0 \
|
_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"
|
systemd-run systemd-vmspawn systemd-vpick varlinkctl xtrace"
|
||||||
archboot-binary-check.sh base &>>"${_LOG}"
|
archboot-binary-check.sh base &>>"${_LOG}"
|
||||||
#shellcheck disable=SC2013
|
#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
|
if ! echo "${_BASE_BLACKLIST}" | rg -qw "${i}"; then
|
||||||
echo "${i}" >> base-binary-error.txt
|
echo "${i}" >> base-binary-error.log
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
_result base-binary-error.txt
|
_result base-binary-error.log
|
||||||
_run_test "modules included /usr/lib/firmware"
|
_run_test "modules included /usr/lib/firmware"
|
||||||
archboot-fw-check.sh run
|
archboot-fw-check.sh run
|
||||||
_result fw-error.txt
|
_result fw-error.log
|
||||||
# uninstall base again!
|
# uninstall base again!
|
||||||
pacman --noconfirm -Rdd base gettext &>>"${_LOG}"
|
pacman --noconfirm -Rdd base gettext &>>"${_LOG}"
|
||||||
_run_test "licenses"
|
_run_test "licenses"
|
||||||
for i in $(pacman -Ql $(pacman -Q | sd ' .*' '') | rg -o '/usr/share/licenses/.*'); do
|
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
|
done
|
||||||
_result license-error.txt
|
_result license-error.log
|
||||||
_run_test "filesystems"
|
_run_test "filesystems"
|
||||||
dd if=/dev/zero of="${_IMG}" bs=1M count=1000 &>"${_NO_LOG}"
|
dd if=/dev/zero of="${_IMG}" bs=1M count=1000 &>"${_NO_LOG}"
|
||||||
sync
|
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."
|
echo -e "Starting none tracked files in \e[1m10\e[m seconds... \e[1;92mCTRL-C\e[m to stop now."
|
||||||
sleep 10
|
sleep 10
|
||||||
_run_test "none tracked files in /usr/lib... this takes a while"
|
_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
|
#shellcheck disable=SC2086
|
||||||
pacman -Qo ${i} &>${_NO_LOG} || echo ${i} >> pacman-error.log
|
pacman -Qo ${i} &>${_NO_LOG} || echo ${i} >> pacman-error.log
|
||||||
done
|
done
|
||||||
|
@ -170,7 +170,7 @@ echo -e "Starting pacman database check in \e[1m10\e[m seconds... \e[1;92mCTRL-C
|
||||||
sleep 10
|
sleep 10
|
||||||
_run_test "pacman database... this takes a while"
|
_run_test "pacman database... this takes a while"
|
||||||
archboot-not-installed.sh &>>"${_LOG}"
|
archboot-not-installed.sh &>>"${_LOG}"
|
||||||
_result not-installed.txt
|
_result not-installed.log
|
||||||
echo -e "\e[1mResult:\e[m"
|
echo -e "\e[1mResult:\e[m"
|
||||||
if [[ -z "${_TEST_FAIL}" ]]; then
|
if [[ -z "${_TEST_FAIL}" ]]; then
|
||||||
echo -e "\e[1;94m=> \e[1;92mAll tests finished successfully.\e[m"
|
echo -e "\e[1;94m=> \e[1;92mAll tests finished successfully.\e[m"
|
||||||
|
|
Loading…
Reference in a new issue