From 70f607d8337f2e8b16041f1299d7a2e3ba2583f2 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 5 Jan 2023 21:55:46 +0100 Subject: [PATCH] ipq807x: set compat version for ifname change Now that interface names are set per physical markings, sysupgrading while preserving config would cause devices that are not accessible over network so make sure to increase the compat version to prevent sysupgrade with config preservation. Signed-off-by: Robert Marko --- .../base-files/etc/board.d/05_compat-version | 18 ++++++++++++++++++ target/linux/ipq807x/image/generic.mk | 11 +++++++++++ 2 files changed, 29 insertions(+) create mode 100644 target/linux/ipq807x/base-files/etc/board.d/05_compat-version diff --git a/target/linux/ipq807x/base-files/etc/board.d/05_compat-version b/target/linux/ipq807x/base-files/etc/board.d/05_compat-version new file mode 100644 index 0000000000000..70272f99ed5d8 --- /dev/null +++ b/target/linux/ipq807x/base-files/etc/board.d/05_compat-version @@ -0,0 +1,18 @@ +# +# Copyright (C) 2022 OpenWrt.org +# + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in + *) + ucidef_set_compat_version "1.1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/ipq807x/image/generic.mk b/target/linux/ipq807x/image/generic.mk index 811a32e942b3d..30e6f14cae371 100644 --- a/target/linux/ipq807x/image/generic.mk +++ b/target/linux/ipq807x/image/generic.mk @@ -17,9 +17,15 @@ define Device/UbiFit IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef +define Device/IfnameMigration + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Network interface names have changed +endef + define Device/dynalink_dl-wrx36 $(call Device/FitImage) $(call Device/UbiFit) + $(call Device/IfnameMigration) DEVICE_VENDOR := Dynalink DEVICE_MODEL := DL-WRX36 BLOCKSIZE := 128k @@ -33,6 +39,7 @@ TARGET_DEVICES += dynalink_dl-wrx36 define Device/edgecore_eap102 $(call Device/FitImage) $(call Device/UbiFit) + $(call Device/IfnameMigration) DEVICE_VENDOR := Edgecore DEVICE_MODEL := EAP102 BLOCKSIZE := 128k @@ -47,6 +54,7 @@ TARGET_DEVICES += edgecore_eap102 define Device/edimax_cax1800 $(call Device/FitImage) $(call Device/UbiFit) + $(call Device/IfnameMigration) DEVICE_VENDOR := Edimax DEVICE_MODEL := CAX1800 BLOCKSIZE := 128k @@ -59,6 +67,7 @@ TARGET_DEVICES += edimax_cax1800 define Device/qnap_301w $(call Device/FitImage) + $(call Device/IfnameMigration) DEVICE_VENDOR := QNAP DEVICE_MODEL := 301w DEVICE_DTS_CONFIG := config@hk01 @@ -83,6 +92,7 @@ TARGET_DEVICES += redmi_ax6 define Device/xiaomi_ax3600 $(call Device/FitImage) $(call Device/UbiFit) + $(call Device/IfnameMigration) DEVICE_VENDOR := Xiaomi DEVICE_MODEL := AX3600 BLOCKSIZE := 128k @@ -101,6 +111,7 @@ TARGET_DEVICES += xiaomi_ax3600 define Device/xiaomi_ax9000 $(call Device/FitImage) $(call Device/UbiFit) + $(call Device/IfnameMigration) DEVICE_VENDOR := Xiaomi DEVICE_MODEL := AX9000 BLOCKSIZE := 128k