Harden prepare-release.sh beatles boot validation and archive creation

- Normalize target aliases and decouple boot-lk2nd-nokia-beatles-display.img rebuilds from rebuild-image.sh so a missing lk2nd image does not rebuild the verified raw image
- Run check-beatles-bootimg.py, sync-beatles-bootfs.py --check, and display_lk2nd_is_current before archiving nokia-beatles
- Remove pre-existing release directories and .zip files before packing both boot-bananarchy-nokia-beatles.img and boot-lk2nd-nokia-beatles-display.img, and guard in check-rebuild.sh
This commit is contained in:
Luxferre committed 2026-11-11 14:59:02 +02:00
1 parent 83c8db10f1
commit 9fc82fb7d8
3 files changed
+39 -8

No files matched your search

+26 -7
View File
@@ -2,12 +2,25 @@
# Release archive builder for Bananarchy
set -eu
BA_TARGET="${1:-nokia-argon}"
RAW_TARGET="${1:-nokia-argon}"
case "$RAW_TARGET" in
nokia-argon|argon) BA_TARGET="nokia-argon" ;;
nokia-beatles|beatles) BA_TARGET="nokia-beatles" ;;
nokia-tough|nokia-coconut|tough|coconut) BA_TARGET="nokia-tough" ;;
nokia-sparkler|sparkler) BA_TARGET="nokia-sparkler" ;;
nokia-leo|leo) BA_TARGET="nokia-leo" ;;
*)
echo "Usage: $0 [nokia-argon|nokia-beatles|nokia-tough|nokia-sparkler|nokia-leo]" >&2
exit 1
;;
esac
BA_REBUILD="${BA_REBUILD:-0}"
BA_VER="$(./scripts/version.sh --print)"
BA_CODENAME="$(./scripts/version.sh --print-codename)"
RELDIR="bananarchy-${BA_TARGET}-${BA_VER}-${BA_CODENAME}"
DISPLAY_IMAGE="images/boot-lk2nd-nokia-beatles-display.img"
BOOT_IMAGE="images/boot-bananarchy-nokia-beatles.img"
display_lk2nd_is_current() {
python3 scripts/check-lk2nd-beatles.py \
@@ -20,10 +33,8 @@ NEED_REBUILD=0
if [ ! -f "images/bananarchy-${BA_TARGET}.img" ]; then
NEED_REBUILD=1
fi
if [ "$BA_TARGET" = "nokia-beatles" ]; then
for f in images/boot-bananarchy-nokia-beatles.img "$DISPLAY_IMAGE"; do
[ -f "$f" ] || NEED_REBUILD=1
done
if [ "$BA_TARGET" = "nokia-beatles" ] && [ ! -f "$BOOT_IMAGE" ]; then
NEED_REBUILD=1
fi
if [ "$BA_REBUILD" = "1" ] || [ "$NEED_REBUILD" = "1" ]; then
@@ -31,16 +42,24 @@ if [ "$BA_REBUILD" = "1" ] || [ "$NEED_REBUILD" = "1" ]; then
fi
# The default 2720 lk2nd image must contain the low-bit reboot cookie, or
# "Reboot to loader" cannot return to the visible Fastboot menu.
# "Reboot to loader" cannot return to the visible Fastboot menu. Rebuild it
# separately so a missing lk2nd binary does not invalidate a verified raw image.
if [ "$BA_TARGET" = "nokia-beatles" ] && \
{ [ "$BA_REBUILD" = "1" ] || ! display_lk2nd_is_current; }; then
./scripts/build-lk2nd-beatles.sh
fi
if [ "$BA_TARGET" = "nokia-beatles" ]; then
python3 scripts/check-beatles-bootimg.py
python3 scripts/sync-beatles-bootfs.py --check --raw-image "images/bananarchy-${BA_TARGET}.img"
display_lk2nd_is_current
fi
rm -rf "$RELDIR" "${RELDIR}.zip"
mkdir -p "$RELDIR"
cp "images/bananarchy-${BA_TARGET}.img" "$RELDIR/"
if [ "$BA_TARGET" = "nokia-beatles" ]; then
cp images/boot-bananarchy-nokia-beatles.img "$RELDIR/"
cp "$BOOT_IMAGE" "$RELDIR/"
cp "$DISPLAY_IMAGE" "$RELDIR/"
else
cp bootloader/lk2nd-msm8909.img "$RELDIR/"