[PATCH] ath79/zyxel_nbg6716: resize kernel partition to 6MiB and reenable again

Adrian Schmutzler mail at adrianschmutzler.de
Sun May 23 02:14:10 PDT 2021


Hi, the 3rd,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of André Valentin
> Sent: Samstag, 22. Mai 2021 17:01
> To: openwrt-devel at lists.openwrt.org
> Cc: André Valentin <avalentin at marcant.net>
> Subject: [PATCH] ath79/zyxel_nbg6716: resize kernel partition to 6MiB and
> reenable again

proper commit title requires just "ath79:" prefix, e.g. "ath79: increase ZyXEL NBG6716 kernel to 6M" ...

Best

Adrian

> 
> The bootloader happily accepts this.
> But devices need a fresh reinstall because of resulting ubi partition changes.
> Therefore a  sysupgrade will brick your device.
> 
> Please install a fresh factory image via bootloader.
> Alternatively, you can flash sysupgrade-6M-Kernel.bin with  zcat sysupgrade-
> 6M-Kernel.bin | mtd -r -e /dev/mtd 3 write - /dev/mtd3
> 
> This may thow an error, because it is a 256M image. There are devices out
> there with this flash size.
> 
> Notice that you will always loose configuration.
> 
> Signed-off-by: André Valentin <avalentin at marcant.net>
> ---
>  .../linux/ath79/dts/qca9558_zyxel_nbg6716.dts |  4 ++--
>  target/linux/ath79/image/nand.mk              | 24 +++++++++++++------
>  2 files changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts
> b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts
> index 9aee8c362c..411b086188 100644
> --- a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts
> +++ b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts
> @@ -147,12 +147,12 @@
> 
>  		partition at 500000 {
>  			label = "kernel";
> -			reg = <0x500000 0x400000>;
> +			reg = <0x500000 0x600000>;
>  		};
> 
>  		partition at 900000 {
>  			label = "ubi";
> -			reg = <0x900000 0x7700000>;
> +			reg = <0xb00000 0x7500000>;
>  		};
>  	};
>  };
> diff --git a/target/linux/ath79/image/nand.mk
> b/target/linux/ath79/image/nand.mk
> index caaa01c92d..37a5713ff1 100644
> --- a/target/linux/ath79/image/nand.mk
> +++ b/target/linux/ath79/image/nand.mk
> @@ -236,6 +236,15 @@ TARGET_DEVICES += netgear_wndr4500-v3
> 
>  define Device/zyxel_nbg6716
>    SOC := qca9558
> +  DEVICE_COMPAT_VERSION := 2.0
> +  DEVICE_COMPAT_MESSAGE := Kernel partition has been resized to 6M. \
> +	A sysupgrade will brick your device. \
> +	Please install a fresh factory image via bootloader. \
> +	Alternatively, you can flash sysupgrade-6M-Kernel.bin with \
> +	zcat sysupgrade-6M-Kernel.bin | mtd -r -e /dev/mtd3 write -
> /dev/mtd3 .\
> +	This may thow an error, because it is a 256M image. There are \
> +	devices out there with this flash size. \
> +	Notice that you will always loose configuration.
>    DEVICE_VENDOR := ZyXEL
>    DEVICE_MODEL := NBG6716
>    DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-
> ct \ @@ -243,19 +252,20 @@ define Device/zyxel_nbg6716
>    RAS_BOARD := NBG6716
>    RAS_ROOTFS_SIZE := 29696k
>    RAS_VERSION := "OpenWrt Linux-$(LINUX_VERSION)"
> -  KERNEL_SIZE := 4096k
> +  KERNEL_SIZE := 6144k
>    BLOCKSIZE := 128k
>    PAGESIZE := 2048
>    KERNEL := kernel-bin | append-dtb | uImage none | zyxel-buildkerneljffs |
> \
> -	check-size 4096k
> -  IMAGES := sysupgrade.tar sysupgrade-4M-Kernel.bin factory.bin
> +	check-size 6144k
> +  KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none | \
> +	zyxel-buildkerneljffs | zyxel-factory
> +  IMAGES := sysupgrade.tar sysupgrade-6M-Kernel.bin factory.bin
>    IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-to
> $$$$(BLOCKSIZE) | \
>  	sysupgrade-tar rootfs=$$$$@ | append-metadata
> -  IMAGE/sysupgrade-4M-Kernel.bin/squashfs := append-kernel | \
> +  IMAGE/sysupgrade-6M-Kernel.bin/squashfs := append-kernel | \
>  	pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to 263192576 | gzip
> -  IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) |
> append-ubi | \
> -	zyxel-factory
> +  IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
> +	append-ubi | zyxel-factory
>    UBINIZE_OPTS := -E 5
> -  DEFAULT := n
>  endef
>  TARGET_DEVICES += zyxel_nbg6716
> --
> 2.20.1
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210523/3db628fd/attachment.sig>


More information about the openwrt-devel mailing list