aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
Commit message (Collapse)AuthorAgeFilesLines
* ramips: disable image build for HiWiFi HC5962David Bauer2020-01-091-0/+2
| | | | | | | | Image builds for the ramips-mt7621 target currently fail with: > WARNING: Image file ./hiwifi_hc5962-kernel.bin is too big Disable this board for now. It can still be built using the SDK. Signed-off-by: David Bauer <mail@david-bauer.net>
* kernel: remove support for kernel 4.9Adrian Schmutzler2020-01-08223-36555/+0
| | | | | | No target uses kernel 4.9 anymore. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ixp4xx: remove unmaintained targetAdrian Schmutzler2020-01-0859-10319/+0
| | | | | | | | | | | This target is still on kernel 4.9, and it looks like there is no active maintainer for this target anymore. Remove the code and all the packages which are only used by this target. To add this target to OpenWrt again port it to a recent and supported kernel version. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* orion: remove unmaintained targetAdrian Schmutzler2020-01-0818-1552/+0
| | | | | | | | | | | This target seems to have been unmaintained for quite a while, and not a single tester for the (now outdated) kernel 4.14 patches has been found. Remove the code and all the packages which are only used by this target. To add this target to OpenWrt again port it to a recent and supported kernel version. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ar7: remove unmaintained targetAdrian Schmutzler2020-01-0829-1803/+0
| | | | | | | | | | | This target seems to have been unmaintained for quite a while, and not a single tester for the (now outdated) kernel 4.14 patches has been found. Remove the code and all the packages which are only used by this target. To add this target to OpenWrt again port it to a recent and supported kernel version. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* orion: update kernel to version 4.14Hauke Mehrtens2020-01-089-42/+59
| | | | | | | | | | | | | This adds support for kernel 4.14 to the target and directly make it the default kernel version to use. This patch is build-tested only, but has never been device-tested. It is only added to preserve the changes in Git history prior to removing this target. Use it with care. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> [rebased and extended commit message, refreshed patches for 4.14.162] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* orion: refresh kernel configurationHauke Mehrtens2020-01-082-22/+41
| | | | | | | The configuration of the generic subtarget was used as the default configuration and then the subtarget configurations were adapted. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* ar7: update kernel to version 4.14Hauke Mehrtens2020-01-0813-63/+33
| | | | | | | | | | | | | This adds support for kernel 4.14 to the target and directly make it the default kernel version to use. This patch is build-tested only, but has never been device-tested. It is only added to preserve the changes in Git history prior to removing this target. Use it with care. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> [rebased and extended commit message, refreshed patches for 4.14.162] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ar7: refresh kernel configurationHauke Mehrtens2020-01-081-0/+3
| | | | | | | The configuration of the generic subtarget was used as the default configuration and then the subtarget configurations were adapted. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* ramips: add label MAC address for Xiaomi MIR3GAdrian Schmutzler2020-01-081-5/+3
| | | | | | | | | | | | | | | | | | | | | | | The device label shows the address currently assigned to the OpenWrt LAN interface. Current setup is: LAN *:b8 factory 0xe006 label WAN *:b7 factory 0xe000 For vendor FW bootlog we get (manually removed parts of the address): [ 7.520000] set LAN/WAN LWLLL [ 7.530000] GMAC1_MAC_ADRH -- : 0x00004031 [ 7.530000] GMAC1_MAC_ADRL -- : 0x3c****b7 [ 7.530000] GDMA2_MAC_ADRH -- : 0x00004031 [ 7.540000] GDMA2_MAC_ADRL -- : 0x3c****b8 [ 7.540000] eth1: ===> VirtualIF_open Without further information, this does not allow verification of the currently unexpected LAN/WAN assignment (we would expect 0xe000 to be LAN). Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ath79: remove unused Build/mktplinkfw-combinedAdrian Schmutzler2020-01-081-11/+0
| | | | | | Build/mktplinkfw-combined is not used anywhere, so remove it. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: move mktplinkfw to tplink-v1-image in image-commands.mkAdrian Schmutzler2020-01-085-82/+19
| | | | | | | | | | | | | | | | | | | | | This move the slightly different target-specific implementations of mktplinkfw from the targets to include/image-commands.mk and renames it to tplink-v1-image. Having a common version will increase consistency between implementation and will complete the tplink build command already present in the new location. Due to the slight differences of the original implementations, this also does some adjustments to the device build commands/variables. This also moves rootfs_align as this is required as dependency. Tested on: - TL-WDR4300 v1 (ath79, factory) - TL-WDR4900 v1 (mpc85xx, sysupgrade) - RE210 v1 (ramips, see Tested-by) Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Tested-by: Christoph Krapp <achterin@googlemail.com>
* ipq806x: refresh kernel patchesÁlvaro Fernández Rojas2020-01-085-6/+6
| | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* ipq806x: add fab scaling supportAnsuel Smith2020-01-082-0/+252
| | | | | | Add fab scaling support and dtsi definition Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: refactor l2 freq scaling patchAnsuel Smith2020-01-083-40/+120
| | | | | | | | | Refactor l2 freq scaling patch to support voltage scaling and add support to base cache scaling on cpu freq scaling. Update the dtsi files with the new definition used in the new code. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: reorganize nand_pins mux definitionAnsuel Smith2020-01-089-44/+68
| | | | | | | | | | | | | | It's wrong set the mux to bias-disable. The best way to do this is by creating a separate group and disable the specific pins. By documentation, any subgroup with no bias definition is ignored so the mux definition is useless. Rework the definition by sremoving the mux subgroup and set the remaining subgroup with the mux function and drive-strength Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ipq806x: opp/core: fix broken patch Handle opp voltage adjustAnsuel Smith2020-01-082-11/+4
| | | | | | | | | | The opp_notifier introduced with patch 0054-Handle-OPP-voltage adjust for some reason missed the actual registration in the opp struct, resulting in never being registred. This was present in kernel 4.9 patchset but dropped in the transition to 4.14. Reintroduce this and fix patch 0055 about L2 cache scaling. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* ramips: add support for ipTIME A8004TYong-hyu Ban2020-01-053-2/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ipTIME A8004T is a 2.4/5GHz band AC2600 router, based on Mediatek MT7621A. Specifications: - SoC: MT7621A - RAM: DDR3 256M - Flash: SPI NOR 16MB - WiFi: - 2.4GHz: MT7615E - 5GHz: MT7615E - Ethernet: 5x 10/100/1000Mbps - Switch: SoC internal - USB: 1 * USB3.0 port - UART: - J4: 3.3V, TX, RX, GND (3.3V is the square pad) / 57600 8N1 - Other info: - J9: Unknown unpopulated header. Installation via web interface: 1. Flash **initramfs** image through the stock web interface. 2. Boot into OpenWrt and perform sysupgrade with sysupgrade image. Revert to stock firmware: 1. Perform sysupgrade with stock image. Signed-off-by: Yong-hyu Ban <perillamint@quendi.moe> [do not enable xhci node in DTS which is already enabled in DTSI] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add label MAC address for Netgear EX6130Adrian Schmutzler2020-01-051-0/+1
| | | | | | | The MAC address on the label of this device corresponds to the 2.4 GHz and ethernet MAC address. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: remove duplicate dts nodes of MediaTek LinkIt Smart 7688Jack Chen2020-01-051-4/+0
| | | | | | | There are two identical wmac nodes in the dts file of MediaTek LinkIt Smart 7688, so delete one of them. Signed-off-by: Jack Chen <redchenjs@live.com>
* ramips: reduce lzma dictionary size for D-Link DIR-645Mason Clarke2020-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently this device fails to boot with the OpenWrt snapshot images (release images are unaffected). The error message is: "LZMA ERROR 1 - must RESET board to recover". This happens because the kernel image is too big for the bootloader to boot. This commit works around this by decreasing the lzma dictionary size option from the default 23 to 10. Before this change the current OpenWrt snapshot image (uncompressed kernel size 4875139 bytes) failed to boot, while now an even bigger image (kernel 4.19 with snapshot default config; uncompressed kernel size 5162833 bytes) boots just fine. The highest lzma dictionary size option this image booted with was 11. 10 was chosen to have a bit more room for growth. An unavoidable side-effect of this change is that the compressed kernel image will take up more space. Total image size with different dictionary size options: D23 - 3973903 bytes (base) D16 - 4113167 bytes (+3.5% - +139264 bytes) D12 - 4317967 bytes (+8.7% - +344064‬ bytes) D11 - 4383503 bytes (+10.3% - +409600 bytes) D10 - 4461327 bytes (+12.3% - +487424 bytes) Fixes: FS#1484 Signed-off-by: Mason Clarke <mclarke2355@gmail.com>
* ath79: use ath10k-ct-smallbuffers for TP-Link RE355/RE450 v1Christoph Krapp2020-01-051-1/+1
| | | | | | | | | Both devices are available in 64M and 128M RAM configurations but there is no visial indication which configuration one might get. So just to be sure we properly support both configurations switch to kmod-atk10k-ct-smallbuffers. Signed-off-by: Christoph Krapp <achterin@googlemail.com>
* ath79: drop obsolete ehci hacksBjørn Mork2020-01-052-206/+0
| | | | | | | There's nothing enabling these hacks in ath79, so drop the redundant patches. Signed-off-by: Bjørn Mork <bjorn@mork.no>
* ath79: Remove mtd cfi_cmdset_0002 status check patchesTokunori Ikegami2020-01-052-124/+0
| | | | | | | | | | | | | Currently the patch only changes break to use goto statement instead. But not necessary acutually since the ret value checked after the for loop. So it is okay for the break case before changed by the patch also. This patch only reverts the following commit partially. https://github.com/openwrt/openwrt/commit/ddc11c3932c7b7b7df7d5fbd48f207e7 Note: The changes are mainly applied into the linux kernel upstream. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com> Cc: Koen Vandeputte <koen.vandeputte@ncentric.com>
* ar71xx: Remove mtd cfi_cmdset_0002 status check patchTokunori Ikegami2020-01-051-62/+0
| | | | | | | | | | | | | Currently the patch only changes break to use goto statement instead. But not necessary acutually since the ret value checked after the for loop. So it is okay for the break case before changed by the patch also. This patch only reverts the following commit partially. https://github.com/openwrt/openwrt/commit/ddc11c3932c7b7b7df7d5fbd48f207e77619eaa7 Note: The changes are mainly applied into the linux kernel upstream. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com> Cc: Koen Vandeputte <koen.vandeputte@ncentric.com>
* ipq806x: remove CONFIG_MDIO_IPQ8064 symbolChristian Lamparter2020-01-051-1/+0
| | | | | | This driver is not available on upstream. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ramips: fix sysupgrade image for TP-Link RE200v1Andreas Böhler2020-01-051-1/+1
| | | | | | | Images generated for the TP-Link RE200v1 cannot be updated using sysupgrade, because a necessary call to append-metadata was missing. Signed-off-by: Andreas Böhler <dev@aboehler.at>
* kernel: bump 4.9 to 4.9.208Hauke Mehrtens2020-01-055-14/+14
| | | | | | | | | Refreshed all patches. Compile-tested on: none Runtime-tested on: none Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: bump 4.19 to 4.19.93Hauke Mehrtens2020-01-0525-217/+195
| | | | | | | | | | | | | | Refreshed all patches. The patch hack-4.19/550-loop-better-discard-for-block-devices.patch was replaced with an new version of the patch from: https://lore.kernel.org/patchwork/patch/1153625/ https://lore.kernel.org/patchwork/patch/1153626/ Compile-tested on: ipq40xx, lantiq Runtime-tested on: ipq40xx, lantiq Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: bump 4.14 to 4.14.162Hauke Mehrtens2020-01-059-23/+23
| | | | | | | | | Refreshed all patches. Compile-tested on: ramips Runtime-tested on: ramips Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* ramips: add support for Edimax RA21SMaksym Medvedev2020-01-045-107/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Edimax RA21S is a dual band 11ac router, based on MediaTek MT7621A and MT7615N chips. Specification: - SoC: MediaTek MT7621A dual-core @ 880MHz - RAM: 256M (Nanya NT5CC128M16IP) - FLASH: 16MB (Macronix MX25L12835F) - WiFi: 2.4/5 GHz 4T4R - 2.4GHz MediaTek MT7615N bgn - 5GHz MediaTek MT7615N nac - Switch: SoC integrated Gigabit Switch (4 x LAN, 1 x WAN) - USB: No - BTN: Reset, WPS - LED: 4 red LEDs, indistinguishable when case closed - UART: through-hole on PCB. J1: 3.3V - RX - GND - TX / 57600-8N1. 3.3V is the square pad Installation: Update the factory image via the OEM web-interface (by default: http://192.168.2.1/) User: admin Password: 1234 The sysupgrade image can be installed via TFTP from the U-Boot bootloader. Connect via ethernet port 2. Tested on device by @UAb5eSMn Signed-off-by: Maksym Medvedev <redrathnure@gmail.com> [split DTS and take over improvements from RG21S, extend commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* generic: fix compiler error in OpenWrt's kexec patchDaniel Golle2020-01-043-17/+23
| | | | | | | | | | | | | | | 330-MIPS-kexec-Accept-command-line-parameters-from-users.patch causes problems when building with -Werror=unused-result. arch/mips/kernel/machine_kexec.c: In function 'machine_kexec_init_argv': arch/mips/kernel/machine_kexec.c:76:2: error: ignoring return value of 'copy_from_user', declared with attribute warn_unused_result [-Werror=unused-result] copy_from_user(kexec_argv_buf, buf, size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Fix this by handling the return value in an appropriate way. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: bump 4.14 to 4.14.161Hauke Mehrtens2020-01-0414-106/+106
| | | | | | | | | Refreshed all patches. Compile-tested on: ipq40xx, ramips Runtime-tested on: ipq40xx Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* sunxi: Turn on CONFIG_PINCTRL_SUN4I_A10 for A20Florian Fainelli2020-01-031-1/+1
| | | | | | | | | | CONFIG_PINCTRL_SUN4I_A10 controls both the A10 and the A20 enablong of the pinctrl driver, this is necessary since upstream commit 5d8d349618a9464714c07414c5888bfd9416638f ("pinctrl: sunxi: add A20 support to A10 driver") which has been included in v4.13 and onwards. Fixes: ad2b3bf310f7 ("sunxi: Add support for kernel 4.14") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* ramips: fix inverted reset button for Ravpower WD03Moritz Warning2020-01-031-1/+1
| | | | | | The button events "pressed" and "released" were switched. Tested with v18.06.4. Signed-off-by: Moritz Warning <moritzwarning@web.de>
* ramips: move set-irq-affinity script to mt7621 subtargetDENG Qingfang2020-01-031-0/+0
| | | | | | | Move the set-irq-affinity script to mt7621 because it is the only SMP subtarget. Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* lantiq: use shared code for LED migrationAdrian Schmutzler2020-01-031-45/+6
| | | | | | | | | | Shared base-files package contains functions for LED migration that are already used by several targets. Apply those also to lantiq and drop the (redundant) local code. While at it, reorder board names in file. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* lantiq: remove includes of non-existent /lib/functions/lantiq.shAdrian Schmutzler2020-01-032-3/+0
| | | | | | | lantiq.sh is still included in files which do not use it anymore. Remove the includes. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* samsung: add subtarget condition for deviceAdrian Schmutzler2020-01-031-0/+4
| | | | | | | | | The only device in samsung target is meant to be built with s5pv210 subtarget. Thus, though this won't make a difference for a one-subtarget target, already add the condition to the Makefile to make the assignment obvious. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* samsung: use soc_vendor_model scheme for DTS file nameAdrian Schmutzler2020-01-032-5/+6
| | | | | | | | | | | | | This patch changes the samsung target to calculate the DTS file name from vendor and device name and the SOC (i.e. subtarget) following the common scheme: soc_vendor_model.dts This also updates the device definition name to make compatible, image name, menuconfig name and DTS name consistent. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: fix Archer C20i wireless MAC addressDavid Bauer2020-01-021-0/+9
| | | | | | | | | | The TP-Link Archer C20i previously had a generic Ralink MAC address set for both radios, as the caldata does only contain a generic MAC address. Set the MAC address from the vendor firmware for both radios to assign unique MAC addresses to every device. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: fix Archer C2 v1 5GHz MAC addressDavid Bauer2020-01-021-0/+2
| | | | | | | | | | | The TP-Link Archer C2 v1 previously had a generic Ralink MAC address set for the 5GHz radio (MT7610), as the caldata does only contain a generic MAC address. Set the MAC address from the vendor firmware for the 5GHz radio to assign unique MAC addresses to every device. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: add system LED indicators for TP-Link C20iDavid Bauer2020-01-021-1/+5
| | | | | | | Use the WPS LED to indicate system status like it is done for the TP-Link Archer C2 v1 and many other boards. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: convert TP-Link MT7620 boards to tpt triggerDavid Bauer2020-01-027-7/+8
| | | | | | | | | | | | This converts all MediaTek MT7620 boards from TP-Link to use the now supported WiFi throughput LED trigger. This way, the LED state now covers all VAPs regardless of their name. Also align all single-WiFi LEDs to represent the state of the 2.4GHz radio. This was not always the case previously, as later-added support for the MT7610 altered the phy probing order. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: mt7620: use throughput trigger on HiWiFi HC5x61DENG Qingfang2019-12-314-8/+6
| | | | | | Throughput trigger support for MT7620 has been added, so switch to it Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* ramips: remove HiWiFi HC5661 non-existent 5GHz LEDDENG Qingfang2019-12-311-5/+0
| | | | | | | | HC5661 does not have 5GHz WiFi or LED. Fixes: e6e373d3480e ("ramips: Add DTS files for HiWiFi HC5x61 models") Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* ramips: add support for TP-Link RE200 v1Andreas Böhler2019-12-314-0/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TP-Link RE200 v1 is a wireless range extender with Ethernet and 2.4G and 5G WiFi with internal antennas. It's based on MediaTek MT7620A+MT7610EN. Specifications -------------- - MediaTek MT7620A (580 Mhz) - 64 MB of RAM - 8 MB of FLASH - 2T2R 2.4 GHz and 1T1R 5 GHz - 1x 10/100 Mbps Ethernet - UART header on PCB (57600 8n1) - 8x LED (GPIO-controlled; only 6 supported), 2x button There are 2.4G and 5G LEDs in red and green which are controlled separately. The 5G LED is currently not supported, since the GPIOs couldn't be determined. Installation ------------ Web Interface ------------- It is possible to upgrade to OpenWrt via the web interface. However, the OEM firmware upgrade file is required and a tool to fix the MD5 sum of the header. This procedure overwrites U-Boot and there is not failsafe / recovery mode present! To prepare an image, you need to take the header and U-Boot (i.e. 0x200 + 0x20000 bytes) from an OEM firmware file and attach the factory image to it. Then fix the header MD5Sum1. Serial console -------------- Opening the case is quite hard, since it is welded together. Rename the OpenWrt factory image to "test.bin", then plug in the device and quickly press "2" to enter flash mode (no line feed). Follow the prompts until OpenWrt is installed. Unfortunately, this devices does not offer a recovery mode or a tftp installation method. If the web interface upgrade fails, you have to open your device and attach serial console. Since the web upgrade overwrites the boot loader, you might also brick your device. Additional notes ---------------- MAC address assignment is based on stock-firmware. For me, the device assigns the MAC on the label to Ethernet and the 2.4G WiFi, while the 5G WiFi has a separate MAC with +2. *:88 Ethernet/2.4G label, uboot 0x1fc00, userconfig 0x0158 *:89 unused userconfig 0x0160 *:8A 5G not present in flash This seems to be the first ramips device with a TP-Link v1 header. The original firmware has the string "EU" embedded, there might be some region- checking going on during the firmware upgrade process. The original firmware also contains U-Boot and thus overwrites the boot loader during upgrade. In order to flash back to stock, the first header and U-Boot need to be stripped from the original firmware. Signed-off-by: Andreas Böhler <dev@aboehler.at>
* ramips: fix switch setup for Xiaomi MiWiFi NanoSungbo Eo2019-12-312-2/+10
| | | | | | | MiWiFi Nano has two LAN ports, which are in reverse order. Add port numbers to them, and disable unused ports. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* mvebu: split interface configuration for clearfog pro and baseJosua Mayer2019-12-311-6/+10
| | | | | | | Handle both variants separately. This removes the need for calling swconfig to detect the switch, and simplifies future changes. Signed-off-by: Josua Mayer <josua.mayer@jm0.eu>
* ath79: generate firmware image for aircube-ispChristian Mauderer2019-12-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a "factory" image for the aircube-isp devices. Note that the firmware can't be uploaded without prior special preparation. For the most recent instructions on how to do that, visit the OpenWRT wiki page of the Ubiquiti airCube ISP for details: https://openwrt.org/toh/ubiquiti/ubiquiti_aircube_isp Current procedure: With the original firmware 2.5.0 it is possible to upload and execute a script via the configuration. To do that download and unpack the original configuration, adapt uhttpd config to execute another lua handler (placed in the config directory) and pack and upload it again. The lua handler can call a script that mounts an overlayfs and modifies the "fwupdate.real" binary so that an unsigned image is accepted. The overlayfs is necessary because a security system (called tomoyo) doesn't allow binaries in other locations than /sbin/fwupdate.real (and maybe some more) to access the flash when executed via network. A big thanks to Torvald Menningen (Snap) from the OpenWRT forum for finding out how to patch the binary so that it accepts an unsigned image. The current step-by-step procedure is: - Use a version 2.5.0 of the original firmware. This is important because a binary file will be modified. - Download a configuration. - Unpack it (it's just a tar gz file without an ending). - Add the following to uhttpd: `````` config 'uhttpd' 'other' list listen_http 0.0.0.0:8080 list listen_http [::]:8080 option 'home' '/tmp/persistent/config/patch/www' option lua_prefix '/lua' option lua_handler '/tmp/persistent/config/patch/handler.lua' `````` - Create a `patch` subfolder. - Create a `patch/www` subfolder. - Create a `patch/handler.lua` with the following content: `````` function handle_request(env) uhttpd.send("Status: 200 OK\r\n") uhttpd.send("Content-Type: text/plain\r\n\r\n") local command = "/bin/sh /tmp/persistent/config/patch/patch.sh 2>&1" local proc = assert(io.popen(command)) for line in proc:lines() do uhttpd.send(line.."\r\n") end proc:close() end `````` - Create a `patch/patch.sh` with the following content: `````` #!/bin/sh -x set -e set -u set -x UBNTBOX_PATCHED="/tmp/fwupdate.real" MD5FILE="/tmp/patchmd5" cat <<EOF > ${MD5FILE} c33235322da5baca5a7b237c09bc8df1 /sbin/fwupdate.real EOF # check md5 of files that will be patched if ! md5sum -c ${MD5FILE} then echo "******** Error when checking files. Refuse to do anything. ********" exit 0 fi # prepare some overlay functionality LOWERDIR="/tmp/lower_root" mkdir -p ${LOWERDIR} mount -t squashfs -oro /dev/mtdblock3 ${LOWERDIR} overlay_some_path() { PATH_TO_OVERLAY=$1 ALIAS=$2 UPPERDIR="/tmp/over_${ALIAS}" WORKDIR="/tmp/over_${ALIAS}_work" mkdir -p ${UPPERDIR} mkdir -p ${WORKDIR} mount -t overlay -o lowerdir=${LOWERDIR}${PATH_TO_OVERLAY},upperdir=${UPPERDIR},workdir=${WORKDIR} overlay ${PATH_TO_OVERLAY} } # patch the ubntbox binary. overlay_some_path "/sbin" "sbin" echo -en '\x10' | dd of=/sbin/fwupdate.real conv=notrunc bs=1 count=1 seek=24598 echo "******** Done ********" `````` - Repack the configuration. - Upload it via the normal web interface. - Wait about a minute. The webserver should restart. - Now there is a second web server at port 8080 which can call the lua script. Visit the page with a web browser. Link is for example http://192.168.1.1:8080/lua - You should see the output of the script with a "*** Done ***" at the end. Note that the patches are not permanent. If you restart the router you have to re-visit the link (but not re-upload the config). - Now you can upload an unsigned binary via the normal web interface. Signed-off-by: Christian Mauderer <oss@c-mauderer.de>