Merge pull request 'Add support for TP-Link Archer AX23' (#6) from raboof/liminix:add-archer-ax23-v1-bak into main
Reviewed-on: https://gti.telent.net/dan/liminix/pulls/6
This commit is contained in:
commit
273c66b2d3
6 changed files with 528 additions and 1 deletions
|
@ -60,6 +60,9 @@ in
|
|||
Combined kernel and FDT in uImage (U-Boot compatible) format
|
||||
'';
|
||||
};
|
||||
tplink-safeloader = mkOption {
|
||||
type = types.package;
|
||||
};
|
||||
u-boot = mkOption {
|
||||
type = types.package;
|
||||
};
|
||||
|
|
61
modules/outputs/tplink-safeloader.nix
Normal file
61
modules/outputs/tplink-safeloader.nix
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkOption types concatStringsSep;
|
||||
o = config.system.outputs;
|
||||
cfg = config.tplink-safeloader;
|
||||
in {
|
||||
options.tplink-safeloader = {
|
||||
board = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
options.system.outputs = {
|
||||
tplink-safeloader = mkOption {
|
||||
type = types.package;
|
||||
description = ''
|
||||
tplink-safeloader
|
||||
*****************
|
||||
|
||||
For creating 'safeloader' images for tp-link devices.
|
||||
|
||||
These can be flashed to the device using the firmware update feature
|
||||
in the TP-link web UI or the OEM bootloader recovery: Use something
|
||||
sharp to hold the 'reset' button while turning on the router until
|
||||
only the orange LED remains lit. The router will assume IP address
|
||||
192.168.0.1 and expect you to take 192.168.0.5 on one of the LAN ports.
|
||||
On NixOS, use something like::
|
||||
|
||||
networking.interfaces.enp0s20f0u1c2 = {
|
||||
ipv4.addresses = [ {
|
||||
address = "192.168.0.5";
|
||||
prefixLength = 24;
|
||||
} ];
|
||||
};
|
||||
networking.networkmanager = {
|
||||
unmanaged = [ "enp0s20f0u1c2" ];
|
||||
};
|
||||
|
||||
This connection is rather somewhat temperamental, it may take a couple
|
||||
of attempts, possibly re-attaching the USB dongle and running
|
||||
``systemctl restart network-start.service``. The web interface does not
|
||||
give accurate feedback (the progress bar is a lie), so you may want
|
||||
to upload the firmware using ``curl -F firmware=@result http://192.168.0.1/f2.htm``.
|
||||
After this shows a 'success' JSON, the image still needs to be
|
||||
transferred from memory to flash, so be patient.
|
||||
'';
|
||||
};
|
||||
};
|
||||
config = {
|
||||
system.outputs = rec {
|
||||
tplink-safeloader =
|
||||
pkgs.runCommand "tplink" { nativeBuildInputs = with pkgs.pkgsBuildBuild; [ firmware-utils ]; } ''
|
||||
tplink-safeloader -B "${cfg.board}" -k "${o.uimage}" -r "${o.rootfs}" -o $out
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue