From 27be1ae1d64ffa3ced38b6894ffe9c905049fb6e Mon Sep 17 00:00:00 2001 From: Tad Davanzo Date: Fri, 5 Feb 2021 22:38:03 -0500 Subject: [PATCH 1/3] mvebu: mamba resize kernel to 4MB mamba has a 3MB kernel partition as specified by the DTS. 3MB is not sufficient for building with many kernel modules or newer kernel versions. mamba uboot however as set from factory will load up to 4MB. This can be observed by looking a uboot log: NAND read: device 0 offset 0xa00000, size 0x400000 4194304 bytes read: OK and from uboot environment variables: $ fw_printenv | grep "pri_kern_size"; pri_kern_size=0x400000 Resize the root partitions from 37MB to 36MB to let kernel expand into it another 1MB. And set kernel target size to 4MB. Lastly add a compatibility version message: kernel-size-migration. And set it on mamba to prevent sysupgrading without first reinstalling from a factory image. Signed-off-by: Tad Davanzo --- .../etc/uci-defaults/05_fix-compat-version | 10 +++++ target/linux/mvebu/image/cortexa9.mk | 10 ++++- ...rmada-xp-linksys-mamba-resize-kernel.patch | 37 +++++++++++++++++++ ...rmada-xp-linksys-mamba-resize-kernel.patch | 37 +++++++++++++++++++ 4 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version create mode 100644 target/linux/mvebu/patches-5.10/316-armada-xp-linksys-mamba-resize-kernel.patch create mode 100644 target/linux/mvebu/patches-5.4/318-armada-xp-linksys-mamba-resize-kernel.patch diff --git a/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version new file mode 100644 index 00000000000000..70e0e9ef95f59c --- /dev/null +++ b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version @@ -0,0 +1,10 @@ +. /lib/functions.sh + +case "$(board_name)" in + linksys,wrt1900ac-v1) + uci set system.@system[0].compat_version="2.0" + uci commit system + ;; +esac + +exit 0 diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index a7ebc30a715f07..90c0dfa8270100 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -8,6 +8,12 @@ define Device/dsa-migration DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA endef +define Device/kernel-size-migration + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := Partition design has changed compared to older versions (up to 19.07) due to kernel size restrictions. \ + Upgrade via sysupgrade mechanism is not possible, so new installation via factory style image is required. +endef + define Device/buffalo_ls421de $(Device/NAND-128K) DEVICE_VENDOR := Buffalo @@ -108,14 +114,14 @@ TARGET_DEVICES += linksys_wrt1900acs define Device/linksys_wrt1900ac-v1 $(call Device/linksys) - $(Device/dsa-migration) + $(Device/kernel-size-migration) DEVICE_MODEL := WRT1900AC DEVICE_VARIANT := v1 DEVICE_ALT0_VENDOR := Linksys DEVICE_ALT0_MODEL := Mamba DEVICE_DTS := armada-xp-linksys-mamba DEVICE_PACKAGES += mwlwifi-firmware-88w8864 - KERNEL_SIZE := 3072k + KERNEL_SIZE := 4096k SUPPORTED_DEVICES += armada-xp-linksys-mamba linksys,mamba DEFAULT := n endef diff --git a/target/linux/mvebu/patches-5.10/316-armada-xp-linksys-mamba-resize-kernel.patch b/target/linux/mvebu/patches-5.10/316-armada-xp-linksys-mamba-resize-kernel.patch new file mode 100644 index 00000000000000..f1fddceff4b093 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/316-armada-xp-linksys-mamba-resize-kernel.patch @@ -0,0 +1,37 @@ +From 258233f00bcd013050efee00c5d9128ef8cd62dd Mon Sep 17 00:00:00 2001 +From: Tad +Date: Fri, 5 Feb 2021 22:32:11 -0500 +Subject: [PATCH] ARM: dts: armada-xp-linksys-mamba: Increase kernel + partition to 4MB + +Signed-off-by: Tad Davanzo +--- + arch/arm/boot/dts/armada-xp-linksys-mamba.dts | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts ++++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts +@@ -456,9 +456,9 @@ + reg = <0xa00000 0x2800000>; /* 40MB */ + }; + +- partition@d00000 { ++ partition@e00000 { + label = "rootfs1"; +- reg = <0xd00000 0x2500000>; /* 37MB */ ++ reg = <0xe00000 0x2400000>; /* 36MB */ + }; + + /* kernel2 overlaps with rootfs2 by design */ +@@ -467,9 +467,9 @@ + reg = <0x3200000 0x2800000>; /* 40MB */ + }; + +- partition@3500000 { ++ partition@3600000 { + label = "rootfs2"; +- reg = <0x3500000 0x2500000>; /* 37MB */ ++ reg = <0x3600000 0x2400000>; /* 36MB */ + }; + + /* diff --git a/target/linux/mvebu/patches-5.4/318-armada-xp-linksys-mamba-resize-kernel.patch b/target/linux/mvebu/patches-5.4/318-armada-xp-linksys-mamba-resize-kernel.patch new file mode 100644 index 00000000000000..f1fddceff4b093 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/318-armada-xp-linksys-mamba-resize-kernel.patch @@ -0,0 +1,37 @@ +From 258233f00bcd013050efee00c5d9128ef8cd62dd Mon Sep 17 00:00:00 2001 +From: Tad +Date: Fri, 5 Feb 2021 22:32:11 -0500 +Subject: [PATCH] ARM: dts: armada-xp-linksys-mamba: Increase kernel + partition to 4MB + +Signed-off-by: Tad Davanzo +--- + arch/arm/boot/dts/armada-xp-linksys-mamba.dts | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts ++++ b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts +@@ -456,9 +456,9 @@ + reg = <0xa00000 0x2800000>; /* 40MB */ + }; + +- partition@d00000 { ++ partition@e00000 { + label = "rootfs1"; +- reg = <0xd00000 0x2500000>; /* 37MB */ ++ reg = <0xe00000 0x2400000>; /* 36MB */ + }; + + /* kernel2 overlaps with rootfs2 by design */ +@@ -467,9 +467,9 @@ + reg = <0x3200000 0x2800000>; /* 40MB */ + }; + +- partition@3500000 { ++ partition@3600000 { + label = "rootfs2"; +- reg = <0x3500000 0x2500000>; /* 37MB */ ++ reg = <0x3600000 0x2400000>; /* 36MB */ + }; + + /* From 6157ed0a1aedfd201c882d0846a52440b688f48e Mon Sep 17 00:00:00 2001 From: Tad Davanzo Date: Fri, 5 Feb 2021 22:42:47 -0500 Subject: [PATCH 2/3] mvebu: venom resize kernel to 6MB venom has a 3MB kernel partition as specified by the DTS. 3MB is not sufficient for building with many kernel modules or newer kernel versions. venom uboot however as set from factory will load up to 6MB. This can be observed by looking a uboot log: NAND read: device 0 offset 0x900000, size 0x600000 6291456 bytes read: OK and from uboot environment variables: $ fw_printenv | grep "priKernSize"; priKernSize=0x0600000 Resize the root partitions from 120MB to 117MB to let kernel expand into it another 3MB. And set kernel target size to 6MB. Lastly set the kernel-size-migration compatibility version on venom to prevent sysupgrading without first reinstalling from a factory image. Signed-off-by: Tad Davanzo --- .../base-files/etc/uci-defaults/05_fix-compat-version | 3 ++- .../files/arch/arm/boot/dts/armada-385-linksys-venom.dts | 8 ++++---- target/linux/mvebu/image/cortexa9.mk | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version index 70e0e9ef95f59c..8856bf23a46fd8 100644 --- a/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version +++ b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version @@ -1,7 +1,8 @@ . /lib/functions.sh case "$(board_name)" in - linksys,wrt1900ac-v1) + linksys,wrt1900ac-v1|\ + linksys,wrt32x) uci set system.@system[0].compat_version="2.0" uci commit system ;; diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-venom.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-venom.dts index de81600a8019aa..a2ca3158cf7659 100644 --- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-venom.dts +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-venom.dts @@ -157,9 +157,9 @@ reg = <0x900000 0x7b00000>; /* 123MB */ }; - partition@c00000 { + partition@f00000 { label = "rootfs1"; - reg = <0xc00000 0x7800000>; /* 120MB */ + reg = <0xf00000 0x7500000>; /* 117MB */ }; /* kernel2 overlaps with rootfs2 by design */ @@ -168,9 +168,9 @@ reg = <0x8400000 0x7b00000>; /* 123MB */ }; - partition@8700000 { + partition@8a00000 { label = "rootfs2"; - reg = <0x8700000 0x7800000>; /* 120MB */ + reg = <0x8a00000 0x7500000>; /* 117MB */ }; /* last MB is for the BBT, not writable */ diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 90c0dfa8270100..203a04d6bcd783 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -154,13 +154,13 @@ TARGET_DEVICES += linksys_wrt3200acm define Device/linksys_wrt32x $(call Device/linksys) - $(Device/dsa-migration) + $(Device/kernel-size-migration) DEVICE_MODEL := WRT32X DEVICE_ALT0_VENDOR := Linksys DEVICE_ALT0_MODEL := Venom DEVICE_DTS := armada-385-linksys-venom DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964 - KERNEL_SIZE := 3072k + KERNEL_SIZE := 6144k KERNEL := kernel-bin | append-dtb SUPPORTED_DEVICES += armada-385-linksys-venom linksys,venom DEFAULT := n From eff3474b413d78192a1e8fba3ad74445c5a09e64 Mon Sep 17 00:00:00 2001 From: Tad Davanzo Date: Tue, 9 Feb 2021 17:42:54 -0500 Subject: [PATCH 3/3] mvebu: enable WRT1900AC v1 and WRT32X for buildbots Kernel size limits have been dealt with. Effective revert of a1eb2c46 and ac9730c4. Signed-off-by: Tad Davanzo --- target/linux/mvebu/image/cortexa9.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 203a04d6bcd783..3f227259eeb97a 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -123,7 +123,6 @@ define Device/linksys_wrt1900ac-v1 DEVICE_PACKAGES += mwlwifi-firmware-88w8864 KERNEL_SIZE := 4096k SUPPORTED_DEVICES += armada-xp-linksys-mamba linksys,mamba - DEFAULT := n endef TARGET_DEVICES += linksys_wrt1900ac-v1 @@ -163,7 +162,6 @@ define Device/linksys_wrt32x KERNEL_SIZE := 6144k KERNEL := kernel-bin | append-dtb SUPPORTED_DEVICES += armada-385-linksys-venom linksys,venom - DEFAULT := n endef TARGET_DEVICES += linksys_wrt32x