Build Clean Image, mt300n


I am able to build sysupgrade images for the mt300n, add / remove packages, etc. - no issues at all. But struggling to build a clean image (to flash from U-Boot recovery). Any special tricks to make this work? I can build kernel.bin, but that doesn’t seem to work either.

I have seen some info around about Image Builder, but if possible I’d like to build from my same / normal OpenWrt environment (just with a different image type perhaps, for a clean image).


Gl.iNet or OpenWrt source tree?

For the NOR-based, GL.iNet devices I work with (GL-AR300M, GL-AR750S), the U-Boot is “smart enough” to take sysupgrade.bin images. There is no “special” image needed.

1 Like

Sorry, I should have been more clear! OpenWrt source tree. And I admit,I just assumed (perhaps incorrectly) that I needed to use some sort of clean build - not the sysupgrade image. I can try that if it makes sense to.


Check this for the MTK-based devices, as my work has only been with the QCA-based devices!

My notes show that, for the GL-AR300M, if you don’t want to use the GUI (my build machine is headless), you can use

curl -X POST -F nor__firmware=\@_tmp/ar300m-nor.bin

or, for NAND firmware

curl -X POST -F nand_firmware=\@latest/OpenWrt-2019-06-04_1156-0700-ath79-nand-glinet_gl-ar300m-nand-squashfs-factory.img

The proper parameters can be determined by looking at the U-Boot upload page’s source, or by

$ curl
<!DOCTYPE HTML><html><head><meta charset="utf-8"><title>Firmware update</title><link rel="stylesheet" href="style.css"></head><body><div id="m"><h1>FIRMWARE UPDATE</h1><p>You are going to update <strong>firmware</strong> on the device.<br>Please, choose file from your local hard drive and click <strong>Update firmware</strong> button.</p><p>For <b>NAND</b> flash firmware (*.img), please use this form.</p><form method="post" enctype="multipart/form-data"><input type="file" name="nand_firmware"><input type="submit" value="Update nand firmware"></form><p>For <b>NOR</b> flash firmware (*.bin), please use this form.</p><form method="post" enctype="multipart/form-data"><input type="file" name="nor__firmware"><input type="submit" value="Update nor  firmware"></form><div class="i w"><strong>WARNINGS</strong><ul><li>do not power off the device during update</li><li>if everything goes well, the device will restart</li><li>you can upload whatever you want, so be sure that you choose proper firmware image for your device</li></ul></div></div><div id="f">You can find more information about this project on <a href="" target="_blank">GitHub</a></div></body></html>

In particular (pretty printed)

<form method="post" enctype="multipart/form-data">
  <input type="file" name="nand_firmware">
  <input type="submit" value="Update nand firmware">

<form method="post" enctype="multipart/form-data">
  <input type="file" name="nor__firmware">
  <input type="submit" value="Update nor firmware">
1 Like

Thanks so much for the help! I admit, I was surprised … but yep, the sysupgrade bin file worked just fine from U-Boot. Awesome.

Much appreciated!

1 Like