Files
Abdurrahman Kaan DikeçandClaude Opus 5.5 0aa83038ce Retire kernel 7.2: releases ship 5.4, 6.18 and 7.3; devices on 7.2 move to 7.3
kernel.org ended the 7.2 series with 7.2.15. Releases no longer build or carry
mu300-kernel-7.2.tar.gz or the -k7.2 Magisk zips (release and mainline
workflows, make-release, make-magisk-zips), patches/7.2 is gone (7.3 has its
own 0028) and parity/mainline.list drops the 7.2 series.

Migration: mu300-update takes a 7.2 choice for 7.3 (never the 5.4 an unknown
choice means), says so in apply/boot/check/kernel, installs 7.3 through the
usual boot update (image before kept for rollback-boot, one-boot fallback
unchanged) and writes 7.3 down once an image of 7.3 is in place.
"mu300-update kernel 7.2" refuses and names 7.3. rollback-boot to a 7.2 image
still works and says the next update brings 7.3. Zips and directories of older
releases with 7.2 are still read. install.sh, install.ps1, the GUI, the web
installer and the Ubuntu panel take an answer or a choice of 7.2 as 7.3 with
a note; the kernel menu is 1) 5.4, 2) 6.18, 3) 7.3, and 4 still means 7.3.
mu300-api and the LuCI adapter no longer accept 7.2. Docs, wiki and site
(en/tr/zh) list three kernels and describe the retirement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
2026-11-02 02:25:17 +03:00

79 lines
4.7 KiB
Bash

