Creating factory image for Comfast CF-E390AX

Hi all,
Need help with creating factory image for Comfast CF-E390AX.
I already initramfs image, and tested it, and it worked fine.
Now I want to create factory image. I added the following to the makefile:

define Device/comfast_cf-e390ax
  IMAGE_SIZE := 15232k
  DEVICE_PACKAGES := kmod-mt7915-firmware kmod-mt7915e -uboot-envtools 
  IMAGES += factory.bin
  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
	check-size | append-metadata
  IMAGE/factory.bin := append-kernel | append-rootfs | check-size
TARGET_DEVICES += comfast_cf-e390ax

however the oem gui is not accepting the generated image.
Checking the OEM imae, I see the following at the end of it. Could it be that such a header is needed? if so, what is the best way create it:

00a4fff0: ffff ffff ffff ffff ffff ffff ffff ffff  ................
00a50000: dead c0de 0000 0000 0000 0000 7b20 2022  ............{  "
00a50010: 7375 7070 6f72 7465 645f 6465 7669 6365  supported_device
00a50020: 7322 3a5b 2263 662d 6533 3930 6178 225d  s":["cf-e390ax"]
00a50030: 2c20 2276 6572 7369 6f6e 223a 207b 2022  , "version": { "
00a50040: 6469 7374 223a 2022 4c45 4445 222c 2022  dist": "LEDE", "
00a50050: 7665 7273 696f 6e22 3a20 2231 372e 3031  version": "17.01
00a50060: 2d53 4e41 5053 484f 5422 2c20 2272 6576  -SNAPSHOT", "rev
00a50070: 6973 696f 6e22 3a20 2272 3336 342b 3236  ision": "r364+26
00a50080: 362d 6139 3034 3835 3522 2c20 2262 6f61  6-a904855", "boa
00a50090: 7264 223a 2022 7261 6d69 7073 2220 7d20  rd": "ramips" } 
00a500a0: 7d0a 4657 7830 cf57 5609 0100 0000 0000  }.FWx0.WV.......
00a500b0: 00ae                                     ..

this device is the same as any mt7621 ax device, follow in this case the device like a youncore.

In this case I do not have the option to force flashing.
I can flash it using u-boot. However this is not user friendly enough.

Never mind, got it working using the built in web failsafe mode.
Now, need to figure out how to upload the patch, as this is my first time adding a new device to openwrt.

You can follow the OpenWrt: Submitting Patches guide.

Pull request adding this device.

Hey usamanassir, I was able to generate the firmware for this AP using your Github pull request – thanks a lot. I'm trying to get it installed but am having issues accessing the safe mode web UI at I press and hold the reset button while powering it on and the LED stops blinking after 10 seconds, at which point I release it. The COMFAST SSIDs don't show up, so I assume it's in safe mode. I've set an ethernet profile with manual IPv4 config (as below) and tried connecting an Ethernet cable from my PC to the other port on the AP and to the LAN port on the included PoE injector, and I've tried with the PoE cable connected to both ports on the AP, but no matter the configuration I can't access the safe mode web UI.


Are you able to tell me what I'm doing wrong and/or give step-by-step instructions?

Try connecting using chrome to:

please note that it should be http not https.
And somehow firefox is failing to upload the image, while chrome can do it.

Hey mate, thanks for the reply. That is what I'm doing, but there's nothing available at (either with automatic configuration or when setting it manually as per my previous post) using any web browser or pinging the IP directly.

Do you mind confirming exactly how you manually configured your IP in step 2 of the instructions in your pull request, as well how your PC was connected to the AP?

Update: tried with a different PC, was able to get to MediaTek U-Boot System Recovery Mode. Sadly, flashing my "openwrt-ramips-mt7621-comfast_cf-e390ax-squashfs-factory.bin" file doesn't seem to work. It displayes the green LED briefly on boot and then it flashes red for a long time before going to blue, and the OpenWrt admin page is not available. Will troubleshoot a bit more.

Actually this means that it worked.
Red led will flash while booting.
Blue is when the boot is over, and system is ready.
You should be able to connect to luci normally (, using the lan port

Ah, I've determined that my issue was forgotting to include LuCI in my config. :sweat_smile: This project is my first time using OpenWrt, let alone building it from source. I've done some pre-reading but evidently not enough.

Recompiled and it's now all working! Just have to read the OpenWrt docs to configure it the way I want for my network.

Thanks for your patience and especially for submitting the patch for this model – it was part of my reason to purchase this AP in the first place. :slightly_smiling_face: