Difference between firmware

sorry for the stupid question
why such a difference in size and header between

snapshot openwrt-ath79-nand-zyxel_nbg6716-squashfs-factory.bin

Yes i know it is 2 differents target....
but when i use Hexedit on them they are really do not start with the same kind of data , my device seems expected.
when i look at the stock firmware i am seeing the same start...

someting like :

........OpenWrt Linux-4.19.88...............NBG6716.

sorry if my question is stupid , i am learning :slight_smile:

There is no LUCI (webinterface) in the snapshot.

well snap is way bigger :slight_smile:

$ ls -lah openwrt-*
-rw-rw-r-- 1 user staff 5,8M nov  9 05:15 openwrt-18.06.5-ar71xx-nand-nbg6716-squashfs-factory.bin
-rw-rw-r-- 1 user staff  30M déc 11 21:10 openwrt-ath79-nand-zyxel_nbg6716-squashfs-factory.bin


“Factory” images are formatted to meet the OEM’s firmware layout, required for upload and flash. This may include headers, padding to various sizes, trailers, checksums, “magic numbers” or the like.

(That said, 30 MB seems like a lot)

define Device/zyxel_nbg6716
  ATH_SOC := qca9558
  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k-ct ath10k-firmware-qca988x-ct
  RAS_BOARD := NBG6716
  RAS_ROOTFS_SIZE := 29696k
  KERNEL_SIZE := 4096k
  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
  IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
  IMAGE/sysupgrade-4M-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
TARGET_DEVICES += zyxel_nbg6716

Looking at that, it would seem that 30 MB comes from RAS_ROOTFS_SIZE := 29696k. My guess is that the boot loader or the OEM firmware updater needs a "full" image of the root file system. Perhaps it is that it doesn't handle auto-resize i the same way that OpenWrt does.

ZyXEL's OEM firmware upgrader (in the webinterface, the bootloader based recovery flasher is less strict) checks the firmware size against the size of their very first released firmware version for that device. Any future firmware upgrade must have at least that size - smaller images are rejected straight away, therefore factory images must be padded to that size.

1 Like

That's would explain the isssue i was having flashing this device with the 18.x who was getting reject up front
and flashing of the ath79 was actually flashing but getting reboot loop.

Now Noob question, how do a build a 18.x and get a factory images padded to the size expected.
please dont forget i am new to this , even if i learn so much in the last 5 days :slight_smile:

i have a build env and i have actually build 18.x , i am making progress :slight_smile:
Thanks in advance