# A release's Magisk zip, unpacked on a computer, is an installer for that computer too (START-HERE.md in the zip,
# tools/make-magisk-zips.sh): its computer/ directory is this project's installers, with a file .mu300-package in it,
# and the system and the kernel of the zip lie next to it - payload/<the two assets>, mu300/manifest naming them and
# mu300/SHA256SUMS, the release's own checksums. In that case install.sh installs exactly that system and that kernel,
# from those files, and downloads nothing. Sourced by install.sh (t, die and progress are its own; needs $TOP).
# MU300_PACKAGE=DIR (or install.sh --package DIR) the unpacked zip at DIR
# computer/.mu300-package the unpacked zip is the directory above this copy
# The manifest is read the way the zip's own installer reads it (android/magisk/installer/mu300-install.sh,
# manifest_load): only its keys, never sourced, and every value exactly one a release has - the values become file
# names. Both payload files must have the checksum the manifest names and the one SHA256SUMS names.
# package_dir: the directory of the unpacked zip this run installs from, or nothing (a copy of the project)
package_dir() {
if [ -n "${MU300_PACKAGE:-}" ]; then echo "$MU300_PACKAGE"; return 0; fi
[ -f "$TOP/.mu300-package" ] && echo "$TOP/.."
return 0
}
# package_load DIR: PKG (the directory, absolute) and PKG_TAG, PKG_SYSTEM, PKG_OS, PKG_UBUNTU, PKG_KERNEL,
# PKG_KERNEL_ASSET, PKG_ROOTFS_ASSET, PKG_SHA256_KERNEL, PKG_SHA256_ROOTFS from its mu300/manifest; dies when it is
# not the manifest of a release's zip
package_load() {
PKG=$(cd "$1" 2>/dev/null && pwd) || die "$(t 'no unpacked Magisk zip at {1}' "$1")"
[ -f "$PKG/mu300/manifest" ] && [ -f "$PKG/mu300/SHA256SUMS" ] ||
die "$(t '{1} is not an unpacked Magisk zip of a release (it has no mu300/manifest and mu300/SHA256SUMS)' "$PKG")"
PKG_TAG= PKG_SYSTEM= PKG_OS= PKG_UBUNTU= PKG_KERNEL= PKG_KERNEL_ASSET= PKG_ROOTFS_ASSET= PKG_SHA256_KERNEL= PKG_SHA256_ROOTFS=
while IFS='=' read -r _pk _pv || [ -n "$_pk" ]; do
_pv=$(printf '%s' "$_pv" | tr -d '\r')
case $_pk in
TAG) PKG_TAG=$_pv ;; SYSTEM) PKG_SYSTEM=$_pv ;; OS) PKG_OS=$_pv ;; UBUNTU) PKG_UBUNTU=$_pv ;;
KERNEL) PKG_KERNEL=$_pv ;; KERNEL_ASSET) PKG_KERNEL_ASSET=$_pv ;; ROOTFS_ASSET) PKG_ROOTFS_ASSET=$_pv ;;
SHA256_KERNEL) PKG_SHA256_KERNEL=$_pv ;; SHA256_ROOTFS) PKG_SHA256_ROOTFS=$_pv ;;
esac
done < "$PKG/mu300/manifest"
_pok=1
case $PKG_TAG in v[0-9]*) ;; *) _pok= ;; esac
case $PKG_TAG in *[!0-9A-Za-z._-]*|*..*) _pok= ;; esac
case $PKG_SYSTEM:$PKG_OS:$PKG_UBUNTU:$PKG_ROOTFS_ASSET in
openwrt:openwrt::mu300-openwrt-rootfs.tar.gz) ;;
openwrt-luci:openwrt-luci::mu300-openwrt-luci-rootfs.tar.gz) ;;
ubuntu-24.04:ubuntu:24.04:mu300-ubuntu-rootfs.tar.gz) ;;
ubuntu-26.04:ubuntu:26.04:mu300-ubuntu-26.04-rootfs.tar.gz) ;;
*) _pok= ;;
esac
# (7.2 is retired; the zips of the releases that had it still install what they carry, and mu300-update moves
# such a device to 7.3 with its next update)
case $PKG_KERNEL:$PKG_KERNEL_ASSET in
5.4:mu300-kernel.tar.gz|6.18:mu300-kernel-6.18.tar.gz|7.2:mu300-kernel-7.2.tar.gz|7.3:mu300-kernel-7.3.tar.gz) ;;
*) _pok= ;;
esac
# (Ubuntu 26.04's programs need system calls 5.4 does not have: no release has that zip)
[ "$PKG_UBUNTU:$PKG_KERNEL" != 26.04:5.4 ] || _pok=
for _ph in "$PKG_SHA256_KERNEL" "$PKG_SHA256_ROOTFS"; do
case $_ph in *[!0-9a-f]*) _pok= ;; esac
[ ${#_ph} = 64 ] || _pok=
done
[ -n "$_pok" ] || die "$(t 'the package is incomplete or damaged (its manifest is not valid)')"
}
# package_label: the system for people, as the zip's name has it (ubuntu-24.04, openwrt-luci)
package_label() { echo "$PKG_SYSTEM"; }
# package_verify: both payload files against the manifest and against SHA256SUMS, with a verify event each; dies on
# the first that is missing or differs
package_verify() {
for _pf in "$PKG_KERNEL_ASSET:$PKG_SHA256_KERNEL" "$PKG_ROOTFS_ASSET:$PKG_SHA256_ROOTFS"; do
_pn=${_pf%%:*}; _pm=${_pf#*:}
_ps=$(awk -v f="$_pn" '$2 == f || $2 == "*" f {print $1; exit}' "$PKG/mu300/SHA256SUMS" | tr -d '\r')
[ -f "$PKG/payload/$_pn" ] || die "$(t '{1} is missing from the package (payload/)' "$_pn")"
echo " $_pn"
_pa=$( (shasum -a 256 "$PKG/payload/$_pn" 2>/dev/null || sha256sum "$PKG/payload/$_pn" 2>/dev/null) | cut -d' ' -f1)
if [ -z "$_ps" ] || [ "$_pa" != "$_pm" ] || [ "$_pa" != "$_ps" ]; then
progress verify file "$_pn" result mismatch
die "$(t 'checksum mismatch for {1}' "$_pn")"
fi
progress verify file "$_pn" result ok
done
}