Files
bananarchy/prepare-release.sh
T

50 lines
1.6 KiB
Bash
Raw Normal View History

2026-10-25 20:44:10 +02:00
#!/bin/sh
# Release archive builder for Bananarchy
2026-11-08 09:56:01 +02:00
set -eu
BA_TARGET="${1:-nokia-argon}"
BA_REBUILD="${BA_REBUILD:-0}"
2026-11-08 09:56:01 +02:00
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"
display_lk2nd_is_current() {
python3 scripts/check-lk2nd-beatles.py \
--image "$DISPLAY_IMAGE" \
--patch bootloader/lk2nd/nokia-beatles.patch \
--expect-fastboot 0 --expect-display 1 >/dev/null 2>&1
}
2026-11-08 09:56:01 +02:00
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
fi
if [ "$BA_REBUILD" = "1" ] || [ "$NEED_REBUILD" = "1" ]; then
./rebuild-image.sh "$BA_TARGET" --mkinitfs
fi
# The default 2720 lk2nd image must contain the low-bit reboot cookie, or
# "Reboot to loader" cannot return to the visible Fastboot menu.
if [ "$BA_TARGET" = "nokia-beatles" ] && \
{ [ "$BA_REBUILD" = "1" ] || ! display_lk2nd_is_current; }; then
./scripts/build-lk2nd-beatles.sh
fi
2026-11-08 09:56:01 +02:00
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 "$DISPLAY_IMAGE" "$RELDIR/"
else
cp bootloader/lk2nd-msm8909.img "$RELDIR/"
fi
2026-11-08 09:56:01 +02:00
zip -9r "${RELDIR}.zip" "$RELDIR"
rm -rf "$RELDIR"
echo "Release $BA_VER ($BA_CODENAME) for $BA_TARGET packed into ${RELDIR}.zip"