mvebu: venom resize kernel to 6MB
authorTad Davanzo <tad@spotco.us>
Sat, 6 Feb 2021 03:42:47 +0000 (22:42 -0500)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 19 Mar 2021 14:30:01 +0000 (15:30 +0100)
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 <tad@spotco.us>
target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/05_fix-compat-version
target/linux/mvebu/files/arch/arm/boot/dts/armada-385-linksys-venom.dts
target/linux/mvebu/image/cortexa9.mk

index 70e0e9ef95f59cf6b79a4eb2a710ef40e5592b32..8856bf23a46fd809ccb59354776f0a83873315ac 100644 (file)
@@ -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
                ;;
index de81600a8019aa20819f552d8202e3d49ec711f2..a2ca3158cf76596cd2d248f9b68c4c532f573b3d 100644 (file)
                        reg = <0x900000 0x7b00000>;     /* 123MB */
                };
 
-               partition@c00000 {
+               partition@f00000 {
                        label = "rootfs1";
-                       reg = <0xc00000 0x7800000>;     /* 120MB */
+                       reg = <0xf00000 0x7500000>;     /* 117MB */
                };
 
                /* kernel2 overlaps with rootfs2 by design */
                        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 */
index 90c0dfa8270100cff7298a8a597339cbcd429767..203a04d6bcd7834d8896741d49d606984edbee99 100644 (file)
@@ -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