jeffsf
4
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 http://192.168.1.1/index.html
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 http://192.168.1.1/index.html
The proper parameters can be determined by looking at the U-Boot upload page’s source, or by
$ curl http://192.168.1.1/
<!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="https://github.com/pepe2k/u-boot_mod" 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>
<form method="post" enctype="multipart/form-data">
<input type="file" name="nor__firmware">
<input type="submit" value="Update nor firmware">
</form>
1 Like