Skip to content

Commit 8258f45

Browse files
committed
octeon: add and require image METADATA for sysupgrades safety
Actually this platform is not implementing the fwtool's images METADATA mechanism, indeed allowing* sysupgrades with images which are not meant for the specific device, together with the fact that the platform checks in this platform were relaxed because of changes of devices names convention (migrated from legacy naming) so are not checking for the hardcoded board_name in the sysupgrade-tar images neither. *Actually, there are some board_name checks in this platform's sysupgrade paths which minimize the risk of a wrongly cross-sysupgrade but still a risk. So, append the metadata to the common sysupgrade.tar image recipe and add the REQUIRE_IMAGE_METADATA=1 flag in order to guarantee only the correct images pass sysupgrade checks. SUPPORTED_DEVICES was already set correctly for these devices which use a custom sysinfo board_name since some devices do not have a proper device tree source. Remove confusing and wrongly "append-metadata" call in the inner squashfs image recipe for the itus_shield-router case[1]. [1]: openwrt#3241 (comment) Reference: openwrt@be29674 Signed-off-by: Mario Andrés Pérez <mapb_@outlook.com>
1 parent 361c110 commit 8258f45

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

target/linux/octeon/base-files/lib/upgrade/platform.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#
2-
# Copyright (C) 2021 OpenWrt.org
2+
# Copyright (C) 2026 OpenWrt.org
33
#
4+
REQUIRE_IMAGE_METADATA=1
45

56
if [ -x /usr/sbin/blkid ]; then
67
RAMFS_COPY_BIN="/usr/sbin/blkid"

target/linux/octeon/image/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ define Device/Default
2323
KERNEL := kernel-bin | strip-kernel | patch-cmdline
2424
IMAGES := sysupgrade.tar
2525
IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-extra 128k | sysupgrade-tar rootfs=$$$$@
26-
IMAGE/sysupgrade.tar := sysupgrade-tar
26+
IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
2727
endef
2828

2929
define Device/generic
@@ -38,7 +38,6 @@ define Device/itus_shield-router
3838
DEVICE_VENDOR := Itus Networks
3939
DEVICE_MODEL := Shield Router
4040
CMDLINE := $(ITUSROUTER_CMDLINE)
41-
IMAGE/sysupgrade.tar/squashfs += | append-metadata
4241
endef
4342
TARGET_DEVICES += itus_shield-router
4443

0 commit comments

Comments
 (0)