From 4e5981d19e8b5e1ae123621bedc854f0ddb388da Mon Sep 17 00:00:00 2001 From: Tomaz Zaman Date: Wed, 12 Aug 2026 01:17:32 +0200 Subject: [PATCH 40/77] layerscape: stop tagging the mono_gateway-dk board name with -sdboot The generic layerscape preinit fixup appends -sdboot to any board that boots from mmcblk, so the Mono Gateway (always eMMC) always became mono,gateway-dk-sdboot at runtime, forcing every board switch to list both names. Exempt mono in 02_sysinfo_fixup and drop the redundant -sdboot case from the runtime switches (platform.sh x3, board.d/02_network, and the expand-rootfs, leds and lan2 uci-defaults). SUPPORTED_DEVICES keeps the -sdboot alias and mono-update-check keeps its ${BOARD%-sdboot} strip on purpose: units flashed before this change still report the suffix, and sysupgrade refuses an image whose SUPPORTED_DEVICES lacks the running board name. Drop both once the fleet is confirmed off pre-change images. Co-Authored-By: Claude Opus 4.8 --- .../linux/layerscape/base-files/etc/board.d/02_network | 3 +-- .../etc/uci-defaults/10-mono-gateway-expand-rootfs | 2 +- .../base-files/etc/uci-defaults/11-mono-gateway-leds | 2 +- .../base-files/etc/uci-defaults/99-mono-gateway-lan2 | 2 +- .../layerscape/base-files/lib/preinit/02_sysinfo_fixup | 5 +++++ .../linux/layerscape/base-files/lib/upgrade/platform.sh | 9 +++------ target/linux/layerscape/image/armv8_64b.mk | 3 +++ 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/target/linux/layerscape/base-files/etc/board.d/02_network b/target/linux/layerscape/base-files/etc/board.d/02_network index 7a2341b7ca..620a5773fc 100644 --- a/target/linux/layerscape/base-files/etc/board.d/02_network +++ b/target/linux/layerscape/base-files/etc/board.d/02_network @@ -13,8 +13,7 @@ case "$(board_name)" in ucidef_set_interface_lan "eth0 eth1 eth2 eth3" ucidef_set_interface_wan "eth6" ;; - mono,gateway-dk|\ - mono,gateway-dk-sdboot) + mono,gateway-dk) ucidef_set_interface_lan "eth0 eth1 eth2" ucidef_set_interface_wan "eth3" ucidef_set_interface "lan2" device "eth4" protocol "static" \ diff --git a/target/linux/layerscape/base-files/etc/uci-defaults/10-mono-gateway-expand-rootfs b/target/linux/layerscape/base-files/etc/uci-defaults/10-mono-gateway-expand-rootfs index 7d7bdf0785..b9bf04bf41 100644 --- a/target/linux/layerscape/base-files/etc/uci-defaults/10-mono-gateway-expand-rootfs +++ b/target/linux/layerscape/base-files/etc/uci-defaults/10-mono-gateway-expand-rootfs @@ -15,7 +15,7 @@ [ -f /lib/upgrade/platform.sh ] && . /lib/upgrade/platform.sh case "$(board_name)" in -mono,gateway-dk|mono,gateway-dk-sdboot) ;; +mono,gateway-dk) ;; *) exit 0 ;; esac diff --git a/target/linux/layerscape/base-files/etc/uci-defaults/11-mono-gateway-leds b/target/linux/layerscape/base-files/etc/uci-defaults/11-mono-gateway-leds index 2e80391db7..4ea6eba3bf 100644 --- a/target/linux/layerscape/base-files/etc/uci-defaults/11-mono-gateway-leds +++ b/target/linux/layerscape/base-files/etc/uci-defaults/11-mono-gateway-leds @@ -12,7 +12,7 @@ . /lib/functions.sh case "$(board_name)" in -mono,gateway-dk|mono,gateway-dk-sdboot) ;; +mono,gateway-dk) ;; *) exit 0 ;; esac diff --git a/target/linux/layerscape/base-files/etc/uci-defaults/99-mono-gateway-lan2 b/target/linux/layerscape/base-files/etc/uci-defaults/99-mono-gateway-lan2 index 6ac9154c16..57da95e33a 100644 --- a/target/linux/layerscape/base-files/etc/uci-defaults/99-mono-gateway-lan2 +++ b/target/linux/layerscape/base-files/etc/uci-defaults/99-mono-gateway-lan2 @@ -3,7 +3,7 @@ # firewall zone so it gets the same forwarding/NAT policy as br-lan. . /lib/functions.sh -[ "$(board_name)" = "mono,gateway-dk" ] || [ "$(board_name)" = "mono,gateway-dk-sdboot" ] || exit 0 +[ "$(board_name)" = "mono,gateway-dk" ] || exit 0 uci -q get firewall.@zone[0] >/dev/null || exit 0 uci add_list firewall.@zone[0].network='lan2' diff --git a/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup b/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup index 1bbd8efbc6..77655d0159 100644 --- a/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup +++ b/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup @@ -1,6 +1,11 @@ do_sysinfo_layerscape_fixup() { [ -e /tmp/sysinfo/board_name ] || return [ -e /proc/cmdline ] || return + # The Mono Gateway only ever boots from eMMC, so the -sdboot suffix is + # meaningless for it and would force every board switch to carry two names. + case "$(strings /tmp/sysinfo/board_name)" in + mono,gateway-dk) return ;; + esac cmdline=$(strings /proc/cmdline) case "${cmdline}" in *root=/dev/mmcblk*) diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh index ade407fbae..07d96265ae 100644 --- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh +++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh @@ -184,8 +184,7 @@ platform_copy_config() { local board=$(board_name) case "$board" in - mono,gateway-dk | \ - mono,gateway-dk-sdboot) + mono,gateway-dk) platform_copy_config_mono return 0 ;; @@ -210,8 +209,7 @@ platform_check_image() { nand_do_platform_check "ten64-mtd" $1 return $? ;; - mono,gateway-dk | \ - mono,gateway-dk-sdboot) + mono,gateway-dk) # Pre-flight: refuse before writing anything if the target eMMC # does not validate, rather than failing part-way through the flash. mono_gateway_root_part >/dev/null || return 1 @@ -253,8 +251,7 @@ platform_do_upgrade() { touch /var/lock/fw_printenv.lock case "$board" in - mono,gateway-dk | \ - mono,gateway-dk-sdboot) + mono,gateway-dk) platform_do_upgrade_mono "$1" return $? ;; diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index 04b0da8372..ca12f1917b 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -470,6 +470,9 @@ define Device/mono_gateway-dk MONO_BOOTFS_SIZE := 64 MONO_ROOTFS_PART := 30208 MONO_EMMC_SECTORS := 62160896 + # Keep the -sdboot alias: units flashed before 02_sysinfo_fixup stopped + # appending it still report mono,gateway-dk-sdboot at runtime, and sysupgrade + # refuses an image whose SUPPORTED_DEVICES lacks the running board name. SUPPORTED_DEVICES := mono,gateway-dk mono,gateway-dk-sdboot IMAGES := emmc.img.gz sysupgrade.bin IMAGE/emmc.img.gz := mono-bootfs | mono-emmc-img | gzip | append-metadata -- 2.47.3