mirror of
https://github.com/openwrt/openwrt.git
synced 2026-11-27 14:41:12 +04:00
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:
1 parent
34a8bd60de
commit
94b5aa2d63
3 files changed
+25
-6
No files matched your search
@@ -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 "\
|
||||
|
||||
@@ -119,7 +119,7 @@ endef
|
||||
|
||||
define Build/zyxel-nwa-fit-filogic
|
||||
$(TOPDIR)/scripts/mkits-zyxel-fit-filogic.sh \
|
||||
$@.its $@ "80 e1 81 e1 ff ff ff ff ff ff"
|
||||
$@.its $@ "80e1 81e1"
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
|
||||
@@ -46,7 +46,7 @@ endef
|
||||
|
||||
define Build/zyxel-nwax10ax-fit
|
||||
$(TOPDIR)/scripts/mkits-zyxel-fit-filogic.sh \
|
||||
$@.its $@ "$(ZYXEL_MODEL_ID) ff ff ff ff ff ff ff ff"
|
||||
$@.its $@ "$(ZYXEL_MODEL_ID)"
|
||||
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
|
||||
@mv $@.new $@
|
||||
endef
|
||||
@@ -663,7 +663,7 @@ define Device/zyxel_nwa110ax
|
||||
DEVICE_DTS_CONFIG := config@ac01
|
||||
SOC := ipq8070
|
||||
DEVICE_PACKAGES := ipq-wifi-zyxel_nwa110ax zyxel-bootconfig-ipq807x kmod-leds-lp5562
|
||||
ZYXEL_MODEL_ID := 59 e1
|
||||
ZYXEL_MODEL_ID := 59e1
|
||||
endef
|
||||
TARGET_DEVICES += zyxel_nwa110ax
|
||||
|
||||
@@ -673,6 +673,6 @@ define Device/zyxel_nwa210ax
|
||||
DEVICE_DTS_CONFIG := config@ac02
|
||||
SOC := ipq8071
|
||||
DEVICE_PACKAGES := ipq-wifi-zyxel_nwa210ax zyxel-bootconfig-ipq807x kmod-leds-lp5562
|
||||
ZYXEL_MODEL_ID := 5c e1
|
||||
ZYXEL_MODEL_ID := 5ce1
|
||||
endef
|
||||
TARGET_DEVICES += zyxel_nwa210ax
|
||||
Reference in new issue
Block a user