Lzma vmlinuz and dsa-migration for a new Device

I'm looking into adding support for a Trendnet TEW-827DRU V2 and the GPL'd source shows a bin/ramips/vmlinuz.bin.lzma.

jsh@PooBear:~/Downloads/GPL_TEW-827DRU_v2/qsdk_gpl/bin/ramips$ ls
manifest                             openwrt-ramips-mt7621-vmlinux.bin
md5sums                              openwrt-ramips-mt7621-vmlinux.elf
openwrt-ramips-mt7621-root.squashfs  packages
openwrt-ramips-mt7621-uImage.bin     vmlinux.bin.lzma

When looking at image/mt7621.mk files, lzma compression seems to be specified 2 ways:

define Device/dlink_dir-860l-b1
 279   $(Device/dsa-migration)
 280   $(Device/seama)
 281   BLOCKSIZE := 64k
 282   SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb
 283   LOADER_TYPE := bin
 284   KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | relocate-kernel | \
 285         lzma -a0 | uImage lzma
 286   IMAGE_SIZE := 16064k
 287   DEVICE_VENDOR := D-Link
 288   DEVICE_MODEL := DIR-860L
 289   DEVICE_VARIANT := B1
 290   DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport
 291   SUPPORTED_DEVICES += dir-860l-b1
 292 endef
 293 TARGET_DEVICES += dlink_dir-860l-b1

and

define Device/d-team_newifi-d2
 318   $(Device/dsa-migration)
 319   $(Device/uimage-lzma-loader)
 320   IMAGE_SIZE := 32448k
 321   DEVICE_VENDOR := Newifi
 322   DEVICE_MODEL := D2
 323   DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 \
 324         kmod-usb-ledtrig-usbport
 325 endef
 326 TARGET_DEVICES += d-team_newifi-d2

So two questions:
If this is a new device, do I need the dsa-migration line? Trendnet provides an older OpenWrt SDK and installing Trendnets OpenWrt build my provide an easy upgrade and I would not plan on keeping my old config.

Second question: can someone confirm if I need an lzma image and would the simpler d-team_newifi-d2 work?

If Trendnet offers a sysupgrade binary on their own firmware, that you can then use to install vanilla OpenWrt, you would need the dsa-migration line, yes.

The DIR-860L B1 uses a workaround because with kernel 5.4 the kernel got too big for the device. Hence the loader-kernel thing.

I don't think so. In all likelyness the Trendnet OEM firmware is based on Mediatek's SDK, the result is a heavily butchered up distant cousin to OpenWrt at best, but you have to expect considerable incompatibilities between the Trendnet configuration and OpenWrt (DSA would just be a minor bullet point here).

Once you come close to providing a pull request for your device support, you will have to consider how to document the initial OpenWrt installation - how this can be done depends entirely on the upgrade infrastructure Trendnet provides you with. For firmwares that are closely following OpenWrt's sysupgrade infrastructure (e.g. GL.Inet) this might actually be harder than for something that ignores OpenWrt conventions entirely, because only there you're faced with the problem of similar, but incompatible configurations taken over from the OEM firmware to OpenWrt (cases like this might need a firstboot step).

1 Like

I have the TTY/USB0 output but there is no bootdelay or key input. I was hoping to boot the initramfs image to test but unless I hack the image and change the boot-env settings, I have either the OEM GUI or an OEM rescue gui (reset button x 5 seconds on power up). I tried the OEM rescue gui and it would upload, but not flash my build.