scripts: mkits-zyxel-fit-filogic: take a list of model IDs

The callers pass the factory image's "compat-models" list as raw bytes,
already padded to the five model IDs the stock firmware images carry,
with "ff ff" for the unused ones, e.g. "59 e1 ff ff ff ff ff ff ff ff".

Take a list of one to five model IDs of four hex digits each instead,
e.g. "80e1 81e1", and split them into bytes and pad the list in the
script. Malformed IDs and empty or too long lists now fail the build,
instead of producing a factory image the stock firmware rejects.

Update both callers, the NWA50AX Pro on mediatek and the NWA110AX and
NWA210AX on qualcommax. Their factory images are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mark Chiou <chiouss@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25506
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
This commit is contained in:
Mark ChiouandClaude Opus 5.5 authored and Jonas Jelonek committed 2026-11-19 13:11:38 +01:00
1 parent 34a8bd60de
commit 94b5aa2d63
3 files changed
+25 -6

No files matched your search

+21 -2
View File
@@ -4,7 +4,8 @@
# Author: David Bauer <mail@david-bauer.net>, based on mkits-zyxel-factory.sh.
usage() {
echo "Usage: `basename $0` output file compat-models"
echo "Usage: `basename $0` output file model-ids"
echo " model-ids: 1 to 5 model IDs of 4 hex digits each, e.g. \"80e1 81e1\""
exit 1
}
@@ -14,7 +15,25 @@ usage() {
# Target output file
OUTPUT="$1"; shift
FILE="$1"; shift
MODELS="$1"; shift
MODEL_IDS="$1"; shift
# Like the stock firmware, list five model IDs, with unused ones set to ffff
MODELS=""
COUNT=0
for ID in ${MODEL_IDS}; do
case "$ID" in
[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]) ;;
*) echo "Invalid model ID: $ID" >&2; exit 1 ;;
esac
MODELS="${MODELS}${ID:0:2} ${ID:2:2} "
COUNT=$((COUNT + 1))
done
[ "$COUNT" -lt 1 ] || [ "$COUNT" -gt 5 ] && usage
while [ "$COUNT" -lt 5 ]; do
MODELS="${MODELS}ff ff "
COUNT=$((COUNT + 1))
done
MODELS="${MODELS% }"
# Create a default, fully populated DTS file
echo "\