RE: [PATCH] ath79/zyxel_nbg6716: resize kernel partition to 6MiB and reenable again
Hi, the 3rd, > -Original Message- > From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] > On Behalf Of André Valentin > Sent: Samstag, 22. Mai 2021 17:01 > To: openwrt-devel@lists.openwrt.org > Cc: André Valentin > 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 > --- > .../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@50 { > label = "kernel"; > - reg = <0x50 0x40>; > + reg = <0x50 0x60>; > }; > > partition@90 { > label = "ubi"; > - reg = <0x90 0x770>; > + reg = <0xb0 0x750>; > }; > }; > }; > 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@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel openpgp-digital-signature.asc Description: PGP signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
RE: [PATCH] ath79/zyxel_nbg6716: resize kernel partition to 6MiB and reenable again
Hi again, >KERNEL := kernel-bin | append-dtb | uImage none | zyxel-buildkerneljffs | > \ > - check-size 4096k > - IMAGES := sysupgrade.tar sysupgrade-4M-Kernel.bin factory.bin > + check-size 6144k One should use (KERNEL_SIZE) here instead of a literal value. Best Adrian openpgp-digital-signature.asc Description: PGP signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Re: [PATCH] ath79/zyxel_nbg6716: resize kernel partition to 6MiB and reenable again
On 5/22/21 5:00 PM, André Valentin wrote: 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 --- .../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@50 { label = "kernel"; - reg = <0x50 0x40>; + reg = <0x50 0x60>; }; partition@90 { label = "ubi"; - reg = <0x90 0x770>; + reg = <0xb0 0x750>; }; }; }; 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 This check was triggered by the build bots. I am not sure, but I think this also adds the rootfs to the kernel image and then it gets too big. Hauke OpenPGP_0x93DD20630910B515.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel
RE: [PATCH] ath79/zyxel_nbg6716: resize kernel partition to 6MiB and reenable again
Hi, > -Original Message- > From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] > On Behalf Of André Valentin > Sent: Samstag, 22. Mai 2021 17:01 > To: openwrt-devel@lists.openwrt.org > Cc: André Valentin > Subject: [PATCH] ath79/zyxel_nbg6716: resize kernel partition to 6MiB and > reenable again > > 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 > --- > .../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@50 { > label = "kernel"; > - reg = <0x50 0x40>; > + reg = <0x50 0x60>; > }; > > partition@90 { > label = "ubi"; > - reg = <0x90 0x770>; > + reg = <0xb0 0x750>; > }; > }; > }; > 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 In order for this to work, you will need to also set the compat_version _on device_ either with board.d or uci-default. In case of fresh install typically the uci-defaults method provides a better experience. Examples: board.d: https://github.com/openwrt/openwrt/blob/master/target/linux/kirkwood/base-files/etc/board.d/05_compat-version uci-defaults (at the bottom): https://github.com/openwrt/openwrt/commit/07aa858a73e6e855fc62a37ae275518fa4db5e50 Best Adrian > + 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@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel openpgp-digital-signature.asc Description: PGP signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel