This breaks pmbootstrap's hook handling.
Closes https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/work_items/2759
This reverts commit 38ccc2ac8a.
[ci:skip-vercheck]: These aren't "new" packages per se.
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8511>
51 lines
1.3 KiB
Bash
51 lines
1.3 KiB
Bash
#!/bin/sh
|
|
# shellcheck shell=busybox
|
|
|
|
# shellcheck source=../postmarketos-initramfs/init_functions.sh
|
|
. ./init_functions.sh
|
|
# shellcheck source=../devicepkg-utils/source_deviceinfo
|
|
. /usr/share/misc/source_deviceinfo
|
|
|
|
# Prints a given string a couple of times, over a span of time
|
|
# This helps paper over weirdness where the output may not flush
|
|
# as eagerly as expected, and the CI may miss the messages.
|
|
# This also helps if any messages would end-up interleaved.
|
|
_report_ci() {
|
|
local precision=1000
|
|
local duration=2
|
|
local count=3
|
|
while [ "$((count = count - 1))" -gt 0 ]; do
|
|
printf '%s\n' "$@"
|
|
sleep "$(printf '0.%03d' "$(( precision * duration / count ))")"
|
|
done
|
|
}
|
|
|
|
DID_FAIL=0
|
|
|
|
echo "==> Running postmarketos-mkinitfs-hook-ci"
|
|
|
|
for f in /usr/libexec/pmos-tests-initramfs/*; do
|
|
printf '\n==> Running test "%s"\n\n\n' "$f"
|
|
if $f; then
|
|
echo "==> OK: $f"
|
|
else
|
|
echo "==> FAIL: $f"
|
|
DID_FAIL=1
|
|
fi
|
|
done
|
|
|
|
if [ $DID_FAIL -ne 0 ]; then
|
|
_report_ci "==> PMOS-CI-FAIL"
|
|
else
|
|
_report_ci "==> PMOS-CI-OK"
|
|
fi
|
|
|
|
# We're done, kill it
|
|
# CDBA will exit if it sees 20 '~' characters
|
|
# in a row, send a whole bunch just to be sure
|
|
# In the worst case it will timeout.
|
|
_report_ci "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
|
|
|
|
# CI tests done, disabling console and looping forever
|
|
dmesg -n 1
|
|
fail_halt_boot
|