- Add 0013 early-SCM 4-core SMP + cpufreq kernel patch and clock-frequency DT nodes - Complete nokia-sparkler lk2nd port, boot/X11 session startup, 180-deg cached camera, and 157 Hz haptic audio - Replace root-only timer backend with permissionless sxmo_timer.sh and keypad/hook cancellation - Fix EDL Firehose rawmode ACK, USB active-config preservation, *+# hint, and 30 s default USB timeout - Sync a1120 (cocojamboo) prebuilts, docs, tests, and verified checksums in check-rebuild.sh
108 lines
3.5 KiB
Bash
Executable File
108 lines
3.5 KiB
Bash
Executable File
#!/bin/sh
|
|
# Release archive builder for Bananarchy
|
|
set -eu
|
|
|
|
RAW_TARGET="${1:-nokia-argon}"
|
|
case "$RAW_TARGET" in
|
|
nokia-argon|argon) BA_TARGET="nokia-argon" ;;
|
|
nokia-beatles|beatles) BA_TARGET="nokia-beatles" ;;
|
|
nokia-coconut|nokia-tough|coconut|tough) BA_TARGET="nokia-coconut" ;;
|
|
nokia-sparkler|sparkler) BA_TARGET="nokia-sparkler" ;;
|
|
nokia-leo|leo) BA_TARGET="nokia-leo" ;;
|
|
*)
|
|
echo "Usage: $0 [nokia-argon|nokia-beatles|nokia-coconut|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=""
|
|
BOOT_IMAGE=""
|
|
case "$BA_TARGET" in
|
|
nokia-beatles)
|
|
DISPLAY_IMAGE="images/boot-lk2nd-nokia-beatles-display.img"
|
|
BOOT_IMAGE="images/boot-bananarchy-nokia-beatles.img"
|
|
;;
|
|
nokia-coconut)
|
|
DISPLAY_IMAGE="images/boot-lk2nd-nokia-coconut-display.img"
|
|
BOOT_IMAGE="images/boot-bananarchy-nokia-coconut.img"
|
|
;;
|
|
nokia-sparkler)
|
|
DISPLAY_IMAGE="images/boot-lk2nd-nokia-sparkler-display.img"
|
|
BOOT_IMAGE="images/boot-bananarchy-nokia-sparkler.img"
|
|
;;
|
|
esac
|
|
|
|
display_lk2nd_is_current() {
|
|
case "$BA_TARGET" in
|
|
nokia-beatles)
|
|
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
|
|
;;
|
|
nokia-coconut)
|
|
python3 scripts/check-lk2nd-coconut.py \
|
|
--image "$DISPLAY_IMAGE" \
|
|
--base-patch bootloader/lk2nd/nokia-beatles.patch \
|
|
--patch bootloader/lk2nd/nokia-coconut.patch \
|
|
--expect-fastboot 0 --expect-display 1 >/dev/null 2>&1
|
|
;;
|
|
nokia-sparkler)
|
|
python3 scripts/check-lk2nd-sparkler.py \
|
|
--image "$DISPLAY_IMAGE" \
|
|
--beatles-patch bootloader/lk2nd/nokia-beatles.patch \
|
|
--coconut-patch bootloader/lk2nd/nokia-coconut.patch \
|
|
--patch bootloader/lk2nd/nokia-sparkler.patch \
|
|
--expect-fastboot 0 --expect-display 1 >/dev/null 2>&1
|
|
;;
|
|
*) return 1 ;;
|
|
esac
|
|
}
|
|
|
|
NEED_REBUILD=0
|
|
if [ ! -f "images/bananarchy-${BA_TARGET}.img" ]; then
|
|
NEED_REBUILD=1
|
|
fi
|
|
if [ -n "$BOOT_IMAGE" ] && [ ! -f "$BOOT_IMAGE" ]; then
|
|
NEED_REBUILD=1
|
|
fi
|
|
|
|
if [ "$BA_REBUILD" = "1" ] || [ "$NEED_REBUILD" = "1" ]; then
|
|
./rebuild-image.sh "$BA_TARGET" --mkinitfs
|
|
fi
|
|
|
|
# The default 2720/800 Tough lk2nd image must contain the low-bit reboot cookie,
|
|
# or "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 [ -n "$DISPLAY_IMAGE" ] && \
|
|
{ [ "$BA_REBUILD" = "1" ] || ! display_lk2nd_is_current; }; then
|
|
case "$BA_TARGET" in
|
|
nokia-beatles) ./scripts/build-lk2nd-beatles.sh ;;
|
|
nokia-coconut) ./scripts/build-lk2nd-coconut.sh ;;
|
|
nokia-sparkler) ./scripts/build-lk2nd-sparkler.sh ;;
|
|
esac
|
|
fi
|
|
|
|
if [ -n "$DISPLAY_IMAGE" ]; then
|
|
python3 scripts/check-beatles-bootimg.py --device "$BA_TARGET"
|
|
python3 scripts/sync-beatles-bootfs.py --check --device "$BA_TARGET" --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 [ -n "$DISPLAY_IMAGE" ]; then
|
|
cp "$BOOT_IMAGE" "$RELDIR/"
|
|
cp "$DISPLAY_IMAGE" "$RELDIR/"
|
|
else
|
|
cp bootloader/lk2nd-msm8909.img "$RELDIR/"
|
|
fi
|
|
zip -9r "${RELDIR}.zip" "$RELDIR"
|
|
rm -rf "$RELDIR"
|
|
echo "Release $BA_VER ($BA_CODENAME) for $BA_TARGET packed into ${RELDIR}.zip"
|