NAND layout: How to get SquashFS (ro) + UBI (rw)

Hi guys! I need your advice about the a NAND device layout.
mtd4 - kernel
mtd5 - rootfs (SquashFS in stock firmware)

U-boot verifies a checksum and signature of (mtd4+mtd5) at every boot. So they have to be readonly and kept untouchable after the installation of OpenWrt. Checksum and signature algorithm is already known.

I would like to use mtd12 (ubi) as overlay.

Is it posiible to do in OpenWrt? Could you share an example of a dts file for such a case, please? Or suitable labels (names) for mtd5 and mtd12.

1 Like

As a workaround I decided not to use mtd5 at all. Just filled it with zeros. So there is no problem with U-Boot checks.

1 Like

Please keep it open until the real solution!
I'm interested too! :+1:

An average image recipe looks like:

	IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata

Try skipping pad-rootfs! And if it looks promising, then create a custom pad-rootfs which pads to the size of mtd5.

Other hint is just name mtd12 to rootfs_data.