How to build an combined spim-nand-rfb-squashfs-sysupgrade.bin image for MT7981 router?

Hi there!

I have an Openwrt 21.02 SDK build for my RM65 MT7981 router, which outputs an spim-nand-rfb-squashfs-sysupgrade.bin image. That one can easely be uploaded to Luci firmware upgrade and voila router's firmware is upgraded.

I wanted to make an Openwrt 23.05.3 firmware for my router. So I cloned openwrt 23.05.3 source tree with: git clone https://git.openwrt.org/openwrt/openwrt.git)
In menuconfig at "Target Profile" I see "MediaTek MT7981 rfb" instead of "Mediatek MT7981 spim-nand-rfb" I used to see with my 21.02 SDK build.

One thing I noticed is that recent Openwrt images for mt7891 consist of seperate files like: rfb-spim-nand-bl31-uboot.fip. rfb-spim-nand-preloader.bin, rfb-nand-initramfs-kernel.bin, rfb-squashfs-sysupgrade.itb.
Instead of the mt7981-spim-nand-rfb-squashfs-sysupgrade.bin I used to generate with my 21.02 SDK build. I want to generate that combined spim-nand-ffb-squishfs-sysupgrade.bin file.

How can I make my Openwrt 23.05.3 SDK build generate that combined file instead of sysupgrade.itb and seperated spim-nand-preloader.bin files?

Ps I'm rather new to Openwrt development. I don't understand why my 21.02 SDK build generates the combined image file I want/need and the new 23.05.3 SDK build does not.

they need to be written to separate partitions, as in https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=ce7209bd21661e3daa4a7f2f58dafdff990da19f ?

your device might not need this.

I doubt that it is -needed- to separate the files. It was just a choice to make them separated.
If with my old 21.02 SDK I can build the combined file, and it flashes thru Luci web sysupgrade. It works, its possible. No need for connecting to uart and flash bootloaders thru uart connection.

I edited my 21.02 SDK build a bit to be based on the 23.05.3 Openwrt firmware and it outputs a combined file, flashed it thru Luci sysupgrade and it works. Only problem is is that the whole build tree is outdated so I cannot compile all the packages/luci/routing etc against higher versions than 21.02. So my router is running 23.05.3 Openwrt firmware and all the packages like Luci etc are still 21.02 :slight_smile:

Thats why I started with a clean fresh 23.05.3 build. But now my difficult (difficult for me) task to make the 23.05.3 build output a single combined image.

for the device I linked to it seems to be, for instance to allow an unsigned fw to be ULed down the road.

it's your black box device, whatever is and isn't possible only you know.

but you can sysupgrade using an image based in openwrt code, and not the SDK, why would you need to merge those files in the 1st place ?

just use the sysupgrade image as it is ?

Uhm I don't know if i understood your last question entirely but I suppose you mean that I could flash the 23.05.3 sysimage.itb thru Luci's sysupgrade tool?

I cannot flash the (23.05.3 build) sysimage.itb thru sysupgrade, because on my 7981 router it only works with a combined spim-nand-rfb-squashfs-sysupgrade.bin image. Thats why I try to make a combined file :slight_smile:

Oh btw Frollic, sorry. I don't have 23.05.3 compiled. I just found out that I still have 21.02 build running but that I changed only the text in include/version.mk to 23.05.3 :open_mouth:

I am still hoping if anyone can tell me how to make an combined mt7981-spim-nand-rfb-squashfs-sysupgrade.bin image.