commit 9f3c8f7cbd684aad4367ceefd5d4434bd8b531d4
parent 9784e90d1f2603b1129adcef1bf953bc08500661
Author: Daniel Barlow <dan@telent.net>
Date: Tue, 11 Nov 2025 21:49:45 +0000
treewide: nixfmt and deadnix
Diffstat:
65 files changed, 1872 insertions(+), 1846 deletions(-)
diff --git a/bordervm-configuration.nix b/bordervm-configuration.nix
@@ -131,13 +131,17 @@ in
# expose victorialogs on host so (clients attached to) guest
# can log
from = "guest"; # packets are forwarded from guest
- guest.address = "10.0.2.10"; guest.port = 443;
- host.address = "127.0.0.1"; host.port = 443;
+ guest.address = "10.0.2.10";
+ guest.port = 443;
+ host.address = "127.0.0.1";
+ host.port = 443;
}
{
from = "guest"; # packets are forwarded from guest
- guest.address = "10.0.2.10"; guest.port = 19613;
- host.address = "127.0.0.1"; host.port = 19613;
+ guest.address = "10.0.2.10";
+ guest.port = 19613;
+ host.address = "127.0.0.1";
+ host.port = 19613;
}
];
qemu = {
diff --git a/ci.nix b/ci.nix
@@ -35,7 +35,7 @@ let
device = import (liminix + "/devices/qemu");
liminix-config = vanilla;
}).buildEnv;
- doc = pkgs.callPackage ./doc.nix { inherit liminix borderVmConf; } ;
+ doc = pkgs.callPackage ./doc.nix { inherit liminix borderVmConf; };
};
in
jobs
diff --git a/devices/belkin-rt3200/default.nix b/devices/belkin-rt3200/default.nix
@@ -1,106 +1,106 @@
{
description = ''
-== Belkin RT-3200 / Linksys E8450
-
-This device is based on a 64 bit Mediatek MT7622 ARM platform, and has
-been powering my (Daniel's) home network since February 2025.
-
-=== Hardware summary
-
-* MediaTek MT7622BV (1350MHz)
-* 128MB NAND flash
-* 512MB RAM
-* b/g/n wireless using MediaTek MT7622BV (MT7615E driver)
-* a/n/ac/ax wireless using MediaTek MT7915E
-
-=== Installation
-
-Liminix on this device uses the UBI volume management system to perform
-wear leveling on the flash. This is not set up from the factory, so a
-one-time step is needed to prepare it before Liminix can be installed.
-
-==== Preparation
-
-To prepare the device for Liminix you first need to use the
-https://github.com/dangowrt/owrt-ubi-installer[OpenWrt UBI Installer]
-image to rewrite the flash layout. As of Jan 2025 there are two versions
-of the installer available: the release version 1.0.2 and the
-pre-release 1.1.3 and for Liminix you nee the pre-release. The release
-version of the installer creates UBI volumes according to an older
-layout that is not compatible with the Linux 6.6.67 kernel used in
-Liminix.
-
-You can run the installer in one of two ways: either follow the
-instructions to do it through the vendor web interface, or you can drop
-to U-Boot and use TFTP
-
-[source,console]
-----
-MT7622> setenv ipaddr 10.0.0.6
-MT7622> setenv serverip 10.0.0.1
-MT7622> tftpboot 0x42000000 openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery-installer.itb
-MT7622> bootm 0x42000000
-----
-
-This will write the new flash layout and then boot into a "recovery"
-OpenWrt installation.
-
-==== Building/installing Liminix
-
-The default target for this device is `+outputs.ubimage+` which makes a
-ubifs image suitable for use with `+ubiupdatevol+`. To write this to the
-device we use the OpenWrt recovery system installed in the previous
-step. In this configuration the device assigns itself the IP address
-192.168.1.1/24 on its LAN ports and expects the connected computer to
-have 192.168.1.254
-
-[WARNING]
-====
-The [.title-ref]#ubi0_7# device in these instructions is correct as of
-Dec 2024 (dangowrt/owrt-ubi-installer commit d79e7928). If you are
-installing some time later, it is important to check the output from
-`+ubinfo -a+` and make sure you are updating the "liminix" volume and
-not some other one which had been introduced since I wrote this.
-====
-
-[source,console]
-----
-$ nix-build -I liminix-config=./my-configuration.nix --arg device "import ./devices/belkin-rt3200" -A outputs.default
-$ cat result/rootfs | ssh root@192.168.1.1 "cat > /tmp/rootfs"
-$ ssh root@192.168.1.1
-root@OpenWrt:~# ubimkvol /dev/ubi0 --name=liminix --maxavsize
-root@OpenWrt:~# ubinfo -a
-[...]
-Volume ID: 7 (on ubi0)
-Type: dynamic
-Alignment: 1
-Size: 851 LEBs (108056576 bytes, 103.0 MiB)
-State: OK
-Name: liminix
-Character device major/minor: 250:8
-root@OpenWrt:~# ubiupdatevol /dev/ubi0_7 /tmp/rootfs
-----
-
-To make the new system bootable we also need to change some U-Boot
-variables. `+boot_production+` needs to mount the filesystem and boot
-the FIT image found there, and `+bootcmd+` needs to be told not to boot
-the rescue image if there are records in pstore, because that interferes
-with `+config.log.persistent+`
-
-[source,console]
-----
-root@OpenWrt:~# fw_setenv orig_boot_production $(fw_printenv -n boot_production)
-root@OpenWrt:~# fw_setenv orig_bootcmd $(fw_printenv -n bootcmd)
-root@OpenWrt:~# fw_setenv boot_production 'led $bootled_pwr on ; ubifsmount ubi0:liminix && ubifsload ''${loadaddr} boot/fit && bootm ''${loadaddr}'
-root@OpenWrt:~# fw_setenv bootcmd 'run boot_ubi'
-----
-
-For subsequent Liminix reinstalls, just run the `+ubiupdatevol+` command
-again. You don't need to repeat the "Preparation" step and in fact
-should seek to avoid it if possible, as it will reset the erase counters
-used for write levelling. Using UBI-aware tools is therefore preferred
-over any kind of "factory" wipe which will reset them.
+ == Belkin RT-3200 / Linksys E8450
+
+ This device is based on a 64 bit Mediatek MT7622 ARM platform, and has
+ been powering my (Daniel's) home network since February 2025.
+
+ === Hardware summary
+
+ * MediaTek MT7622BV (1350MHz)
+ * 128MB NAND flash
+ * 512MB RAM
+ * b/g/n wireless using MediaTek MT7622BV (MT7615E driver)
+ * a/n/ac/ax wireless using MediaTek MT7915E
+
+ === Installation
+
+ Liminix on this device uses the UBI volume management system to perform
+ wear leveling on the flash. This is not set up from the factory, so a
+ one-time step is needed to prepare it before Liminix can be installed.
+
+ ==== Preparation
+
+ To prepare the device for Liminix you first need to use the
+ https://github.com/dangowrt/owrt-ubi-installer[OpenWrt UBI Installer]
+ image to rewrite the flash layout. As of Jan 2025 there are two versions
+ of the installer available: the release version 1.0.2 and the
+ pre-release 1.1.3 and for Liminix you nee the pre-release. The release
+ version of the installer creates UBI volumes according to an older
+ layout that is not compatible with the Linux 6.6.67 kernel used in
+ Liminix.
+
+ You can run the installer in one of two ways: either follow the
+ instructions to do it through the vendor web interface, or you can drop
+ to U-Boot and use TFTP
+
+ [source,console]
+ ----
+ MT7622> setenv ipaddr 10.0.0.6
+ MT7622> setenv serverip 10.0.0.1
+ MT7622> tftpboot 0x42000000 openwrt-mediatek-mt7622-linksys_e8450-ubi-initramfs-recovery-installer.itb
+ MT7622> bootm 0x42000000
+ ----
+
+ This will write the new flash layout and then boot into a "recovery"
+ OpenWrt installation.
+
+ ==== Building/installing Liminix
+
+ The default target for this device is `+outputs.ubimage+` which makes a
+ ubifs image suitable for use with `+ubiupdatevol+`. To write this to the
+ device we use the OpenWrt recovery system installed in the previous
+ step. In this configuration the device assigns itself the IP address
+ 192.168.1.1/24 on its LAN ports and expects the connected computer to
+ have 192.168.1.254
+
+ [WARNING]
+ ====
+ The [.title-ref]#ubi0_7# device in these instructions is correct as of
+ Dec 2024 (dangowrt/owrt-ubi-installer commit d79e7928). If you are
+ installing some time later, it is important to check the output from
+ `+ubinfo -a+` and make sure you are updating the "liminix" volume and
+ not some other one which had been introduced since I wrote this.
+ ====
+
+ [source,console]
+ ----
+ $ nix-build -I liminix-config=./my-configuration.nix --arg device "import ./devices/belkin-rt3200" -A outputs.default
+ $ cat result/rootfs | ssh root@192.168.1.1 "cat > /tmp/rootfs"
+ $ ssh root@192.168.1.1
+ root@OpenWrt:~# ubimkvol /dev/ubi0 --name=liminix --maxavsize
+ root@OpenWrt:~# ubinfo -a
+ [...]
+ Volume ID: 7 (on ubi0)
+ Type: dynamic
+ Alignment: 1
+ Size: 851 LEBs (108056576 bytes, 103.0 MiB)
+ State: OK
+ Name: liminix
+ Character device major/minor: 250:8
+ root@OpenWrt:~# ubiupdatevol /dev/ubi0_7 /tmp/rootfs
+ ----
+
+ To make the new system bootable we also need to change some U-Boot
+ variables. `+boot_production+` needs to mount the filesystem and boot
+ the FIT image found there, and `+bootcmd+` needs to be told not to boot
+ the rescue image if there are records in pstore, because that interferes
+ with `+config.log.persistent+`
+
+ [source,console]
+ ----
+ root@OpenWrt:~# fw_setenv orig_boot_production $(fw_printenv -n boot_production)
+ root@OpenWrt:~# fw_setenv orig_bootcmd $(fw_printenv -n bootcmd)
+ root@OpenWrt:~# fw_setenv boot_production 'led $bootled_pwr on ; ubifsmount ubi0:liminix && ubifsload ''${loadaddr} boot/fit && bootm ''${loadaddr}'
+ root@OpenWrt:~# fw_setenv bootcmd 'run boot_ubi'
+ ----
+
+ For subsequent Liminix reinstalls, just run the `+ubiupdatevol+` command
+ again. You don't need to repeat the "Preparation" step and in fact
+ should seek to avoid it if possible, as it will reset the erase counters
+ used for write levelling. Using UBI-aware tools is therefore preferred
+ over any kind of "factory" wipe which will reset them.
'';
diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix
@@ -11,42 +11,42 @@
description = ''
-== GL.iNet GL-AR750
+ == GL.iNet GL-AR750
-=== Hardware summary
+ === Hardware summary
-The GL-AR750 "Creta" travel router features:
+ The GL-AR750 "Creta" travel router features:
-* QCA9531 @650Mhz SoC
-* dual band wireless: IEEE 802.11a/b/g/n/ac
-* two 10/100Mbps LAN ports and one WAN
-* 128MB DDR2 RAM
-* 16MB NOR Flash
-* supported in OpenWrt by the "ath79" SoC family
+ * QCA9531 @650Mhz SoC
+ * dual band wireless: IEEE 802.11a/b/g/n/ac
+ * two 10/100Mbps LAN ports and one WAN
+ * 128MB DDR2 RAM
+ * 16MB NOR Flash
+ * supported in OpenWrt by the "ath79" SoC family
-The GL-AR750 has two distinct sets of wifi hardware. The 2.4GHz radio is
-part of the QCA9531 SoC, i.e. it's on the same silicon as the CPU, the
-Ethernet, the USB etc. The device is connected to the host via
-https://en.wikipedia.org/wiki/Advanced_Microcontroller_Bus_Architecture[AHB]
-and it is supported in Linux using the ath9k driver. 5GHz wifi is
-provided by a QCA9887 PCIe (PCI embedded) WLAN chip, supported by the
-ath10k driver.
+ The GL-AR750 has two distinct sets of wifi hardware. The 2.4GHz radio is
+ part of the QCA9531 SoC, i.e. it's on the same silicon as the CPU, the
+ Ethernet, the USB etc. The device is connected to the host via
+ https://en.wikipedia.org/wiki/Advanced_Microcontroller_Bus_Architecture[AHB]
+ and it is supported in Linux using the ath9k driver. 5GHz wifi is
+ provided by a QCA9887 PCIe (PCI embedded) WLAN chip, supported by the
+ ath10k driver.
-=== Installation
+ === Installation
-As with many GL.iNet devices, the stock vendor firmware is a fork of
-OpenWrt, meaning that the binary created by `+system-outputs-mtdimage+`
-can be flashed using the vendor web UI or the U-Boot emergency "unbrick"
-routine.
+ As with many GL.iNet devices, the stock vendor firmware is a fork of
+ OpenWrt, meaning that the binary created by `+system-outputs-mtdimage+`
+ can be flashed using the vendor web UI or the U-Boot emergency "unbrick"
+ routine.
-Flashing over an existing Liminix system is not possible while that
-system is running, otherwise you'll be overwriting flash partitions
-while they're in use - and that might not end well. Configure the system
-with `+levitate+` if you need to make it upgradable.
+ Flashing over an existing Liminix system is not possible while that
+ system is running, otherwise you'll be overwriting flash partitions
+ while they're in use - and that might not end well. Configure the system
+ with `+levitate+` if you need to make it upgradable.
-Vendor web page: https://www.gl-inet.com/products/gl-ar750/
+ Vendor web page: https://www.gl-inet.com/products/gl-ar750/
-OpenWrt web page: https://openwrt.org/toh/gl.inet/gl-ar750
+ OpenWrt web page: https://openwrt.org/toh/gl.inet/gl-ar750
'';
diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix
@@ -13,32 +13,32 @@
description = ''
-== GL.iNet GL-MT300A
+ == GL.iNet GL-MT300A
-The GL-MT300A is based on a MT7620 chipset.
+ The GL-MT300A is based on a MT7620 chipset.
-For flashing from U-Boot, the firmware partition is from 0xbc050000 to
-0xbcfd0000.
+ For flashing from U-Boot, the firmware partition is from 0xbc050000 to
+ 0xbcfd0000.
-WiFi on this device is provided by the rt2800soc module. It expects
-firmware to be present in the "factory" MTD partition, so - assuming we
-want to use the wireless - we need to build MTD support into the kernel
-even if we're using TFTP root.
+ WiFi on this device is provided by the rt2800soc module. It expects
+ firmware to be present in the "factory" MTD partition, so - assuming we
+ want to use the wireless - we need to build MTD support into the kernel
+ even if we're using TFTP root.
-=== Installation
+ === Installation
-The stock vendor firmware is a fork of OpenWrt, meaning that the binary
-created by `+system-outputs-mtdimage+` can be flashed using the vendor
-web UI or the U-Boot emergency "unbrick" routine.
+ The stock vendor firmware is a fork of OpenWrt, meaning that the binary
+ created by `+system-outputs-mtdimage+` can be flashed using the vendor
+ web UI or the U-Boot emergency "unbrick" routine.
-Flashing over an existing Liminix system is not possible while that
-system is running, otherwise you'll be overwriting flash partitions
-while they're in use - and that might not end well. Configure the system
-with `+levitate+` if you need to make it upgradable.
+ Flashing over an existing Liminix system is not possible while that
+ system is running, otherwise you'll be overwriting flash partitions
+ while they're in use - and that might not end well. Configure the system
+ with `+levitate+` if you need to make it upgradable.
-Vendor web page: https://www.gl-inet.com/products/gl-mt300a/
+ Vendor web page: https://www.gl-inet.com/products/gl-mt300a/
-OpenWrt web page: https://openwrt.org/toh/gl.inet/gl-mt300a
+ OpenWrt web page: https://openwrt.org/toh/gl.inet/gl-mt300a
'';
@@ -126,49 +126,48 @@ OpenWrt web page: https://openwrt.org/toh/gl.inet/gl-mt300a
${openwrt.applyPatches.ramips}
${openwrt.applyPatches.rt2x00}
'';
- config =
- {
-
- RALINK = "y";
- PCI = "y";
- SOC_MT7620 = "y";
-
- SERIAL_8250_CONSOLE = "y";
- SERIAL_8250 = "y";
- SERIAL_CORE_CONSOLE = "y";
- SERIAL_OF_PLATFORM = "y";
-
- CONSOLE_LOGLEVEL_DEFAULT = "8";
- CONSOLE_LOGLEVEL_QUIET = "4";
-
- NET = "y";
- ETHERNET = "y";
- NET_VENDOR_RALINK = "y";
- NET_RALINK_MDIO = "y";
- NET_RALINK_MDIO_MT7620 = "y";
- NET_RALINK_MT7620 = "y";
- SWPHY = "y";
-
- SPI = "y";
- MTD_SPI_NOR = "y";
- SPI_MT7621 = "y"; # } probably don't need both of these
- SPI_RT2880 = "y"; # }
- SPI_MASTER = "y";
- SPI_MEM = "y";
-
- MTD = "y";
- MTD_BLOCK = "y"; # fix undefined ref to register_mtd_blktrans_devs
-
- EARLY_PRINTK = "y";
-
- NEW_LEDS = "y";
- LEDS_CLASS = "y"; # required by rt2x00lib
-
- PRINTK_TIME = "y";
- }
- // lib.optionalAttrs (config.system.service ? vlan) {
- SWCONFIG = "y";
- };
+ config = {
+
+ RALINK = "y";
+ PCI = "y";
+ SOC_MT7620 = "y";
+
+ SERIAL_8250_CONSOLE = "y";
+ SERIAL_8250 = "y";
+ SERIAL_CORE_CONSOLE = "y";
+ SERIAL_OF_PLATFORM = "y";
+
+ CONSOLE_LOGLEVEL_DEFAULT = "8";
+ CONSOLE_LOGLEVEL_QUIET = "4";
+
+ NET = "y";
+ ETHERNET = "y";
+ NET_VENDOR_RALINK = "y";
+ NET_RALINK_MDIO = "y";
+ NET_RALINK_MDIO_MT7620 = "y";
+ NET_RALINK_MT7620 = "y";
+ SWPHY = "y";
+
+ SPI = "y";
+ MTD_SPI_NOR = "y";
+ SPI_MT7621 = "y"; # } probably don't need both of these
+ SPI_RT2880 = "y"; # }
+ SPI_MASTER = "y";
+ SPI_MEM = "y";
+
+ MTD = "y";
+ MTD_BLOCK = "y"; # fix undefined ref to register_mtd_blktrans_devs
+
+ EARLY_PRINTK = "y";
+
+ NEW_LEDS = "y";
+ LEDS_CLASS = "y"; # required by rt2x00lib
+
+ PRINTK_TIME = "y";
+ }
+ // lib.optionalAttrs (config.system.service ? vlan) {
+ SWCONFIG = "y";
+ };
conditionalConfig = {
WLAN = {
WLAN_VENDOR_RALINK = "y";
diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix
@@ -10,27 +10,27 @@
};
description = ''
-== GL.iNet GL-MT300N-v2
+ == GL.iNet GL-MT300N-v2
-The GL-MT300N-v2 "Mango" is is very similar to the `+gl-mt300a+`, but is
-based on the MT7628 chipset instead of MT7620. It's also marginally
-cheaper and comes in a yellow case not a blue one. Be sure your device
-is v2 not v1, which is a different animal and has only half as much RAM.
+ The GL-MT300N-v2 "Mango" is is very similar to the `+gl-mt300a+`, but is
+ based on the MT7628 chipset instead of MT7620. It's also marginally
+ cheaper and comes in a yellow case not a blue one. Be sure your device
+ is v2 not v1, which is a different animal and has only half as much RAM.
-=== Installation
+ === Installation
-The stock vendor firmware is a fork of OpenWrt, meaning that the binary
-created by `+system-outputs-mtdimage+` can be flashed using the vendor
-web UI or the U-Boot emergency "unbrick" routine.
+ The stock vendor firmware is a fork of OpenWrt, meaning that the binary
+ created by `+system-outputs-mtdimage+` can be flashed using the vendor
+ web UI or the U-Boot emergency "unbrick" routine.
-Flashing over an existing Liminix system is not possible while that
-system is running, otherwise you'll be overwriting flash partitions
-while they're in use - and that might not end well. Configure the system
-with `+levitate+` if you need to make it upgradable.
+ Flashing over an existing Liminix system is not possible while that
+ system is running, otherwise you'll be overwriting flash partitions
+ while they're in use - and that might not end well. Configure the system
+ with `+levitate+` if you need to make it upgradable.
-Vendor web page: https://www.gl-inet.com/products/gl-mt300n-v2/
+ Vendor web page: https://www.gl-inet.com/products/gl-mt300n-v2/
-OpenWrt web page: https://openwrt.org/toh/gl.inet/gl-mt300n_v2
+ OpenWrt web page: https://openwrt.org/toh/gl.inet/gl-mt300n_v2
'';
@@ -138,61 +138,60 @@ OpenWrt web page: https://openwrt.org/toh/gl.inet/gl-mt300n_v2
extraPatchPhase = ''
${openwrt.applyPatches.ramips}
'';
- config =
- {
-
- RALINK = "y";
- PCI = "y";
- SOC_MT7620 = "y";
-
- SERIAL_8250_CONSOLE = "y";
- SERIAL_8250 = "y";
- SERIAL_CORE_CONSOLE = "y";
- SERIAL_OF_PLATFORM = "y";
-
- CONSOLE_LOGLEVEL_DEFAULT = "8";
- CONSOLE_LOGLEVEL_QUIET = "4";
-
- MTD = "y";
- MTD_BLOCK = "y"; # fix undefined ref to register_mtd_blktrans_dev
-
- SPI = "y";
- MTD_SPI_NOR = "y";
- SPI_MT7621 = "y";
- SPI_MASTER = "y";
- SPI_MEM = "y";
-
- REGULATOR = "y";
- REGULATOR_FIXED_VOLTAGE = "y";
-
- NET = "y";
- ETHERNET = "y";
-
- PHYLIB = "y";
- AT803X_PHY = "y";
- FIXED_PHY = "y";
- GENERIC_PHY = "y";
- NET_VENDOR_RALINK = "y";
- NET_RALINK_RT3050 = "y";
- NET_RALINK_SOC = "y";
- SWPHY = "y";
-
- GPIOLIB = "y";
- GPIO_MT7621 = "y";
-
- PHY_RALINK_USB = "y";
-
- EARLY_PRINTK = "y";
-
- PRINTK_TIME = "y";
- }
- // lib.optionalAttrs (config.system.service ? vlan) {
- SWCONFIG = "y";
- }
- // lib.optionalAttrs (config.system.service ? watchdog) {
- RALINK_WDT = "y"; # watchdog
- MT7621_WDT = "y"; # or it might be this one
- };
+ config = {
+
+ RALINK = "y";
+ PCI = "y";
+ SOC_MT7620 = "y";
+
+ SERIAL_8250_CONSOLE = "y";
+ SERIAL_8250 = "y";
+ SERIAL_CORE_CONSOLE = "y";
+ SERIAL_OF_PLATFORM = "y";
+
+ CONSOLE_LOGLEVEL_DEFAULT = "8";
+ CONSOLE_LOGLEVEL_QUIET = "4";
+
+ MTD = "y";
+ MTD_BLOCK = "y"; # fix undefined ref to register_mtd_blktrans_dev
+
+ SPI = "y";
+ MTD_SPI_NOR = "y";
+ SPI_MT7621 = "y";
+ SPI_MASTER = "y";
+ SPI_MEM = "y";
+
+ REGULATOR = "y";
+ REGULATOR_FIXED_VOLTAGE = "y";
+
+ NET = "y";
+ ETHERNET = "y";
+
+ PHYLIB = "y";
+ AT803X_PHY = "y";
+ FIXED_PHY = "y";
+ GENERIC_PHY = "y";
+ NET_VENDOR_RALINK = "y";
+ NET_RALINK_RT3050 = "y";
+ NET_RALINK_SOC = "y";
+ SWPHY = "y";
+
+ GPIOLIB = "y";
+ GPIO_MT7621 = "y";
+
+ PHY_RALINK_USB = "y";
+
+ EARLY_PRINTK = "y";
+
+ PRINTK_TIME = "y";
+ }
+ // lib.optionalAttrs (config.system.service ? vlan) {
+ SWCONFIG = "y";
+ }
+ // lib.optionalAttrs (config.system.service ? watchdog) {
+ RALINK_WDT = "y"; # watchdog
+ MT7621_WDT = "y"; # or it might be this one
+ };
conditionalConfig = {
WLAN = {
WLAN_VENDOR_RALINK = "y";
diff --git a/devices/openwrt-one/default.nix b/devices/openwrt-one/default.nix
@@ -1,84 +1,84 @@
{
description = ''
-== OpenWrt One
+ == OpenWrt One
-=== Hardware summary
+ === Hardware summary
-* MediaTek MT7981B (1300MHz)
-* 256MB NAND Flash
-* 1024MB RAM
-* WLan hardware: Mediatek MT7976C
+ * MediaTek MT7981B (1300MHz)
+ * 256MB NAND Flash
+ * 1024MB RAM
+ * WLan hardware: Mediatek MT7976C
-=== Status
+ === Status
-* Only tested over TFTP so far.
-* WiFi (2.4G and 5G) works.
-* 2.5G ethernet port works.
+ * Only tested over TFTP so far.
+ * WiFi (2.4G and 5G) works.
+ * 2.5G ethernet port works.
-=== Limitations
+ === Limitations
-* adding `he_bss_color="128"` causes `Invalid argument` for hostap
-* nvme support untested
-* I don't think the front LEDs work yet
+ * adding `he_bss_color="128"` causes `Invalid argument` for hostap
+ * nvme support untested
+ * I don't think the front LEDs work yet
-=== Installation
+ === Installation
-TODO: add instructions on how to boot directly from TFTP to memory and
-how to install from TFTP to flash without going through OpenWrt.
+ TODO: add instructions on how to boot directly from TFTP to memory and
+ how to install from TFTP to flash without going through OpenWrt.
-The instructions below assume you can boot and SSH into OpenWrt, for
-example by attaching a USB serial console to the front port, selecting
-'boot from recovery' in the U-Boot menu, and connecting to
-root@192.168.1.1 via the 1G ethernet port.
+ The instructions below assume you can boot and SSH into OpenWrt, for
+ example by attaching a USB serial console to the front port, selecting
+ 'boot from recovery' in the U-Boot menu, and connecting to
+ root@192.168.1.1 via the 1G ethernet port.
-Boot into OpenWrt and create a 'liminix' UBI partition:
+ Boot into OpenWrt and create a 'liminix' UBI partition:
-[source,console]
-----
-root@OpenWrt:~# ubimkvol /dev/ubi0 --name=liminix --maxavsize
-----
+ [source,console]
+ ----
+ root@OpenWrt:~# ubimkvol /dev/ubi0 --name=liminix --maxavsize
+ ----
-Remember the 'Volume ID' that was created for this new partition, or
-find the one labeled 'liminix' using 'ubinfo -d 0 -n 5' etc.
+ Remember the 'Volume ID' that was created for this new partition, or
+ find the one labeled 'liminix' using 'ubinfo -d 0 -n 5' etc.
-Build the UBI image and write it to this new partition:
+ Build the UBI image and write it to this new partition:
-[source,console]
-----
-$ nix-build -I liminix-config=./my-configuration.nix --arg device
-"import ./devices/openwrt-one" -A outputs.default
-$ cat result/rootfs | ssh root@192.168.1.1 "cat > /tmp/rootfs"
-$ ssh root@192.168.1.1
-root@OpenWrt:~# ubiupdatevol /dev/ubi0_X /tmp/rootfs # replace X
-with the volume id, if needed check with `ubinfo`
-----
+ [source,console]
+ ----
+ $ nix-build -I liminix-config=./my-configuration.nix --arg device
+ "import ./devices/openwrt-one" -A outputs.default
+ $ cat result/rootfs | ssh root@192.168.1.1 "cat > /tmp/rootfs"
+ $ ssh root@192.168.1.1
+ root@OpenWrt:~# ubiupdatevol /dev/ubi0_X /tmp/rootfs # replace X
+ with the volume id, if needed check with `ubinfo`
+ ----
-Reboot into the U-Boot prompt and boot with:
+ Reboot into the U-Boot prompt and boot with:
-[source,console]
-----
-OpenWrt One> ubifsmount ubi0:liminix && ubifsload ''${loadaddr} boot/fit && bootm ''${loadaddr}
-----
+ [source,console]
+ ----
+ OpenWrt One> ubifsmount ubi0:liminix && ubifsload ''${loadaddr} boot/fit && bootm ''${loadaddr}
+ ----
-If this works, reboot into OpenWrt and configure U-Boot to boot ubifs by
-default:
+ If this works, reboot into OpenWrt and configure U-Boot to boot ubifs by
+ default:
-[source,console]
-----
-root@OpenWrt:~# fw_setenv orig_boot_production $(fw_printenv -n boot_production)
-root@OpenWrt:~# fw_setenv boot_production 'led white on ; ubifsmount ubi0:liminix && ubifsload ''${loadaddr} boot/fit && bootm ''${loadaddr}'
-----
+ [source,console]
+ ----
+ root@OpenWrt:~# fw_setenv orig_boot_production $(fw_printenv -n boot_production)
+ root@OpenWrt:~# fw_setenv boot_production 'led white on ; ubifsmount ubi0:liminix && ubifsload ''${loadaddr} boot/fit && bootm ''${loadaddr}'
+ ----
-=== Troubleshooting
+ === Troubleshooting
-The instructions above assume you can boot and SSH into the (recovery)
-OpenWrt installation. If you have broken your device to the point where
-that is no longer possible, you could re-install OpenWrt, but probably
-you could also install directly from U-Boot:
+ The instructions above assume you can boot and SSH into the (recovery)
+ OpenWrt installation. If you have broken your device to the point where
+ that is no longer possible, you could re-install OpenWrt, but probably
+ you could also install directly from U-Boot:
-https://github.com/u-boot/u-boot/blob/master/doc/README.ubi
+ https://github.com/u-boot/u-boot/blob/master/doc/README.ubi
'';
system = {
@@ -136,492 +136,491 @@ https://github.com/u-boot/u-boot/blob/master/doc/README.ubi
extraPatchPhase = ''
${openwrt.applyPatches.mediatek}
'';
- config =
- {
- NET = "y"; # unlock NET_XGRESS
- SERIAL_8250 = "y"; # unlock SERIAL_8250_FSL
- SERIAL_8250_CONSOLE = "y"; # to get the serial console
- WATCHDOG = "y"; # unlock WATCHDOG_CORE
- NEW_LEDS = "y"; # unlock LEDS_PWM
- LEDS_CLASS = "y"; # unlock LEDS_PWM
- LEDS_TRIGGERS = "y"; # unlock LEDS_TRIGGER_PATTERN
- DEFERRED_STRUCT_PAGE_INIT = "y"; # trigger PADATA
- # Taken from openwrt's ./target/linux/mediatek/filogic/config-6.6
- "64BIT" = "y";
- AIROHA_EN8801SC_PHY = "y";
- ARCH_BINFMT_ELF_EXTRA_PHDRS = "y";
- ARCH_CORRECT_STACKTRACE_ON_KRETPROBE = "y";
- ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG = "y";
- ARCH_DMA_ADDR_T_64BIT = "y";
- ARCH_FORCE_MAX_ORDER = "10";
- ARCH_KEEP_MEMBLOCK = "y";
- ARCH_MEDIATEK = "y";
- ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE = "y";
- ARCH_MMAP_RND_BITS = "18";
- ARCH_MMAP_RND_BITS_MAX = "24";
- ARCH_MMAP_RND_BITS_MIN = "18";
- ARCH_MMAP_RND_COMPAT_BITS_MIN = "11";
- ARCH_PROC_KCORE_TEXT = "y";
- ARCH_SPARSEMEM_ENABLE = "y";
- ARCH_STACKWALK = "y";
- ARCH_SUSPEND_POSSIBLE = "y";
- ARCH_WANTS_NO_INSTR = "y";
- ARCH_WANTS_THP_SWAP = "y";
- ARM64 = "y";
- ARM64_4K_PAGES = "y";
- ARM64_ERRATUM_843419 = "y";
- ARM64_LD_HAS_FIX_ERRATUM_843419 = "y";
- ARM64_PAGE_SHIFT = "12";
- ARM64_PA_BITS = "48";
- ARM64_PA_BITS_48 = "y";
- ARM64_TAGGED_ADDR_ABI = "y";
- ARM64_VA_BITS = "39";
- ARM64_VA_BITS_39 = "y";
- ARM_AMBA = "y";
- ARM_ARCH_TIMER = "y";
- ARM_ARCH_TIMER_EVTSTREAM = "y";
- ARM_GIC = "y";
- ARM_GIC_V2M = "y";
- ARM_GIC_V3 = "y";
- ARM_GIC_V3_ITS = "y";
- ARM_GIC_V3_ITS_PCI = "y";
- ARM_MEDIATEK_CPUFREQ = "y";
- ARM_PMU = "y";
- ARM_PMUV3 = "y";
- ARM_PSCI_FW = "y";
- ATA = "y";
- AUDIT_ARCH_COMPAT_GENERIC = "y";
- BLK_DEV_LOOP = "y";
- BLK_DEV_SD = "y";
- BLK_MQ_PCI = "y";
- BLK_PM = "y";
- BLOCK_NOTIFIERS = "y";
- BSD_PROCESS_ACCT = "y";
- BSD_PROCESS_ACCT_V3 = "y";
- BUFFER_HEAD = "y";
- BUILTIN_RETURN_ADDRESS_STRIPS_PAC = "y";
- CC_HAVE_SHADOW_CALL_STACK = "y";
- CC_HAVE_STACKPROTECTOR_SYSREG = "y";
- #CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5";
- CC_NO_ARRAY_BOUNDS = "y";
- CLKSRC_MMIO = "y";
- CLONE_BACKWARDS = "y";
- CMDLINE_OVERRIDE = "y";
- COMMON_CLK = "y";
- COMMON_CLK_MEDIATEK = "y";
- COMMON_CLK_MT7981 = "y";
- COMMON_CLK_MT7981_ETHSYS = "y";
- COMMON_CLK_MT7986 = "y";
- COMMON_CLK_MT7986_ETHSYS = "y";
- COMMON_CLK_MT7988 = "y";
- COMPACT_UNEVICTABLE_DEFAULT = "1";
- CONFIGFS_FS = "y";
- CONSOLE_LOGLEVEL_DEFAULT = "15";
- CONTEXT_TRACKING = "y";
- CONTEXT_TRACKING_IDLE = "y";
- CPU_FREQ = "y";
- CPU_FREQ_DEFAULT_GOV_USERSPACE = "y";
- CPU_FREQ_GOV_ATTR_SET = "y";
- CPU_FREQ_GOV_COMMON = "y";
- CPU_FREQ_GOV_CONSERVATIVE = "y";
- CPU_FREQ_GOV_ONDEMAND = "y";
- CPU_FREQ_GOV_PERFORMANCE = "y";
- CPU_FREQ_GOV_POWERSAVE = "y";
- CPU_FREQ_GOV_SCHEDUTIL = "y";
- CPU_FREQ_GOV_USERSPACE = "y";
- CPU_FREQ_STAT = "y";
- CPU_LITTLE_ENDIAN = "y";
- CPU_RMAP = "y";
- CPU_THERMAL = "y";
- CRC16 = "y";
- CRC_CCITT = "y";
- CRYPTO_AES_ARM64 = "y";
- CRYPTO_AES_ARM64_CE = "y";
- CRYPTO_AES_ARM64_CE_BLK = "y";
- CRYPTO_AES_ARM64_CE_CCM = "y";
- CRYPTO_CMAC = "y";
- CRYPTO_CRC32 = "y";
- CRYPTO_CRC32C = "y";
- CRYPTO_CRYPTD = "y";
- CRYPTO_DEFLATE = "y";
- CRYPTO_DRBG = "y";
- CRYPTO_DRBG_HMAC = "y";
- CRYPTO_DRBG_MENU = "y";
- CRYPTO_ECB = "y";
- CRYPTO_ECC = "y";
- CRYPTO_ECDH = "y";
- CRYPTO_GHASH_ARM64_CE = "y";
- CRYPTO_HASH_INFO = "y";
- CRYPTO_HMAC = "y";
- CRYPTO_JITTERENTROPY = "y";
- CRYPTO_LIB_BLAKE2S_GENERIC = "y";
- CRYPTO_LIB_GF128MUL = "y";
- CRYPTO_LIB_SHA1 = "y";
- CRYPTO_LIB_SHA256 = "y";
- CRYPTO_LIB_UTILS = "y";
- CRYPTO_LZO = "y";
- CRYPTO_RNG = "y";
- CRYPTO_RNG2 = "y";
- CRYPTO_RNG_DEFAULT = "y";
- CRYPTO_SHA256 = "y";
- CRYPTO_SHA256_ARM64 = "y";
- CRYPTO_SHA2_ARM64_CE = "y";
- CRYPTO_SHA3 = "y";
- CRYPTO_SHA512 = "y";
- CRYPTO_SM4 = "y";
- CRYPTO_SM4_ARM64_CE_BLK = "y";
- CRYPTO_SM4_ARM64_CE_CCM = "y";
- CRYPTO_SM4_ARM64_CE_GCM = "y";
- CRYPTO_ZSTD = "y";
- DCACHE_WORD_ACCESS = "y";
- #DEBUG_INFO="y";
- DEBUG_MISC = "y";
- DIMLIB = "y";
- DMADEVICES = "y";
- DMATEST = "y";
- DMA_BOUNCE_UNALIGNED_KMALLOC = "y";
- DMA_DIRECT_REMAP = "y";
- DMA_ENGINE = "y";
- DMA_ENGINE_RAID = "y";
- DMA_OF = "y";
- DMA_VIRTUAL_CHANNELS = "y";
- DTC = "y";
- EDAC_SUPPORT = "y";
- EINT_MTK = "y";
- EXCLUSIVE_SYSTEM_RAM = "y";
- EXT4_FS = "y";
- F2FS_FS = "y";
- FIXED_PHY = "y";
- FIX_EARLYCON_MEM = "y";
- FRAME_POINTER = "y";
- FS_IOMAP = "y";
- FS_MBCACHE = "y";
- FUNCTION_ALIGNMENT = "4";
- FUNCTION_ALIGNMENT_4B = "y";
- FWNODE_MDIO = "y";
- FW_LOADER_PAGED_BUF = "y";
- #FW_LOADER_SYSFS="y";
- #GCC11_NO_ARRAY_BOUNDS="y";
- #GCC_ASM_GOTO_OUTPUT_WORKAROUND="y";
- GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS = "y";
- GENERIC_ALLOCATOR = "y";
- GENERIC_ARCH_TOPOLOGY = "y";
- GENERIC_BUG = "y";
- GENERIC_BUG_RELATIVE_POINTERS = "y";
- GENERIC_CLOCKEVENTS = "y";
- GENERIC_CLOCKEVENTS_BROADCAST = "y";
- GENERIC_CPU_AUTOPROBE = "y";
- GENERIC_CPU_VULNERABILITIES = "y";
- GENERIC_CSUM = "y";
- GENERIC_EARLY_IOREMAP = "y";
- GENERIC_GETTIMEOFDAY = "y";
- GENERIC_IDLE_POLL_SETUP = "y";
- GENERIC_IOREMAP = "y";
- GENERIC_IRQ_EFFECTIVE_AFF_MASK = "y";
- GENERIC_IRQ_SHOW = "y";
- GENERIC_IRQ_SHOW_LEVEL = "y";
- GENERIC_LIB_DEVMEM_IS_ALLOWED = "y";
- GENERIC_MSI_IRQ = "y";
- GENERIC_PCI_IOMAP = "y";
- GENERIC_PHY = "y";
- GENERIC_PINCONF = "y";
- GENERIC_PINCTRL_GROUPS = "y";
- GENERIC_PINMUX_FUNCTIONS = "y";
- GENERIC_SCHED_CLOCK = "y";
- GENERIC_SMP_IDLE_THREAD = "y";
- GENERIC_STRNCPY_FROM_USER = "y";
- GENERIC_STRNLEN_USER = "y";
- GENERIC_TIME_VSYSCALL = "y";
- GLOB = "y";
- GPIO_CDEV = "y";
- GPIO_WATCHDOG = "y";
- GPIO_WATCHDOG_ARCH_INITCALL = "y";
- GRO_CELLS = "y";
- HARDIRQS_SW_RESEND = "y";
- HAS_DMA = "y";
- HAS_IOMEM = "y";
- HAS_IOPORT = "y";
- HAS_IOPORT_MAP = "y";
- HWMON = "y";
- HW_RANDOM = "y";
- HW_RANDOM_MTK = "y";
- I2C = "y";
- I2C_BOARDINFO = "y";
- I2C_CHARDEV = "y";
- I2C_MT65XX = "y";
- ICPLUS_PHY = "y";
- ILLEGAL_POINTER_VALUE = "0xdead000000000000";
- #INITRAMFS_SOURCE="""";
- IRQCHIP = "y";
- IRQ_DOMAIN = "y";
- IRQ_DOMAIN_HIERARCHY = "y";
- IRQ_FORCED_THREADING = "y";
- IRQ_TIME_ACCOUNTING = "y";
- IRQ_WORK = "y";
- JBD2 = "y";
- JUMP_LABEL = "y";
- LEDS_PWM = "y";
- LEDS_SMARTRG_LED = "y";
- LIBFDT = "y";
- LOCK_DEBUGGING_SUPPORT = "y";
- LOCK_SPIN_ON_OWNER = "y";
- LZO_COMPRESS = "y";
- LZO_DECOMPRESS = "y";
- MAGIC_SYSRQ = "y";
- MAXLINEAR_GPHY = "y";
- MDIO_BUS = "y";
- MDIO_DEVICE = "y";
- MDIO_DEVRES = "y";
- MEDIATEK_2P5GE_PHY = "y";
- MEDIATEK_GE_PHY = "y";
- MEDIATEK_GE_SOC_PHY = "y";
- MEDIATEK_WATCHDOG = "y";
- MESSAGE_LOGLEVEL_DEFAULT = "7";
- MFD_SYSCON = "y";
- MIGRATION = "y";
- MMC = "y";
- MMC_BLOCK = "y";
- MMC_CQHCI = "y";
- MMC_MTK = "y";
- MMU_LAZY_TLB_REFCOUNT = "y";
- MODULES_TREE_LOOKUP = "y";
- MODULES_USE_ELF_RELA = "y";
- MTD_NAND_CORE = "y";
- MTD_NAND_ECC = "y";
- MTD_NAND_ECC_MEDIATEK = "y";
- MTD_NAND_ECC_SW_HAMMING = "y";
- MTD_NAND_MTK = "y";
- MTD_NAND_MTK_BMT = "y";
- MTD_PARSER_TRX = "y";
- MTD_RAW_NAND = "y";
- MTD_SPI_NAND = "y";
- MTD_SPI_NOR = "y";
- MTD_SPLIT_FIRMWARE = "y";
- MTD_SPLIT_FIT_FW = "y";
- MTD_UBI = "y";
- MTD_UBI_BEB_LIMIT = "20";
- MTD_UBI_BLOCK = "y";
- MTD_UBI_FASTMAP = "y";
- MTD_UBI_NVMEM = "y";
- MTD_UBI_WL_THRESHOLD = "4096";
- MTK_CPUX_TIMER = "y";
- MTK_HSDMA = "y";
- MTK_INFRACFG = "y";
- MTK_LVTS_THERMAL = "y";
- MTK_LVTS_THERMAL_DEBUGFS = "y";
- MTK_PMIC_WRAP = "y";
- MTK_REGULATOR_COUPLER = "y";
- MTK_SCPSYS = "y";
- MTK_SCPSYS_PM_DOMAINS = "y";
- MTK_SOC_THERMAL = "y";
- MTK_THERMAL = "y";
- MTK_TIMER = "y";
- MUTEX_SPIN_ON_OWNER = "y";
- NEED_DMA_MAP_STATE = "y";
- NEED_SG_DMA_LENGTH = "y";
- NET_DEVLINK = "y";
- NET_DSA = "y";
- NET_DSA_MT7530 = "y";
- NET_DSA_MT7530_MDIO = "y";
- NET_DSA_MT7530_MMIO = "y";
- NET_DSA_TAG_MTK = "y";
- #NET_EGRESS="y";
- NET_FLOW_LIMIT = "y";
- #NET_INGRESS="y";
- NET_MEDIATEK_SOC = "y";
- NET_MEDIATEK_SOC_WED = "y";
- NET_SELFTESTS = "y";
- NET_SWITCHDEV = "y";
- NET_VENDOR_MEDIATEK = "y";
- #NET_XGRESS="y";
- NLS = "y";
- NO_HZ_COMMON = "y";
- NO_HZ_IDLE = "y";
- NR_CPUS = "4";
- NVMEM = "y";
- NVMEM_BLOCK = "y";
- NVMEM_LAYOUTS = "y";
- NVMEM_LAYOUT_ADTRAN = "y";
- NVMEM_MTK_EFUSE = "y";
- NVMEM_SYSFS = "y";
- OF = "y";
- OF_ADDRESS = "y";
- OF_DYNAMIC = "y";
- OF_EARLY_FLATTREE = "y";
- OF_FLATTREE = "y";
- OF_GPIO = "y";
- OF_IRQ = "y";
- OF_KOBJ = "y";
- OF_MDIO = "y";
- OF_OVERLAY = "y";
- OF_RESOLVE = "y";
- PADATA = "y";
- PAGE_POOL = "y";
- PAGE_POOL_STATS = "y";
- PAGE_SIZE_LESS_THAN_256KB = "y";
- PAGE_SIZE_LESS_THAN_64KB = "y";
- #PAHOLE_HAS_LANG_EXCLUDE="y";
- PARTITION_PERCPU = "y";
- PCI = "y";
- PCIEAER = "y";
- PCIEASPM = "y";
- PCIEASPM_PERFORMANCE = "y";
- PCIEPORTBUS = "y";
- PCIE_MEDIATEK_GEN3 = "y";
- PCIE_PME = "y";
- PCI_DEBUG = "y";
- PCI_DOMAINS = "y";
- PCI_DOMAINS_GENERIC = "y";
- PCI_MSI = "y";
- PCS_MTK_LYNXI = "y";
- PCS_MTK_USXGMII = "y";
- PERF_EVENTS = "y";
- PER_VMA_LOCK = "y";
- PGTABLE_LEVELS = "3";
- PHYLIB = "y";
- PHYLIB_LEDS = "y";
- PHYLINK = "y";
- PHYS_ADDR_T_64BIT = "y";
- PHY_MTK_TPHY = "y";
- PHY_MTK_XFI_TPHY = "y";
- PHY_MTK_XSPHY = "y";
- PINCTRL = "y";
- PINCTRL_MT7981 = "y";
- PINCTRL_MT7986 = "y";
- PINCTRL_MT7988 = "y";
- PINCTRL_MTK_MOORE = "y";
- PINCTRL_MTK_V2 = "y";
- PM = "y";
- PM_CLK = "y";
- PM_GENERIC_DOMAINS = "y";
- PM_GENERIC_DOMAINS_OF = "y";
- PM_OPP = "y";
- POLYNOMIAL = "y";
- POSIX_CPU_TIMERS_TASK_WORK = "y";
- POWER_RESET = "y";
- POWER_RESET_SYSCON = "y";
- POWER_SUPPLY = "y";
- PREEMPT_NONE_BUILD = "y";
- PRINTK_TIME = "y";
- PSTORE = "y";
- PSTORE_COMPRESS = "y";
- PSTORE_CONSOLE = "y";
- PSTORE_PMSG = "y";
- PSTORE_RAM = "y";
- PTP_1588_CLOCK_OPTIONAL = "y";
- PWM = "y";
- PWM_MEDIATEK = "y";
- PWM_SYSFS = "y";
- QUEUED_RWLOCKS = "y";
- QUEUED_SPINLOCKS = "y";
- RANDSTRUCT_NONE = "y";
- RAS = "y";
- RATIONAL = "y";
- REALTEK_PHY = "y";
- REED_SOLOMON = "y";
- REED_SOLOMON_DEC8 = "y";
- REED_SOLOMON_ENC8 = "y";
- REGMAP = "y";
- REGMAP_I2C = "y";
- REGMAP_MMIO = "y";
- REGULATOR = "y";
- REGULATOR_FIXED_VOLTAGE = "y";
- REGULATOR_MT6380 = "y";
- REGULATOR_RT5190A = "y";
- RESET_CONTROLLER = "y";
- RESET_TI_SYSCON = "y";
- RFS_ACCEL = "y";
- RODATA_FULL_DEFAULT_ENABLED = "y";
- RPS = "y";
- RTC_CLASS = "y";
- RTC_DRV_MT7622 = "y";
- RTC_I2C_AND_SPI = "y";
- RWSEM_SPIN_ON_OWNER = "y";
- SCHED_MC = "y";
- SCSI = "y";
- SCSI_COMMON = "y";
- SERIAL_8250_FSL = "y";
- SERIAL_8250_MT6577 = "y";
- SERIAL_8250_NR_UARTS = "3";
- SERIAL_8250_RUNTIME_UARTS = "3";
- SERIAL_DEV_BUS = "y";
- SERIAL_DEV_CTRL_TTYPORT = "y";
- SERIAL_MCTRL_GPIO = "y";
- SERIAL_OF_PLATFORM = "y";
- SGL_ALLOC = "y";
- SG_POOL = "y";
- SMP = "y";
- SOCK_RX_QUEUE_MAPPING = "y";
- SOFTIRQ_ON_OWN_STACK = "y";
- SPARSEMEM = "y";
- SPARSEMEM_EXTREME = "y";
- SPARSEMEM_VMEMMAP = "y";
- SPARSEMEM_VMEMMAP_ENABLE = "y";
- SPARSE_IRQ = "y";
- SPI = "y";
- SPI_DYNAMIC = "y";
- SPI_MASTER = "y";
- SPI_MEM = "y";
- SPI_MT65XX = "y";
- SPI_MTK_SNFI = "y";
- #SQUASHFS_DECOMP_MULTI_PERCPU="y";
- SWIOTLB = "y";
- SWPHY = "y";
- SYSCTL_EXCEPTION_TRACE = "y";
- THERMAL = "y";
- THERMAL_DEFAULT_GOV_STEP_WISE = "y";
- THERMAL_EMERGENCY_POWEROFF_DELAY_MS = "0";
- THERMAL_GOV_BANG_BANG = "y";
- THERMAL_GOV_FAIR_SHARE = "y";
- THERMAL_GOV_STEP_WISE = "y";
- THERMAL_GOV_USER_SPACE = "y";
- THERMAL_HWMON = "y";
- THERMAL_OF = "y";
- THERMAL_WRITABLE_TRIPS = "y";
- THREAD_INFO_IN_TASK = "y";
- TICK_CPU_ACCOUNTING = "y";
- TIMER_OF = "y";
- TIMER_PROBE = "y";
- TRACE_IRQFLAGS_NMI_SUPPORT = "y";
- TREE_RCU = "y";
- TREE_SRCU = "y";
- UBIFS_FS = "y";
- UIMAGE_FIT_BLK = "y";
- USB_SUPPORT = "y";
- VMAP_STACK = "y";
- WATCHDOG_CORE = "y";
- WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC = "y";
- WATCHDOG_PRETIMEOUT_GOV = "y";
- WATCHDOG_PRETIMEOUT_GOV_PANIC = "y";
- WATCHDOG_PRETIMEOUT_GOV_SEL = "m";
- WATCHDOG_SYSFS = "y";
- XPS = "y";
- XXHASH = "y";
- ZLIB_DEFLATE = "y";
- ZLIB_INFLATE = "y";
- ZONE_DMA32 = "y";
- ZSTD_COMMON = "y";
- ZSTD_COMPRESS = "y";
- ZSTD_DECOMPRESS = "y";
- # from DEVICE_PACKAGES in the openwrt_one section of
- # openwrt's ./target/linux/mediatek/image/filogic.mk:
- # chop off the 'kmod-' prefix and search for 'KernelPackage/...'
- # in ./package/kernel/linux/modules/*.mk, and remember to add
- # modules to kmodloader targets below
- AIR_EN8811H_PHY = "m";
- RTC_DRV_PCF8563 = "m";
- NVME_CORE = "m";
- BLK_DEV_NVME = "m";
- NVME_MULTIPATH = "n";
- NVME_HWMON = "y";
- # ???
- AQUANTIA_PHY = "m";
- MT798X_WMAC = "y";
- }
- // lib.optionalAttrs (config.system.service ? watchdog) {
- RALINK_WDT = "y"; # watchdog
- MT7621_WDT = "y"; # or it might be this one
- };
+ config = {
+ NET = "y"; # unlock NET_XGRESS
+ SERIAL_8250 = "y"; # unlock SERIAL_8250_FSL
+ SERIAL_8250_CONSOLE = "y"; # to get the serial console
+ WATCHDOG = "y"; # unlock WATCHDOG_CORE
+ NEW_LEDS = "y"; # unlock LEDS_PWM
+ LEDS_CLASS = "y"; # unlock LEDS_PWM
+ LEDS_TRIGGERS = "y"; # unlock LEDS_TRIGGER_PATTERN
+ DEFERRED_STRUCT_PAGE_INIT = "y"; # trigger PADATA
+ # Taken from openwrt's ./target/linux/mediatek/filogic/config-6.6
+ "64BIT" = "y";
+ AIROHA_EN8801SC_PHY = "y";
+ ARCH_BINFMT_ELF_EXTRA_PHDRS = "y";
+ ARCH_CORRECT_STACKTRACE_ON_KRETPROBE = "y";
+ ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG = "y";
+ ARCH_DMA_ADDR_T_64BIT = "y";
+ ARCH_FORCE_MAX_ORDER = "10";
+ ARCH_KEEP_MEMBLOCK = "y";
+ ARCH_MEDIATEK = "y";
+ ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE = "y";
+ ARCH_MMAP_RND_BITS = "18";
+ ARCH_MMAP_RND_BITS_MAX = "24";
+ ARCH_MMAP_RND_BITS_MIN = "18";
+ ARCH_MMAP_RND_COMPAT_BITS_MIN = "11";
+ ARCH_PROC_KCORE_TEXT = "y";
+ ARCH_SPARSEMEM_ENABLE = "y";
+ ARCH_STACKWALK = "y";
+ ARCH_SUSPEND_POSSIBLE = "y";
+ ARCH_WANTS_NO_INSTR = "y";
+ ARCH_WANTS_THP_SWAP = "y";
+ ARM64 = "y";
+ ARM64_4K_PAGES = "y";
+ ARM64_ERRATUM_843419 = "y";
+ ARM64_LD_HAS_FIX_ERRATUM_843419 = "y";
+ ARM64_PAGE_SHIFT = "12";
+ ARM64_PA_BITS = "48";
+ ARM64_PA_BITS_48 = "y";
+ ARM64_TAGGED_ADDR_ABI = "y";
+ ARM64_VA_BITS = "39";
+ ARM64_VA_BITS_39 = "y";
+ ARM_AMBA = "y";
+ ARM_ARCH_TIMER = "y";
+ ARM_ARCH_TIMER_EVTSTREAM = "y";
+ ARM_GIC = "y";
+ ARM_GIC_V2M = "y";
+ ARM_GIC_V3 = "y";
+ ARM_GIC_V3_ITS = "y";
+ ARM_GIC_V3_ITS_PCI = "y";
+ ARM_MEDIATEK_CPUFREQ = "y";
+ ARM_PMU = "y";
+ ARM_PMUV3 = "y";
+ ARM_PSCI_FW = "y";
+ ATA = "y";
+ AUDIT_ARCH_COMPAT_GENERIC = "y";
+ BLK_DEV_LOOP = "y";
+ BLK_DEV_SD = "y";
+ BLK_MQ_PCI = "y";
+ BLK_PM = "y";
+ BLOCK_NOTIFIERS = "y";
+ BSD_PROCESS_ACCT = "y";
+ BSD_PROCESS_ACCT_V3 = "y";
+ BUFFER_HEAD = "y";
+ BUILTIN_RETURN_ADDRESS_STRIPS_PAC = "y";
+ CC_HAVE_SHADOW_CALL_STACK = "y";
+ CC_HAVE_STACKPROTECTOR_SYSREG = "y";
+ #CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5";
+ CC_NO_ARRAY_BOUNDS = "y";
+ CLKSRC_MMIO = "y";
+ CLONE_BACKWARDS = "y";
+ CMDLINE_OVERRIDE = "y";
+ COMMON_CLK = "y";
+ COMMON_CLK_MEDIATEK = "y";
+ COMMON_CLK_MT7981 = "y";
+ COMMON_CLK_MT7981_ETHSYS = "y";
+ COMMON_CLK_MT7986 = "y";
+ COMMON_CLK_MT7986_ETHSYS = "y";
+ COMMON_CLK_MT7988 = "y";
+ COMPACT_UNEVICTABLE_DEFAULT = "1";
+ CONFIGFS_FS = "y";
+ CONSOLE_LOGLEVEL_DEFAULT = "15";
+ CONTEXT_TRACKING = "y";
+ CONTEXT_TRACKING_IDLE = "y";
+ CPU_FREQ = "y";
+ CPU_FREQ_DEFAULT_GOV_USERSPACE = "y";
+ CPU_FREQ_GOV_ATTR_SET = "y";
+ CPU_FREQ_GOV_COMMON = "y";
+ CPU_FREQ_GOV_CONSERVATIVE = "y";
+ CPU_FREQ_GOV_ONDEMAND = "y";
+ CPU_FREQ_GOV_PERFORMANCE = "y";
+ CPU_FREQ_GOV_POWERSAVE = "y";
+ CPU_FREQ_GOV_SCHEDUTIL = "y";
+ CPU_FREQ_GOV_USERSPACE = "y";
+ CPU_FREQ_STAT = "y";
+ CPU_LITTLE_ENDIAN = "y";
+ CPU_RMAP = "y";
+ CPU_THERMAL = "y";
+ CRC16 = "y";
+ CRC_CCITT = "y";
+ CRYPTO_AES_ARM64 = "y";
+ CRYPTO_AES_ARM64_CE = "y";
+ CRYPTO_AES_ARM64_CE_BLK = "y";
+ CRYPTO_AES_ARM64_CE_CCM = "y";
+ CRYPTO_CMAC = "y";
+ CRYPTO_CRC32 = "y";
+ CRYPTO_CRC32C = "y";
+ CRYPTO_CRYPTD = "y";
+ CRYPTO_DEFLATE = "y";
+ CRYPTO_DRBG = "y";
+ CRYPTO_DRBG_HMAC = "y";
+ CRYPTO_DRBG_MENU = "y";
+ CRYPTO_ECB = "y";
+ CRYPTO_ECC = "y";
+ CRYPTO_ECDH = "y";
+ CRYPTO_GHASH_ARM64_CE = "y";
+ CRYPTO_HASH_INFO = "y";
+ CRYPTO_HMAC = "y";
+ CRYPTO_JITTERENTROPY = "y";
+ CRYPTO_LIB_BLAKE2S_GENERIC = "y";
+ CRYPTO_LIB_GF128MUL = "y";
+ CRYPTO_LIB_SHA1 = "y";
+ CRYPTO_LIB_SHA256 = "y";
+ CRYPTO_LIB_UTILS = "y";
+ CRYPTO_LZO = "y";
+ CRYPTO_RNG = "y";
+ CRYPTO_RNG2 = "y";
+ CRYPTO_RNG_DEFAULT = "y";
+ CRYPTO_SHA256 = "y";
+ CRYPTO_SHA256_ARM64 = "y";
+ CRYPTO_SHA2_ARM64_CE = "y";
+ CRYPTO_SHA3 = "y";
+ CRYPTO_SHA512 = "y";
+ CRYPTO_SM4 = "y";
+ CRYPTO_SM4_ARM64_CE_BLK = "y";
+ CRYPTO_SM4_ARM64_CE_CCM = "y";
+ CRYPTO_SM4_ARM64_CE_GCM = "y";
+ CRYPTO_ZSTD = "y";
+ DCACHE_WORD_ACCESS = "y";
+ #DEBUG_INFO="y";
+ DEBUG_MISC = "y";
+ DIMLIB = "y";
+ DMADEVICES = "y";
+ DMATEST = "y";
+ DMA_BOUNCE_UNALIGNED_KMALLOC = "y";
+ DMA_DIRECT_REMAP = "y";
+ DMA_ENGINE = "y";
+ DMA_ENGINE_RAID = "y";
+ DMA_OF = "y";
+ DMA_VIRTUAL_CHANNELS = "y";
+ DTC = "y";
+ EDAC_SUPPORT = "y";
+ EINT_MTK = "y";
+ EXCLUSIVE_SYSTEM_RAM = "y";
+ EXT4_FS = "y";
+ F2FS_FS = "y";
+ FIXED_PHY = "y";
+ FIX_EARLYCON_MEM = "y";
+ FRAME_POINTER = "y";
+ FS_IOMAP = "y";
+ FS_MBCACHE = "y";
+ FUNCTION_ALIGNMENT = "4";
+ FUNCTION_ALIGNMENT_4B = "y";
+ FWNODE_MDIO = "y";
+ FW_LOADER_PAGED_BUF = "y";
+ #FW_LOADER_SYSFS="y";
+ #GCC11_NO_ARRAY_BOUNDS="y";
+ #GCC_ASM_GOTO_OUTPUT_WORKAROUND="y";
+ GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS = "y";
+ GENERIC_ALLOCATOR = "y";
+ GENERIC_ARCH_TOPOLOGY = "y";
+ GENERIC_BUG = "y";
+ GENERIC_BUG_RELATIVE_POINTERS = "y";
+ GENERIC_CLOCKEVENTS = "y";
+ GENERIC_CLOCKEVENTS_BROADCAST = "y";
+ GENERIC_CPU_AUTOPROBE = "y";
+ GENERIC_CPU_VULNERABILITIES = "y";
+ GENERIC_CSUM = "y";
+ GENERIC_EARLY_IOREMAP = "y";
+ GENERIC_GETTIMEOFDAY = "y";
+ GENERIC_IDLE_POLL_SETUP = "y";
+ GENERIC_IOREMAP = "y";
+ GENERIC_IRQ_EFFECTIVE_AFF_MASK = "y";
+ GENERIC_IRQ_SHOW = "y";
+ GENERIC_IRQ_SHOW_LEVEL = "y";
+ GENERIC_LIB_DEVMEM_IS_ALLOWED = "y";
+ GENERIC_MSI_IRQ = "y";
+ GENERIC_PCI_IOMAP = "y";
+ GENERIC_PHY = "y";
+ GENERIC_PINCONF = "y";
+ GENERIC_PINCTRL_GROUPS = "y";
+ GENERIC_PINMUX_FUNCTIONS = "y";
+ GENERIC_SCHED_CLOCK = "y";
+ GENERIC_SMP_IDLE_THREAD = "y";
+ GENERIC_STRNCPY_FROM_USER = "y";
+ GENERIC_STRNLEN_USER = "y";
+ GENERIC_TIME_VSYSCALL = "y";
+ GLOB = "y";
+ GPIO_CDEV = "y";
+ GPIO_WATCHDOG = "y";
+ GPIO_WATCHDOG_ARCH_INITCALL = "y";
+ GRO_CELLS = "y";
+ HARDIRQS_SW_RESEND = "y";
+ HAS_DMA = "y";
+ HAS_IOMEM = "y";
+ HAS_IOPORT = "y";
+ HAS_IOPORT_MAP = "y";
+ HWMON = "y";
+ HW_RANDOM = "y";
+ HW_RANDOM_MTK = "y";
+ I2C = "y";
+ I2C_BOARDINFO = "y";
+ I2C_CHARDEV = "y";
+ I2C_MT65XX = "y";
+ ICPLUS_PHY = "y";
+ ILLEGAL_POINTER_VALUE = "0xdead000000000000";
+ #INITRAMFS_SOURCE="""";
+ IRQCHIP = "y";
+ IRQ_DOMAIN = "y";
+ IRQ_DOMAIN_HIERARCHY = "y";
+ IRQ_FORCED_THREADING = "y";
+ IRQ_TIME_ACCOUNTING = "y";
+ IRQ_WORK = "y";
+ JBD2 = "y";
+ JUMP_LABEL = "y";
+ LEDS_PWM = "y";
+ LEDS_SMARTRG_LED = "y";
+ LIBFDT = "y";
+ LOCK_DEBUGGING_SUPPORT = "y";
+ LOCK_SPIN_ON_OWNER = "y";
+ LZO_COMPRESS = "y";
+ LZO_DECOMPRESS = "y";
+ MAGIC_SYSRQ = "y";
+ MAXLINEAR_GPHY = "y";
+ MDIO_BUS = "y";
+ MDIO_DEVICE = "y";
+ MDIO_DEVRES = "y";
+ MEDIATEK_2P5GE_PHY = "y";
+ MEDIATEK_GE_PHY = "y";
+ MEDIATEK_GE_SOC_PHY = "y";
+ MEDIATEK_WATCHDOG = "y";
+ MESSAGE_LOGLEVEL_DEFAULT = "7";
+ MFD_SYSCON = "y";
+ MIGRATION = "y";
+ MMC = "y";
+ MMC_BLOCK = "y";
+ MMC_CQHCI = "y";
+ MMC_MTK = "y";
+ MMU_LAZY_TLB_REFCOUNT = "y";
+ MODULES_TREE_LOOKUP = "y";
+ MODULES_USE_ELF_RELA = "y";
+ MTD_NAND_CORE = "y";
+ MTD_NAND_ECC = "y";
+ MTD_NAND_ECC_MEDIATEK = "y";
+ MTD_NAND_ECC_SW_HAMMING = "y";
+ MTD_NAND_MTK = "y";
+ MTD_NAND_MTK_BMT = "y";
+ MTD_PARSER_TRX = "y";
+ MTD_RAW_NAND = "y";
+ MTD_SPI_NAND = "y";
+ MTD_SPI_NOR = "y";
+ MTD_SPLIT_FIRMWARE = "y";
+ MTD_SPLIT_FIT_FW = "y";
+ MTD_UBI = "y";
+ MTD_UBI_BEB_LIMIT = "20";
+ MTD_UBI_BLOCK = "y";
+ MTD_UBI_FASTMAP = "y";
+ MTD_UBI_NVMEM = "y";
+ MTD_UBI_WL_THRESHOLD = "4096";
+ MTK_CPUX_TIMER = "y";
+ MTK_HSDMA = "y";
+ MTK_INFRACFG = "y";
+ MTK_LVTS_THERMAL = "y";
+ MTK_LVTS_THERMAL_DEBUGFS = "y";
+ MTK_PMIC_WRAP = "y";
+ MTK_REGULATOR_COUPLER = "y";
+ MTK_SCPSYS = "y";
+ MTK_SCPSYS_PM_DOMAINS = "y";
+ MTK_SOC_THERMAL = "y";
+ MTK_THERMAL = "y";
+ MTK_TIMER = "y";
+ MUTEX_SPIN_ON_OWNER = "y";
+ NEED_DMA_MAP_STATE = "y";
+ NEED_SG_DMA_LENGTH = "y";
+ NET_DEVLINK = "y";
+ NET_DSA = "y";
+ NET_DSA_MT7530 = "y";
+ NET_DSA_MT7530_MDIO = "y";
+ NET_DSA_MT7530_MMIO = "y";
+ NET_DSA_TAG_MTK = "y";
+ #NET_EGRESS="y";
+ NET_FLOW_LIMIT = "y";
+ #NET_INGRESS="y";
+ NET_MEDIATEK_SOC = "y";
+ NET_MEDIATEK_SOC_WED = "y";
+ NET_SELFTESTS = "y";
+ NET_SWITCHDEV = "y";
+ NET_VENDOR_MEDIATEK = "y";
+ #NET_XGRESS="y";
+ NLS = "y";
+ NO_HZ_COMMON = "y";
+ NO_HZ_IDLE = "y";
+ NR_CPUS = "4";
+ NVMEM = "y";
+ NVMEM_BLOCK = "y";
+ NVMEM_LAYOUTS = "y";
+ NVMEM_LAYOUT_ADTRAN = "y";
+ NVMEM_MTK_EFUSE = "y";
+ NVMEM_SYSFS = "y";
+ OF = "y";
+ OF_ADDRESS = "y";
+ OF_DYNAMIC = "y";
+ OF_EARLY_FLATTREE = "y";
+ OF_FLATTREE = "y";
+ OF_GPIO = "y";
+ OF_IRQ = "y";
+ OF_KOBJ = "y";
+ OF_MDIO = "y";
+ OF_OVERLAY = "y";
+ OF_RESOLVE = "y";
+ PADATA = "y";
+ PAGE_POOL = "y";
+ PAGE_POOL_STATS = "y";
+ PAGE_SIZE_LESS_THAN_256KB = "y";
+ PAGE_SIZE_LESS_THAN_64KB = "y";
+ #PAHOLE_HAS_LANG_EXCLUDE="y";
+ PARTITION_PERCPU = "y";
+ PCI = "y";
+ PCIEAER = "y";
+ PCIEASPM = "y";
+ PCIEASPM_PERFORMANCE = "y";
+ PCIEPORTBUS = "y";
+ PCIE_MEDIATEK_GEN3 = "y";
+ PCIE_PME = "y";
+ PCI_DEBUG = "y";
+ PCI_DOMAINS = "y";
+ PCI_DOMAINS_GENERIC = "y";
+ PCI_MSI = "y";
+ PCS_MTK_LYNXI = "y";
+ PCS_MTK_USXGMII = "y";
+ PERF_EVENTS = "y";
+ PER_VMA_LOCK = "y";
+ PGTABLE_LEVELS = "3";
+ PHYLIB = "y";
+ PHYLIB_LEDS = "y";
+ PHYLINK = "y";
+ PHYS_ADDR_T_64BIT = "y";
+ PHY_MTK_TPHY = "y";
+ PHY_MTK_XFI_TPHY = "y";
+ PHY_MTK_XSPHY = "y";
+ PINCTRL = "y";
+ PINCTRL_MT7981 = "y";
+ PINCTRL_MT7986 = "y";
+ PINCTRL_MT7988 = "y";
+ PINCTRL_MTK_MOORE = "y";
+ PINCTRL_MTK_V2 = "y";
+ PM = "y";
+ PM_CLK = "y";
+ PM_GENERIC_DOMAINS = "y";
+ PM_GENERIC_DOMAINS_OF = "y";
+ PM_OPP = "y";
+ POLYNOMIAL = "y";
+ POSIX_CPU_TIMERS_TASK_WORK = "y";
+ POWER_RESET = "y";
+ POWER_RESET_SYSCON = "y";
+ POWER_SUPPLY = "y";
+ PREEMPT_NONE_BUILD = "y";
+ PRINTK_TIME = "y";
+ PSTORE = "y";
+ PSTORE_COMPRESS = "y";
+ PSTORE_CONSOLE = "y";
+ PSTORE_PMSG = "y";
+ PSTORE_RAM = "y";
+ PTP_1588_CLOCK_OPTIONAL = "y";
+ PWM = "y";
+ PWM_MEDIATEK = "y";
+ PWM_SYSFS = "y";
+ QUEUED_RWLOCKS = "y";
+ QUEUED_SPINLOCKS = "y";
+ RANDSTRUCT_NONE = "y";
+ RAS = "y";
+ RATIONAL = "y";
+ REALTEK_PHY = "y";
+ REED_SOLOMON = "y";
+ REED_SOLOMON_DEC8 = "y";
+ REED_SOLOMON_ENC8 = "y";
+ REGMAP = "y";
+ REGMAP_I2C = "y";
+ REGMAP_MMIO = "y";
+ REGULATOR = "y";
+ REGULATOR_FIXED_VOLTAGE = "y";
+ REGULATOR_MT6380 = "y";
+ REGULATOR_RT5190A = "y";
+ RESET_CONTROLLER = "y";
+ RESET_TI_SYSCON = "y";
+ RFS_ACCEL = "y";
+ RODATA_FULL_DEFAULT_ENABLED = "y";
+ RPS = "y";
+ RTC_CLASS = "y";
+ RTC_DRV_MT7622 = "y";
+ RTC_I2C_AND_SPI = "y";
+ RWSEM_SPIN_ON_OWNER = "y";
+ SCHED_MC = "y";
+ SCSI = "y";
+ SCSI_COMMON = "y";
+ SERIAL_8250_FSL = "y";
+ SERIAL_8250_MT6577 = "y";
+ SERIAL_8250_NR_UARTS = "3";
+ SERIAL_8250_RUNTIME_UARTS = "3";
+ SERIAL_DEV_BUS = "y";
+ SERIAL_DEV_CTRL_TTYPORT = "y";
+ SERIAL_MCTRL_GPIO = "y";
+ SERIAL_OF_PLATFORM = "y";
+ SGL_ALLOC = "y";
+ SG_POOL = "y";
+ SMP = "y";
+ SOCK_RX_QUEUE_MAPPING = "y";
+ SOFTIRQ_ON_OWN_STACK = "y";
+ SPARSEMEM = "y";
+ SPARSEMEM_EXTREME = "y";
+ SPARSEMEM_VMEMMAP = "y";
+ SPARSEMEM_VMEMMAP_ENABLE = "y";
+ SPARSE_IRQ = "y";
+ SPI = "y";
+ SPI_DYNAMIC = "y";
+ SPI_MASTER = "y";
+ SPI_MEM = "y";
+ SPI_MT65XX = "y";
+ SPI_MTK_SNFI = "y";
+ #SQUASHFS_DECOMP_MULTI_PERCPU="y";
+ SWIOTLB = "y";
+ SWPHY = "y";
+ SYSCTL_EXCEPTION_TRACE = "y";
+ THERMAL = "y";
+ THERMAL_DEFAULT_GOV_STEP_WISE = "y";
+ THERMAL_EMERGENCY_POWEROFF_DELAY_MS = "0";
+ THERMAL_GOV_BANG_BANG = "y";
+ THERMAL_GOV_FAIR_SHARE = "y";
+ THERMAL_GOV_STEP_WISE = "y";
+ THERMAL_GOV_USER_SPACE = "y";
+ THERMAL_HWMON = "y";
+ THERMAL_OF = "y";
+ THERMAL_WRITABLE_TRIPS = "y";
+ THREAD_INFO_IN_TASK = "y";
+ TICK_CPU_ACCOUNTING = "y";
+ TIMER_OF = "y";
+ TIMER_PROBE = "y";
+ TRACE_IRQFLAGS_NMI_SUPPORT = "y";
+ TREE_RCU = "y";
+ TREE_SRCU = "y";
+ UBIFS_FS = "y";
+ UIMAGE_FIT_BLK = "y";
+ USB_SUPPORT = "y";
+ VMAP_STACK = "y";
+ WATCHDOG_CORE = "y";
+ WATCHDOG_PRETIMEOUT_DEFAULT_GOV_PANIC = "y";
+ WATCHDOG_PRETIMEOUT_GOV = "y";
+ WATCHDOG_PRETIMEOUT_GOV_PANIC = "y";
+ WATCHDOG_PRETIMEOUT_GOV_SEL = "m";
+ WATCHDOG_SYSFS = "y";
+ XPS = "y";
+ XXHASH = "y";
+ ZLIB_DEFLATE = "y";
+ ZLIB_INFLATE = "y";
+ ZONE_DMA32 = "y";
+ ZSTD_COMMON = "y";
+ ZSTD_COMPRESS = "y";
+ ZSTD_DECOMPRESS = "y";
+ # from DEVICE_PACKAGES in the openwrt_one section of
+ # openwrt's ./target/linux/mediatek/image/filogic.mk:
+ # chop off the 'kmod-' prefix and search for 'KernelPackage/...'
+ # in ./package/kernel/linux/modules/*.mk, and remember to add
+ # modules to kmodloader targets below
+ AIR_EN8811H_PHY = "m";
+ RTC_DRV_PCF8563 = "m";
+ NVME_CORE = "m";
+ BLK_DEV_NVME = "m";
+ NVME_MULTIPATH = "n";
+ NVME_HWMON = "y";
+ # ???
+ AQUANTIA_PHY = "m";
+ MT798X_WMAC = "y";
+ }
+ // lib.optionalAttrs (config.system.service ? watchdog) {
+ RALINK_WDT = "y"; # watchdog
+ MT7621_WDT = "y"; # or it might be this one
+ };
conditionalConfig = {
WLAN = {
MT7915E = "m";
diff --git a/devices/qemu-aarch64/default.nix b/devices/qemu-aarch64/default.nix
@@ -11,16 +11,16 @@
description = ''
-== QEMU Aarch64
+ == QEMU Aarch64
-This target produces an image for the
-https://www.qemu.org/docs/master/system/arm/virt.html[QEMU "virt"
-platform] using a 64 bit CPU type.
+ This target produces an image for the
+ https://www.qemu.org/docs/master/system/arm/virt.html[QEMU "virt"
+ platform] using a 64 bit CPU type.
-ARM targets differ from MIPS in that the kernel format expected by QEMU
-is an "Image" (raw binary file) rather than an ELF file, but this is
-taken care of by `+run.sh+`. Check the documentation for the `+qemu+`
-target for more information.
+ ARM targets differ from MIPS in that the kernel format expected by QEMU
+ is an "Image" (raw binary file) rather than an ELF file, but this is
+ taken care of by `+run.sh+`. Check the documentation for the `+qemu+`
+ target for more information.
'';
# this device is described by the "qemu" device
diff --git a/devices/qemu-armv7l/default.nix b/devices/qemu-armv7l/default.nix
@@ -11,16 +11,16 @@
# this device is described by the "qemu" device
description = ''
-== QEMU ARM v7
+ == QEMU ARM v7
-This target produces an image for the
-https://www.qemu.org/docs/master/system/arm/virt.html[QEMU "virt"
-platform] using a 32 bit CPU type.
+ This target produces an image for the
+ https://www.qemu.org/docs/master/system/arm/virt.html[QEMU "virt"
+ platform] using a 32 bit CPU type.
-ARM targets differ from MIPS in that the kernel format expected by QEMU
-is an "Image" (raw binary file) rather than an ELF file, but this is
-taken care of by `+run.sh+`. Check the documentation for the `+QEMU+`
-(MIPS) target for more information. '';
+ ARM targets differ from MIPS in that the kernel format expected by QEMU
+ is an "Image" (raw binary file) rather than an ELF file, but this is
+ taken care of by `+run.sh+`. Check the documentation for the `+QEMU+`
+ (MIPS) target for more information. '';
installer = "vmroot";
module =
diff --git a/devices/qemu/default.nix b/devices/qemu/default.nix
@@ -13,23 +13,23 @@
};
description = ''
-== QEMU MIPS
+ == QEMU MIPS
-This target produces an image for QEMU, the "generic and open source
-machine emulator and virtualizer".
+ This target produces an image for QEMU, the "generic and open source
+ machine emulator and virtualizer".
-MIPS QEMU emulates a "Malta" board, which was an ATX form factor
-evaluation board made by MIPS Technologies, but mostly in Liminix we use
-paravirtualized devices (Virtio) instead of emulating hardware.
+ MIPS QEMU emulates a "Malta" board, which was an ATX form factor
+ evaluation board made by MIPS Technologies, but mostly in Liminix we use
+ paravirtualized devices (Virtio) instead of emulating hardware.
-Building an image for QEMU results in a `+result/+` directory containing
-`+run.sh+` `+vmlinux+`, and `+rootfs+` files. To invoke the emulator,
-run `+run.sh+`.
+ Building an image for QEMU results in a `+result/+` directory containing
+ `+run.sh+` `+vmlinux+`, and `+rootfs+` files. To invoke the emulator,
+ run `+run.sh+`.
-The configuration includes two emulated "hardware" ethernet devices and
-the kernel `+mac80211_hwsim+` module to provide an emulated wlan device.
-To read more about how to connect to this network, refer to
-`+qemu-networking+` in the Development manual.
+ The configuration includes two emulated "hardware" ethernet devices and
+ the kernel `+mac80211_hwsim+` module to provide an emulated wlan device.
+ To read more about how to connect to this network, refer to
+ `+qemu-networking+` in the Development manual.
'';
module =
diff --git a/devices/tp-archer-ax23/default.nix b/devices/tp-archer-ax23/default.nix
@@ -1,22 +1,22 @@
{
description = ''
-== TP-Link Archer AX23 / AX1800 Dual Band Wi-Fi 6 Router
+ == TP-Link Archer AX23 / AX1800 Dual Band Wi-Fi 6 Router
-=== Hardware summary
+ === Hardware summary
-* MediaTek MT7621 (880MHz)
-* 16MB Flash
-* 128MB RAM
-* WLan hardware: Mediatek MT7905, MT7975
+ * MediaTek MT7621 (880MHz)
+ * 16MB Flash
+ * 128MB RAM
+ * WLan hardware: Mediatek MT7905, MT7975
-=== Limitations
+ === Limitations
-Status LEDs do not work yet.
+ Status LEDs do not work yet.
-Uploading an image via tftp doesn't work yet, because the Archer uboot
-version is so old it doesn't support overriding the DTB from the mboot
-command. The tftpboot module doesn't support this yet, see
-https://gti.telent.net/dan/liminix/pulls/5 for the WiP.
+ Uploading an image via tftp doesn't work yet, because the Archer uboot
+ version is so old it doesn't support overriding the DTB from the mboot
+ command. The tftpboot module doesn't support this yet, see
+ https://gti.telent.net/dan/liminix/pulls/5 for the WiP.
'';
system = {
@@ -59,275 +59,274 @@ https://gti.telent.net/dan/liminix/pulls/5 for the WiP.
extraPatchPhase = ''
${pkgs.openwrt.applyPatches.ramips}
'';
- config =
- {
- # Initially taken from openwrt's ./target/linux/ramips/mt7621/config-5.15,
- # then tweaked here and there
- ARCH_32BIT_OFF_T = "y";
- ARCH_HIBERNATION_POSSIBLE = "y";
- ARCH_KEEP_MEMBLOCK = "y";
- ARCH_MMAP_RND_BITS_MAX = "15";
- ARCH_MMAP_RND_COMPAT_BITS_MAX = "15";
- ARCH_SUSPEND_POSSIBLE = "y";
- AT803X_PHY = "y";
- BLK_MQ_PCI = "y";
- BOARD_SCACHE = "y";
- CEVT_R4K = "y";
- CLKSRC_MIPS_GIC = "y";
- CLK_MT7621 = "y";
- CLOCKSOURCE_WATCHDOG = "y";
- CLONE_BACKWARDS = "y";
- CMDLINE_BOOL = "y";
- COMMON_CLK = "y";
- COMPAT_32BIT_TIME = "y";
- CPU_GENERIC_DUMP_TLB = "y";
- CPU_HAS_DIEI = "y";
- CPU_HAS_PREFETCH = "y";
- CPU_HAS_RIXI = "y";
- CPU_HAS_SYNC = "y";
- CPU_LITTLE_ENDIAN = "y";
- CPU_MIPS32 = "y";
- CPU_MIPS32_R2 = "y";
- CPU_MIPSR2 = "y";
- CPU_MIPSR2_IRQ_EI = "y";
- CPU_MIPSR2_IRQ_VI = "y";
- CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS = "y";
- CPU_R4K_CACHE_TLB = "y";
- CPU_RMAP = "y";
- CPU_SUPPORTS_32BIT_KERNEL = "y";
- CPU_SUPPORTS_HIGHMEM = "y";
- CPU_SUPPORTS_MSA = "y";
- CRC16 = "y";
- CRYPTO_DEFLATE = "y";
- CRYPTO_HASH_INFO = "y";
- CRYPTO_LIB_BLAKE2S_GENERIC = "y";
- CRYPTO_LIB_POLY1305_RSIZE = "2";
- CRYPTO_LZO = "y";
- CRYPTO_ZSTD = "y";
- CSRC_R4K = "y";
- DIMLIB = "y";
- DMA_NONCOHERENT = "y";
- DTB_RT_NONE = "y";
- DTC = "y";
- EARLY_PRINTK = "y";
- FIXED_PHY = "y";
- FWNODE_MDIO = "y";
- FW_LOADER_PAGED_BUF = "y";
- GENERIC_ATOMIC64 = "y";
- GENERIC_CLOCKEVENTS = "y";
- GENERIC_CMOS_UPDATE = "y";
- GENERIC_CPU_AUTOPROBE = "y";
- GENERIC_FIND_FIRST_BIT = "y";
- GENERIC_GETTIMEOFDAY = "y";
- GENERIC_IOMAP = "y";
- GENERIC_IRQ_CHIP = "y";
- GENERIC_IRQ_EFFECTIVE_AFF_MASK = "y";
- GENERIC_IRQ_SHOW = "y";
- GENERIC_LIB_ASHLDI3 = "y";
- GENERIC_LIB_ASHRDI3 = "y";
- GENERIC_LIB_CMPDI2 = "y";
- GENERIC_LIB_LSHRDI3 = "y";
- GENERIC_LIB_UCMPDI2 = "y";
- GENERIC_PCI_IOMAP = "y";
- GENERIC_PHY = "y";
- GENERIC_PINCONF = "y";
- GENERIC_SCHED_CLOCK = "y";
- GENERIC_SMP_IDLE_THREAD = "y";
- GENERIC_TIME_VSYSCALL = "y";
- GLOB = "y";
- GPIOLIB_IRQCHIP = "y";
- GPIO_CDEV = "y";
- GPIO_GENERIC = "y";
- GPIO_MT7621 = "y";
- GRO_CELLS = "y";
- HANDLE_DOMAIN_IRQ = "y";
- HARDWARE_WATCHPOINTS = "y";
- HAS_DMA = "y";
- HAS_IOMEM = "y";
- HAS_IOPORT_MAP = "y";
- I2C = "y";
- I2C_ALGOBIT = "y";
- I2C_BOARDINFO = "y";
- I2C_CHARDEV = "y";
- I2C_GPIO = "y";
- I2C_MT7621 = "y";
- ICPLUS_PHY = "y";
- IRQCHIP = "y";
- IRQ_DOMAIN = "y";
- IRQ_DOMAIN_HIERARCHY = "y";
- IRQ_FORCED_THREADING = "y";
- IRQ_MIPS_CPU = "y";
- IRQ_WORK = "y";
- LIBFDT = "y";
- LOCK_DEBUGGING_SUPPORT = "y";
- LZO_COMPRESS = "y";
- LZO_DECOMPRESS = "y";
- MDIO_BUS = "y";
- MDIO_DEVICE = "y";
- MDIO_DEVRES = "y";
- MEDIATEK_GE_PHY = "y";
- MEMFD_CREATE = "y";
- MFD_SYSCON = "y";
- MIGRATION = "y";
- MIKROTIK = "y";
- MIKROTIK_RB_SYSFS = "y";
- MIPS = "y";
- MIPS_ASID_BITS = "8";
- MIPS_ASID_SHIFT = "0";
- MIPS_CLOCK_VSYSCALL = "y";
- MIPS_CM = "y";
- MIPS_CPC = "y";
- MIPS_CPS = "y";
- MIPS_CPU_SCACHE = "y";
- MIPS_GIC = "y";
- MIPS_L1_CACHE_SHIFT = "5";
- MIPS_LD_CAN_LINK_VDSO = "y";
- MIPS_MT = "y";
- MIPS_MT_FPAFF = "y";
- MIPS_MT_SMP = "y";
- MIPS_NR_CPU_NR_MAP = "4";
- MIPS_PERF_SHARED_TC_COUNTERS = "y";
- MIPS_SPRAM = "y";
- MODULES_USE_ELF_REL = "y";
- MTD_CMDLINE_PARTS = "y";
- MTD_NAND_CORE = "y";
- MTD_NAND_ECC = "y";
- MTD_NAND_ECC_SW_HAMMING = "y";
- MTD_NAND_MT7621 = "y";
- MTD_NAND_MTK_BMT = "y";
- MTD_RAW_NAND = "y";
- MTD_ROUTERBOOT_PARTS = "y";
- MTD_SERCOMM_PARTS = "y";
- MTD_SPI_NOR = "y";
- MTD_SPLIT_FIT_FW = "y";
- MTD_SPLIT_MINOR_FW = "y";
- MTD_SPLIT_SEAMA_FW = "y";
- MTD_SPLIT_TPLINK_FW = "y";
- MTD_SPLIT_TRX_FW = "y";
- MTD_SPLIT_UIMAGE_FW = "y";
- MTD_UBI = "y";
- MTD_UBI_BEB_LIMIT = "20";
- MTD_UBI_BLOCK = "y";
- MTD_UBI_WL_THRESHOLD = "4096";
- MTD_VIRT_CONCAT = "y";
- NEED_DMA_MAP_STATE = "y";
- NET_DEVLINK = "y";
- NET_DSA = "y";
- NET_DSA_MT7530 = "y";
- NET_DSA_MT7530_MDIO = "y";
- NET_DSA_TAG_MTK = "y";
- NET_FLOW_LIMIT = "y";
- NET_MEDIATEK_SOC = "y";
- NET_SELFTESTS = "y";
- NET_SWITCHDEV = "y";
- NET_VENDOR_MEDIATEK = "y";
- NO_HZ_COMMON = "y";
- NO_HZ_IDLE = "y";
- NR_CPUS = "4";
- NVMEM = "y";
- OF = "y";
- OF_ADDRESS = "y";
- OF_EARLY_FLATTREE = "y";
- OF_FLATTREE = "y";
- OF_GPIO = "y";
- OF_IRQ = "y";
- OF_KOBJ = "y";
- OF_MDIO = "y";
- PAGE_POOL = "y";
- PAGE_POOL_STATS = "y";
- PCI = "y";
- PCIE_MT7621 = "y";
- PCI_DISABLE_COMMON_QUIRKS = "y";
- PCI_DOMAINS = "y";
- PCI_DOMAINS_GENERIC = "y";
- PCI_DRIVERS_GENERIC = "y";
- PCS_MTK_LYNXI = "y";
- PERF_USE_VMALLOC = "y";
- PGTABLE_LEVELS = "2";
- PHYLIB = "y";
- PHYLINK = "y";
- PHY_MT7621_PCI = "y";
- PINCTRL = "y";
- PINCTRL_AW9523 = "y";
- PINCTRL_MT7621 = "y";
- PINCTRL_RALINK = "y";
- PINCTRL_SX150X = "y";
- POWER_RESET = "y";
- POWER_RESET_GPIO = "y";
- POWER_SUPPLY = "y";
- PTP_1588_CLOCK_OPTIONAL = "y";
- QUEUED_RWLOCKS = "y";
- QUEUED_SPINLOCKS = "y";
- RALINK = "y";
- RATIONAL = "y";
- REGMAP = "y";
- REGMAP_I2C = "y";
- REGMAP_MMIO = "y";
- REGULATOR = "y";
- REGULATOR_FIXED_VOLTAGE = "y";
- RESET_CONTROLLER = "y";
- RFS_ACCEL = "y";
- RPS = "y";
- RTC_CLASS = "y";
- RTC_DRV_BQ32K = "y";
- RTC_DRV_PCF8563 = "y";
- RTC_I2C_AND_SPI = "y";
- SCHED_SMT = "y";
- SERIAL_8250 = "y";
- SERIAL_8250_CONSOLE = "y";
- SERIAL_8250_NR_UARTS = "3";
- SERIAL_8250_RUNTIME_UARTS = "3";
- SERIAL_MCTRL_GPIO = "y";
- SERIAL_OF_PLATFORM = "y";
- SGL_ALLOC = "y";
- SMP = "y";
- SMP_UP = "y";
- SOCK_RX_QUEUE_MAPPING = "y";
- SOC_BUS = "y";
- SOC_MT7621 = "y";
- SPI = "y";
- SPI_MASTER = "y";
- SPI_MEM = "y";
- SPI_MT7621 = "y";
- SRCU = "y";
- SWPHY = "y";
- SYNC_R4K = "y";
- SYSCTL_EXCEPTION_TRACE = "y";
- SYS_HAS_CPU_MIPS32_R1 = "y";
- SYS_HAS_CPU_MIPS32_R2 = "y";
- SYS_HAS_EARLY_PRINTK = "y";
- SYS_SUPPORTS_32BIT_KERNEL = "y";
- SYS_SUPPORTS_ARBIT_HZ = "y";
- SYS_SUPPORTS_HIGHMEM = "y";
- SYS_SUPPORTS_HOTPLUG_CPU = "y";
- SYS_SUPPORTS_LITTLE_ENDIAN = "y";
- SYS_SUPPORTS_MIPS16 = "y";
- SYS_SUPPORTS_MIPS_CPS = "y";
- SYS_SUPPORTS_MULTITHREADING = "y";
- SYS_SUPPORTS_SCHED_SMT = "y";
- SYS_SUPPORTS_SMP = "y";
- SYS_SUPPORTS_ZBOOT = "y";
- TARGET_ISA_REV = "2";
- TICK_CPU_ACCOUNTING = "y";
- TIMER_OF = "y";
- TIMER_PROBE = "y";
- TREE_RCU = "y";
- TREE_SRCU = "y";
- UBIFS_FS = "y";
- USB_SUPPORT = "y";
- USE_OF = "y";
- WEAK_ORDERING = "y";
- XPS = "y";
- XXHASH = "y";
- ZLIB_DEFLATE = "y";
- ZLIB_INFLATE = "y";
- ZSTD_COMPRESS = "y";
- ZSTD_DECOMPRESS = "y";
- }
- // lib.optionalAttrs (config.system.service ? watchdog) {
- RALINK_WDT = "y"; # watchdog
- MT7621_WDT = "y"; # or it might be this one
- };
+ config = {
+ # Initially taken from openwrt's ./target/linux/ramips/mt7621/config-5.15,
+ # then tweaked here and there
+ ARCH_32BIT_OFF_T = "y";
+ ARCH_HIBERNATION_POSSIBLE = "y";
+ ARCH_KEEP_MEMBLOCK = "y";
+ ARCH_MMAP_RND_BITS_MAX = "15";
+ ARCH_MMAP_RND_COMPAT_BITS_MAX = "15";
+ ARCH_SUSPEND_POSSIBLE = "y";
+ AT803X_PHY = "y";
+ BLK_MQ_PCI = "y";
+ BOARD_SCACHE = "y";
+ CEVT_R4K = "y";
+ CLKSRC_MIPS_GIC = "y";
+ CLK_MT7621 = "y";
+ CLOCKSOURCE_WATCHDOG = "y";
+ CLONE_BACKWARDS = "y";
+ CMDLINE_BOOL = "y";
+ COMMON_CLK = "y";
+ COMPAT_32BIT_TIME = "y";
+ CPU_GENERIC_DUMP_TLB = "y";
+ CPU_HAS_DIEI = "y";
+ CPU_HAS_PREFETCH = "y";
+ CPU_HAS_RIXI = "y";
+ CPU_HAS_SYNC = "y";
+ CPU_LITTLE_ENDIAN = "y";
+ CPU_MIPS32 = "y";
+ CPU_MIPS32_R2 = "y";
+ CPU_MIPSR2 = "y";
+ CPU_MIPSR2_IRQ_EI = "y";
+ CPU_MIPSR2_IRQ_VI = "y";
+ CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS = "y";
+ CPU_R4K_CACHE_TLB = "y";
+ CPU_RMAP = "y";
+ CPU_SUPPORTS_32BIT_KERNEL = "y";
+ CPU_SUPPORTS_HIGHMEM = "y";
+ CPU_SUPPORTS_MSA = "y";
+ CRC16 = "y";
+ CRYPTO_DEFLATE = "y";
+ CRYPTO_HASH_INFO = "y";
+ CRYPTO_LIB_BLAKE2S_GENERIC = "y";
+ CRYPTO_LIB_POLY1305_RSIZE = "2";
+ CRYPTO_LZO = "y";
+ CRYPTO_ZSTD = "y";
+ CSRC_R4K = "y";
+ DIMLIB = "y";
+ DMA_NONCOHERENT = "y";
+ DTB_RT_NONE = "y";
+ DTC = "y";
+ EARLY_PRINTK = "y";
+ FIXED_PHY = "y";
+ FWNODE_MDIO = "y";
+ FW_LOADER_PAGED_BUF = "y";
+ GENERIC_ATOMIC64 = "y";
+ GENERIC_CLOCKEVENTS = "y";
+ GENERIC_CMOS_UPDATE = "y";
+ GENERIC_CPU_AUTOPROBE = "y";
+ GENERIC_FIND_FIRST_BIT = "y";
+ GENERIC_GETTIMEOFDAY = "y";
+ GENERIC_IOMAP = "y";
+ GENERIC_IRQ_CHIP = "y";
+ GENERIC_IRQ_EFFECTIVE_AFF_MASK = "y";
+ GENERIC_IRQ_SHOW = "y";
+ GENERIC_LIB_ASHLDI3 = "y";
+ GENERIC_LIB_ASHRDI3 = "y";
+ GENERIC_LIB_CMPDI2 = "y";
+ GENERIC_LIB_LSHRDI3 = "y";
+ GENERIC_LIB_UCMPDI2 = "y";
+ GENERIC_PCI_IOMAP = "y";
+ GENERIC_PHY = "y";
+ GENERIC_PINCONF = "y";
+ GENERIC_SCHED_CLOCK = "y";
+ GENERIC_SMP_IDLE_THREAD = "y";
+ GENERIC_TIME_VSYSCALL = "y";
+ GLOB = "y";
+ GPIOLIB_IRQCHIP = "y";
+ GPIO_CDEV = "y";
+ GPIO_GENERIC = "y";
+ GPIO_MT7621 = "y";
+ GRO_CELLS = "y";
+ HANDLE_DOMAIN_IRQ = "y";
+ HARDWARE_WATCHPOINTS = "y";
+ HAS_DMA = "y";
+ HAS_IOMEM = "y";
+ HAS_IOPORT_MAP = "y";
+ I2C = "y";
+ I2C_ALGOBIT = "y";
+ I2C_BOARDINFO = "y";
+ I2C_CHARDEV = "y";
+ I2C_GPIO = "y";
+ I2C_MT7621 = "y";
+ ICPLUS_PHY = "y";
+ IRQCHIP = "y";
+ IRQ_DOMAIN = "y";
+ IRQ_DOMAIN_HIERARCHY = "y";
+ IRQ_FORCED_THREADING = "y";
+ IRQ_MIPS_CPU = "y";
+ IRQ_WORK = "y";
+ LIBFDT = "y";
+ LOCK_DEBUGGING_SUPPORT = "y";
+ LZO_COMPRESS = "y";
+ LZO_DECOMPRESS = "y";
+ MDIO_BUS = "y";
+ MDIO_DEVICE = "y";
+ MDIO_DEVRES = "y";
+ MEDIATEK_GE_PHY = "y";
+ MEMFD_CREATE = "y";
+ MFD_SYSCON = "y";
+ MIGRATION = "y";
+ MIKROTIK = "y";
+ MIKROTIK_RB_SYSFS = "y";
+ MIPS = "y";
+ MIPS_ASID_BITS = "8";
+ MIPS_ASID_SHIFT = "0";
+ MIPS_CLOCK_VSYSCALL = "y";
+ MIPS_CM = "y";
+ MIPS_CPC = "y";
+ MIPS_CPS = "y";
+ MIPS_CPU_SCACHE = "y";
+ MIPS_GIC = "y";
+ MIPS_L1_CACHE_SHIFT = "5";
+ MIPS_LD_CAN_LINK_VDSO = "y";
+ MIPS_MT = "y";
+ MIPS_MT_FPAFF = "y";
+ MIPS_MT_SMP = "y";
+ MIPS_NR_CPU_NR_MAP = "4";
+ MIPS_PERF_SHARED_TC_COUNTERS = "y";
+ MIPS_SPRAM = "y";
+ MODULES_USE_ELF_REL = "y";
+ MTD_CMDLINE_PARTS = "y";
+ MTD_NAND_CORE = "y";
+ MTD_NAND_ECC = "y";
+ MTD_NAND_ECC_SW_HAMMING = "y";
+ MTD_NAND_MT7621 = "y";
+ MTD_NAND_MTK_BMT = "y";
+ MTD_RAW_NAND = "y";
+ MTD_ROUTERBOOT_PARTS = "y";
+ MTD_SERCOMM_PARTS = "y";
+ MTD_SPI_NOR = "y";
+ MTD_SPLIT_FIT_FW = "y";
+ MTD_SPLIT_MINOR_FW = "y";
+ MTD_SPLIT_SEAMA_FW = "y";
+ MTD_SPLIT_TPLINK_FW = "y";
+ MTD_SPLIT_TRX_FW = "y";
+ MTD_SPLIT_UIMAGE_FW = "y";
+ MTD_UBI = "y";
+ MTD_UBI_BEB_LIMIT = "20";
+ MTD_UBI_BLOCK = "y";
+ MTD_UBI_WL_THRESHOLD = "4096";
+ MTD_VIRT_CONCAT = "y";
+ NEED_DMA_MAP_STATE = "y";
+ NET_DEVLINK = "y";
+ NET_DSA = "y";
+ NET_DSA_MT7530 = "y";
+ NET_DSA_MT7530_MDIO = "y";
+ NET_DSA_TAG_MTK = "y";
+ NET_FLOW_LIMIT = "y";
+ NET_MEDIATEK_SOC = "y";
+ NET_SELFTESTS = "y";
+ NET_SWITCHDEV = "y";
+ NET_VENDOR_MEDIATEK = "y";
+ NO_HZ_COMMON = "y";
+ NO_HZ_IDLE = "y";
+ NR_CPUS = "4";
+ NVMEM = "y";
+ OF = "y";
+ OF_ADDRESS = "y";
+ OF_EARLY_FLATTREE = "y";
+ OF_FLATTREE = "y";
+ OF_GPIO = "y";
+ OF_IRQ = "y";
+ OF_KOBJ = "y";
+ OF_MDIO = "y";
+ PAGE_POOL = "y";
+ PAGE_POOL_STATS = "y";
+ PCI = "y";
+ PCIE_MT7621 = "y";
+ PCI_DISABLE_COMMON_QUIRKS = "y";
+ PCI_DOMAINS = "y";
+ PCI_DOMAINS_GENERIC = "y";
+ PCI_DRIVERS_GENERIC = "y";
+ PCS_MTK_LYNXI = "y";
+ PERF_USE_VMALLOC = "y";
+ PGTABLE_LEVELS = "2";
+ PHYLIB = "y";
+ PHYLINK = "y";
+ PHY_MT7621_PCI = "y";
+ PINCTRL = "y";
+ PINCTRL_AW9523 = "y";
+ PINCTRL_MT7621 = "y";
+ PINCTRL_RALINK = "y";
+ PINCTRL_SX150X = "y";
+ POWER_RESET = "y";
+ POWER_RESET_GPIO = "y";
+ POWER_SUPPLY = "y";
+ PTP_1588_CLOCK_OPTIONAL = "y";
+ QUEUED_RWLOCKS = "y";
+ QUEUED_SPINLOCKS = "y";
+ RALINK = "y";
+ RATIONAL = "y";
+ REGMAP = "y";
+ REGMAP_I2C = "y";
+ REGMAP_MMIO = "y";
+ REGULATOR = "y";
+ REGULATOR_FIXED_VOLTAGE = "y";
+ RESET_CONTROLLER = "y";
+ RFS_ACCEL = "y";
+ RPS = "y";
+ RTC_CLASS = "y";
+ RTC_DRV_BQ32K = "y";
+ RTC_DRV_PCF8563 = "y";
+ RTC_I2C_AND_SPI = "y";
+ SCHED_SMT = "y";
+ SERIAL_8250 = "y";
+ SERIAL_8250_CONSOLE = "y";
+ SERIAL_8250_NR_UARTS = "3";
+ SERIAL_8250_RUNTIME_UARTS = "3";
+ SERIAL_MCTRL_GPIO = "y";
+ SERIAL_OF_PLATFORM = "y";
+ SGL_ALLOC = "y";
+ SMP = "y";
+ SMP_UP = "y";
+ SOCK_RX_QUEUE_MAPPING = "y";
+ SOC_BUS = "y";
+ SOC_MT7621 = "y";
+ SPI = "y";
+ SPI_MASTER = "y";
+ SPI_MEM = "y";
+ SPI_MT7621 = "y";
+ SRCU = "y";
+ SWPHY = "y";
+ SYNC_R4K = "y";
+ SYSCTL_EXCEPTION_TRACE = "y";
+ SYS_HAS_CPU_MIPS32_R1 = "y";
+ SYS_HAS_CPU_MIPS32_R2 = "y";
+ SYS_HAS_EARLY_PRINTK = "y";
+ SYS_SUPPORTS_32BIT_KERNEL = "y";
+ SYS_SUPPORTS_ARBIT_HZ = "y";
+ SYS_SUPPORTS_HIGHMEM = "y";
+ SYS_SUPPORTS_HOTPLUG_CPU = "y";
+ SYS_SUPPORTS_LITTLE_ENDIAN = "y";
+ SYS_SUPPORTS_MIPS16 = "y";
+ SYS_SUPPORTS_MIPS_CPS = "y";
+ SYS_SUPPORTS_MULTITHREADING = "y";
+ SYS_SUPPORTS_SCHED_SMT = "y";
+ SYS_SUPPORTS_SMP = "y";
+ SYS_SUPPORTS_ZBOOT = "y";
+ TARGET_ISA_REV = "2";
+ TICK_CPU_ACCOUNTING = "y";
+ TIMER_OF = "y";
+ TIMER_PROBE = "y";
+ TREE_RCU = "y";
+ TREE_SRCU = "y";
+ UBIFS_FS = "y";
+ USB_SUPPORT = "y";
+ USE_OF = "y";
+ WEAK_ORDERING = "y";
+ XPS = "y";
+ XXHASH = "y";
+ ZLIB_DEFLATE = "y";
+ ZLIB_INFLATE = "y";
+ ZSTD_COMPRESS = "y";
+ ZSTD_DECOMPRESS = "y";
+ }
+ // lib.optionalAttrs (config.system.service ? watchdog) {
+ RALINK_WDT = "y"; # watchdog
+ MT7621_WDT = "y"; # or it might be this one
+ };
conditionalConfig = {
WLAN = {
MT7915E = "m";
diff --git a/devices/turris-omnia/default.nix b/devices/turris-omnia/default.nix
@@ -1,151 +1,151 @@
{
description = ''
-== Turris Omnia
-
-This is a 32 bit ARMv7 MVEBU device, which is usually shipped with
-TurrisOS, an OpenWrt-based system. Rather than reformatting the builtin
-storage, we install Liminix on to the existing btrfs filesystem so that
-the vendor snapshot/recovery system continues to work (and provides you
-an easy rollback if you decide you don't like Liminix after all).
-
-The install process has two stages, and is intended that you should not
-need to open the device and add a serial console (although it may be
-handy for visibility, and in case anything goes wrong). First we build a
-minimal installation/recovery system, then we reboot into that recovery
-image to prepare the device for the full target install.
-
-=== Installation using a USB stick
-
-First, build the image for the USB stick. Review
-`+examples/recovery.nix+` in order to change the default root password
-(which is `+secret+`) and/or the SSH keys, then build it with
-
-[source,console]
-----
-$ nix-build -I liminix-config=./examples/recovery.nix \
- --arg device "import ./devices/turris-omnia" \
- -A outputs.mbrimage -o mbrimage
-$ file -L mbrimage
-mbrimage: DOS/MBR boot sector; partition 1 : ID=0x83, active, start-CHS (0x0,0,5), end-CHS (0x6,130,26), startsector 4, 104602 sectors
-----
-
-Next, copy the image from your build machine to a USB storage medium
-using `+dd+` or your other most favoured file copying tool, which might
-be a comand something like this:
-
-[source,console]
-----
-$ dd if=mbrimage of=/dev/path/to/the/usb/stick \
- bs=1M conv=fdatasync status=progress
-----
-
-The Omnia's default boot order only checks USB after it has failed to
-boot from eMMC, which is not ideal for our purpose. Unless you have a
-serial cable, the easiest way to change this is by booting to TurrisOS
-and logging in with ssh:
-
-[source,console]
-----
-root@turris:/# fw_printenv boot_targets
-boot_targets=mmc0 nvme0 scsi0 usb0 pxe dhcp
-root@turris:/# fw_setenv boot_targets usb0 mmc0
-root@turris:/# fw_printenv boot_targets
-boot_targets=usb0 mmc0
-root@turris:/# reboot -f
-----
-
-It should now boot into the recovery image. It expects a network cable
-to be plugged into LAN2 with something on the other end of it that
-serves DHCP requests. Check your DHCP server logs for a request from a
-`+liminix-recovery+` host and figure out what IP address was assigned.
-
-[source,console]
-----
-$ ssh liminix-recovery.lan
-----
-
-You should get a "Busybox" banner and a root prompt. Now you can start
-preparing the device to install Liminix on it. First we'll mount the
-root filesystem and take a snapshot:
-
-[source,console]
-----
-# mkdir /dest && mount /dev/mmcblk0p1 /dest
-# schnapps -d /dest create "pre liminix"
-# schnapps -d /dest list
-ERROR: not a valid btrfs filesystem: /
- # | Type | Size | Date | Description
-------+-----------+-------------+---------------------------+------------------------------------
- 1 | single | 16.00KiB | 1970-01-01 00:11:49 +0000 | pre liminix
-----
-
-(`+not a valid btrfs filesystem: /+` is not a real error)
-
-then we can remove all the files
-
-[source,console]
-----
-# rm -r /dest/@/*
-----
-
-and then it's ready to install the real Liminix system onto. On your
-build system, create the Liminix configuration you wish to install: here
-we'll use the `+rotuer+` example.
-
-[source,console]
-----
-build$ nix-build -I liminix-config=./examples/rotuer.nix \
- --arg device "import ./devices/turris-omnia" \
- -A outputs.systemConfiguration
-----
-
-and then use `+min-copy-closure+` to copy it to the device.
-
-[source,console]
-----
-build$ nix-shell --run \
- "min-copy-closure -r /dest/@ root@liminix-recovery.lan result"
-----
-
-and activate it
-
-[source,console]
-----
-build$ ssh root@liminix-recovery.lan \
- "/dest/@/$(readlink result)/bin/install /dest/@"
-----
-
-The final steps are performed directly on the device again: add a
-symlink so U-Boot can find `+/boot+`, then restore the default boot
-order and reboot into the new configuration.
-
-[source,console]
-----
-# cd /dest && ln -s @/boot .
-# fw_setenv boot_targets "mmc0 nvme0 scsi0 usb0 pxe dhcp"
-# cd / ; umount /dest
-# reboot
-----
-
-=== Installation using a TFTP server and serial console
-
-If you have a <<serial,serial console connection>> and a TFTP server, and would
-rather use them than fiddling with USB sticks, the
-`+examples/recovery.nix+` configuration also works using the
-`+tftpboot+` output. So you can do
-
-[source,console]
-----
-build$ nix-build -I liminix-config=./examples/recovery.nix \
- --arg device "import ./devices/turris-omnia" \
- -A outputs.tftpboot
-----
-
-and then paste the generated `+result/boot.scr+` into U-Boot, and you
-will end up with the same system as you would have had after booting
-from USB. If you don't have a serial console connection you could
-probably even get clever with elaborate use of `+fw_setenv+`, but that
-is left as an exercise for the reader.
+ == Turris Omnia
+
+ This is a 32 bit ARMv7 MVEBU device, which is usually shipped with
+ TurrisOS, an OpenWrt-based system. Rather than reformatting the builtin
+ storage, we install Liminix on to the existing btrfs filesystem so that
+ the vendor snapshot/recovery system continues to work (and provides you
+ an easy rollback if you decide you don't like Liminix after all).
+
+ The install process has two stages, and is intended that you should not
+ need to open the device and add a serial console (although it may be
+ handy for visibility, and in case anything goes wrong). First we build a
+ minimal installation/recovery system, then we reboot into that recovery
+ image to prepare the device for the full target install.
+
+ === Installation using a USB stick
+
+ First, build the image for the USB stick. Review
+ `+examples/recovery.nix+` in order to change the default root password
+ (which is `+secret+`) and/or the SSH keys, then build it with
+
+ [source,console]
+ ----
+ $ nix-build -I liminix-config=./examples/recovery.nix \
+ --arg device "import ./devices/turris-omnia" \
+ -A outputs.mbrimage -o mbrimage
+ $ file -L mbrimage
+ mbrimage: DOS/MBR boot sector; partition 1 : ID=0x83, active, start-CHS (0x0,0,5), end-CHS (0x6,130,26), startsector 4, 104602 sectors
+ ----
+
+ Next, copy the image from your build machine to a USB storage medium
+ using `+dd+` or your other most favoured file copying tool, which might
+ be a comand something like this:
+
+ [source,console]
+ ----
+ $ dd if=mbrimage of=/dev/path/to/the/usb/stick \
+ bs=1M conv=fdatasync status=progress
+ ----
+
+ The Omnia's default boot order only checks USB after it has failed to
+ boot from eMMC, which is not ideal for our purpose. Unless you have a
+ serial cable, the easiest way to change this is by booting to TurrisOS
+ and logging in with ssh:
+
+ [source,console]
+ ----
+ root@turris:/# fw_printenv boot_targets
+ boot_targets=mmc0 nvme0 scsi0 usb0 pxe dhcp
+ root@turris:/# fw_setenv boot_targets usb0 mmc0
+ root@turris:/# fw_printenv boot_targets
+ boot_targets=usb0 mmc0
+ root@turris:/# reboot -f
+ ----
+
+ It should now boot into the recovery image. It expects a network cable
+ to be plugged into LAN2 with something on the other end of it that
+ serves DHCP requests. Check your DHCP server logs for a request from a
+ `+liminix-recovery+` host and figure out what IP address was assigned.
+
+ [source,console]
+ ----
+ $ ssh liminix-recovery.lan
+ ----
+
+ You should get a "Busybox" banner and a root prompt. Now you can start
+ preparing the device to install Liminix on it. First we'll mount the
+ root filesystem and take a snapshot:
+
+ [source,console]
+ ----
+ # mkdir /dest && mount /dev/mmcblk0p1 /dest
+ # schnapps -d /dest create "pre liminix"
+ # schnapps -d /dest list
+ ERROR: not a valid btrfs filesystem: /
+ # | Type | Size | Date | Description
+ ------+-----------+-------------+---------------------------+------------------------------------
+ 1 | single | 16.00KiB | 1970-01-01 00:11:49 +0000 | pre liminix
+ ----
+
+ (`+not a valid btrfs filesystem: /+` is not a real error)
+
+ then we can remove all the files
+
+ [source,console]
+ ----
+ # rm -r /dest/@/*
+ ----
+
+ and then it's ready to install the real Liminix system onto. On your
+ build system, create the Liminix configuration you wish to install: here
+ we'll use the `+rotuer+` example.
+
+ [source,console]
+ ----
+ build$ nix-build -I liminix-config=./examples/rotuer.nix \
+ --arg device "import ./devices/turris-omnia" \
+ -A outputs.systemConfiguration
+ ----
+
+ and then use `+min-copy-closure+` to copy it to the device.
+
+ [source,console]
+ ----
+ build$ nix-shell --run \
+ "min-copy-closure -r /dest/@ root@liminix-recovery.lan result"
+ ----
+
+ and activate it
+
+ [source,console]
+ ----
+ build$ ssh root@liminix-recovery.lan \
+ "/dest/@/$(readlink result)/bin/install /dest/@"
+ ----
+
+ The final steps are performed directly on the device again: add a
+ symlink so U-Boot can find `+/boot+`, then restore the default boot
+ order and reboot into the new configuration.
+
+ [source,console]
+ ----
+ # cd /dest && ln -s @/boot .
+ # fw_setenv boot_targets "mmc0 nvme0 scsi0 usb0 pxe dhcp"
+ # cd / ; umount /dest
+ # reboot
+ ----
+
+ === Installation using a TFTP server and serial console
+
+ If you have a <<serial,serial console connection>> and a TFTP server, and would
+ rather use them than fiddling with USB sticks, the
+ `+examples/recovery.nix+` configuration also works using the
+ `+tftpboot+` output. So you can do
+
+ [source,console]
+ ----
+ build$ nix-build -I liminix-config=./examples/recovery.nix \
+ --arg device "import ./devices/turris-omnia" \
+ -A outputs.tftpboot
+ ----
+
+ and then paste the generated `+result/boot.scr+` into U-Boot, and you
+ will end up with the same system as you would have had after booting
+ from USB. If you don't have a serial console connection you could
+ probably even get clever with elaborate use of `+fw_setenv+`, but that
+ is left as an exercise for the reader.
'';
diff --git a/devices/zyxel-nwa50ax/default.nix b/devices/zyxel-nwa50ax/default.nix
@@ -11,92 +11,92 @@
description = ''
-== Zyxel NWA50AX
+ == Zyxel NWA50AX
-Zyxel NWA50AX is quite close to the GL-MT300N-v2 "Mango" device, but it is based on the MT7621
-chipset instead of the MT7628.
+ Zyxel NWA50AX is quite close to the GL-MT300N-v2 "Mango" device, but it is based on the MT7621
+ chipset instead of the MT7628.
-=== Installation
+ === Installation
-This device is pretty, but, due to its A/B capabilities, can be a bit hard
-to use completely.
+ This device is pretty, but, due to its A/B capabilities, can be a bit hard
+ to use completely.
-The stock vendor firmware is a downstream fork of U-Boot: <https://github.com/RaitoBezarius/uboot-nwa50ax>
-with restricted boot commands. Fortunately, OpenWrt folks figured out trivial command injections,
-so you can use most of the OpenWrt commands without trouble by just command injecting
-atns, atna or atnf, e.g. atns "; $real_command".
+ The stock vendor firmware is a downstream fork of U-Boot: <https://github.com/RaitoBezarius/uboot-nwa50ax>
+ with restricted boot commands. Fortunately, OpenWrt folks figured out trivial command injections,
+ so you can use most of the OpenWrt commands without trouble by just command injecting
+ atns, atna or atnf, e.g. atns "; $real_command".
-From factory web UI, you can upload the result of the zyxel-nwa-fit output.
-From another operating system, you need to `dumpimage -T flat_dt -p 0 $zyxel-nwa-fit -o firmware.bin`,
-`flash_erase $(mtd partition of the target partition firmware or zy_firmware) 0 0`, then you complete by
-`nandwrite -p $(mtd partition of the target partition firmware or zy_firmware) firmware.bin`.
+ From factory web UI, you can upload the result of the zyxel-nwa-fit output.
+ From another operating system, you need to `dumpimage -T flat_dt -p 0 $zyxel-nwa-fit -o firmware.bin`,
+ `flash_erase $(mtd partition of the target partition firmware or zy_firmware) 0 0`, then you complete by
+ `nandwrite -p $(mtd partition of the target partition firmware or zy_firmware) firmware.bin`.
-How to put the firmware.bin on the machine is left to you as an exercise, e.g. SSH, TFTP, whatever.
+ How to put the firmware.bin on the machine is left to you as an exercise, e.g. SSH, TFTP, whatever.
-From serial, you have two choices:
+ From serial, you have two choices:
-- Flash this system via U-Boot:
- same reasoning as from an existing Linux system, two choices:
- - ymodem the binary, perform the write manually, you can inspire yourself
- from the `script` contained in the vendor firmware, those are just a FIT containing a script.
- - prepare a FIT containing a script executing your commands, tftpboot this.
+ - Flash this system via U-Boot:
+ same reasoning as from an existing Linux system, two choices:
+ - ymodem the binary, perform the write manually, you can inspire yourself
+ from the `script` contained in the vendor firmware, those are just a FIT containing a script.
+ - prepare a FIT containing a script executing your commands, tftpboot this.
-- boot from an existing Liminix system, e.g. TFTPBOOT image.
-- boot from an OpenWrt system, i.e. follow OpenWrt steps.
+ - boot from an existing Liminix system, e.g. TFTPBOOT image.
+ - boot from an OpenWrt system, i.e. follow OpenWrt steps.
-Once you are in a Linux system, understand that this device has A/B boot.
+ Once you are in a Linux system, understand that this device has A/B boot.
-OpenWrt provides you with `zyxel-bootconfig` to set/unset the image status and choice.
+ OpenWrt provides you with `zyxel-bootconfig` to set/unset the image status and choice.
-The kernel is booted with `bootImage=<number>` which tells you which slot are you on.
+ The kernel is booted with `bootImage=<number>` which tells you which slot are you on.
-You should find yourself with 10ish MTD partitions, the most interesting ones are two:
+ You should find yourself with 10ish MTD partitions, the most interesting ones are two:
-- firmware: 40MB
-- firmware_1: 40MB
+ - firmware: 40MB
+ - firmware_1: 40MB
-In the current setup, they are split further into kernel (8MB) and ubi (32MB).
+ In the current setup, they are split further into kernel (8MB) and ubi (32MB).
-Once you are done with first installation, note that if you want to use the A/B feature,
-you need to write a secondary image on the slot B. There is no proper flashing code
-that will set the being-updated slot to `new` and boot on it to verify if it's working.
-This is a WIP.
+ Once you are done with first installation, note that if you want to use the A/B feature,
+ you need to write a secondary image on the slot B. There is no proper flashing code
+ that will set the being-updated slot to `new` and boot on it to verify if it's working.
+ This is a WIP.
-Upgrading your system can be achieved via:
+ Upgrading your system can be achieved via:
-- `liminix-rebuild` for the userspace.
-- `flash_erase` + `nandwrite` for the kernelspace to the other slot than the one you are booted on,
- note that you can just nandwrite the mtd partition corresponding to the *kernel* and not the whole firmware.
+ - `liminix-rebuild` for the userspace.
+ - `flash_erase` + `nandwrite` for the kernelspace to the other slot than the one you are booted on,
+ note that you can just nandwrite the mtd partition corresponding to the *kernel* and not the whole firmware.
-If you soft-bricked your AP, i.e. you cannot boot anything in U-Boot, no worries, just plug the serial console,
-prepare a TFTP server (via `tufted` for example), download vendor firmware, set up `atns`, `atnf`, etc. and run `atnz`.
+ If you soft-bricked your AP, i.e. you cannot boot anything in U-Boot, no worries, just plug the serial console,
+ prepare a TFTP server (via `tufted` for example), download vendor firmware, set up `atns`, `atnf`, etc. and run `atnz`.
-This will reflash everything back to normal via TFTP.
+ This will reflash everything back to normal via TFTP.
-If you hard-bricked your AP, i.e. U-Boot is telling you to transfer a valid bootloader via ymodem, just extract
-a U-Boot from the vendor OS, send it via ymodem and use the previous operations to perform a full flash this time
-of all partitions.
+ If you hard-bricked your AP, i.e. U-Boot is telling you to transfer a valid bootloader via ymodem, just extract
+ a U-Boot from the vendor OS, send it via ymodem and use the previous operations to perform a full flash this time
+ of all partitions.
-Note that if you erased your MRD partition, you lost your serial and MAC address. There's no way to recover the original one
-except by reading the physical label on your… device!
+ Note that if you erased your MRD partition, you lost your serial and MAC address. There's no way to recover the original one
+ except by reading the physical label on your… device!
-If you super-hard-bricked your AP, i.e. no output on serial console, congratulations, you reached one of the rare state
-of this device. You need an external NAND flasher to repair it and write the first stage from Mediatek to continue the previous
-recovery operations.
+ If you super-hard-bricked your AP, i.e. no output on serial console, congratulations, you reached one of the rare state
+ of this device. You need an external NAND flasher to repair it and write the first stage from Mediatek to continue the previous
+ recovery operations.
-Development TODO list:
+ Development TODO list:
-- Better support for upgrade automation w.r.t. to A/B, e.g. automagic scripts.
-- Mount the logs partition, mount / as overlayfs of firmware ? rootfs and rootfs_data for extended data.
-- Jitter-based entropy injection? Device can be slow to initialize its CRNG and hostapd will reject few clients at the start because of that.
-- Defaults for hostapd based on MT7915 capabilities? See the example for one possible list.
-- Remove primary/secondary hack and put it in preinit.
-- Offer ways to reflash the *bootloader* itself to support direct boot via UBI and kernel upgrades via filesystem rewrite.
+ - Better support for upgrade automation w.r.t. to A/B, e.g. automagic scripts.
+ - Mount the logs partition, mount / as overlayfs of firmware ? rootfs and rootfs_data for extended data.
+ - Jitter-based entropy injection? Device can be slow to initialize its CRNG and hostapd will reject few clients at the start because of that.
+ - Defaults for hostapd based on MT7915 capabilities? See the example for one possible list.
+ - Remove primary/secondary hack and put it in preinit.
+ - Offer ways to reflash the *bootloader* itself to support direct boot via UBI and kernel upgrades via filesystem rewrite.
-Vendor web page: https://www.zyxel.com/fr/fr/products/wireless/ax1800-wifi-6-dual-radio-nebulaflex-access-point-nwa50ax
+ Vendor web page: https://www.zyxel.com/fr/fr/products/wireless/ax1800-wifi-6-dual-radio-nebulaflex-access-point-nwa50ax
-OpenWrt web page: https://openwrt.org/inbox/toh/zyxel/nwa50ax
-OpenWrt tech data: https://openwrt.org/toh/hwdata/zyxel/zyxel_nwa50ax
+ OpenWrt web page: https://openwrt.org/inbox/toh/zyxel/nwa50ax
+ OpenWrt tech data: https://openwrt.org/toh/hwdata/zyxel/zyxel_nwa50ax
'';
@@ -261,110 +261,109 @@ OpenWrt tech data: https://openwrt.org/toh/hwdata/zyxel/zyxel_nwa50ax
extraPatchPhase = ''
${openwrt.applyPatches.ramips}
'';
- config =
- {
-
- RALINK = "y";
- PCI = "y";
- PHY_MT7621_PCI = "y";
- PCIE_MT7621 = "y";
- SOC_MT7621 = "y";
- CLK_MT7621 = "y";
- CLOCKSOURCE_WATCHDOG = "y";
-
- SERIAL_8250_CONSOLE = "y";
- SERIAL_8250 = "y";
- SERIAL_CORE_CONSOLE = "y";
- SERIAL_OF_PLATFORM = "y";
- SERIAL_8250_NR_UARTS = "3";
- SERIAL_8250_RUNTIME_UARTS = "3";
- SERIAL_MCTRL_GPIO = "y";
-
- CONSOLE_LOGLEVEL_DEFAULT = "8";
- CONSOLE_LOGLEVEL_QUIET = "4";
-
- # MTD_UBI_BEB_LIMIT = "20";
- # MTD_UBI_WL_THRESHOLD = "4096";
-
- MTD = "y";
- MTD_BLOCK = "y"; # fix undefined ref to register_mtd_blktrans_dev
- MTD_RAW_NAND = "y";
- MTD_NAND_MT7621 = "y";
- MTD_NAND_MTK_BMT = "y"; # Bad-block Management Table
- MTD_NAND_ECC_SW_HAMMING = "y";
- MTD_SPI_NAND = "y";
- MTD_OF_PARTS = "y";
- MTD_NAND_CORE = "y";
- MTD_SPLIT_FIRMWARE = "y";
- MTD_SPLIT_FIT_FW = "y";
-
- PINCTRL = "y";
- PINCTRL_MT7621 = "y";
-
- I2C = "y";
- I2C_MT7621 = "y";
-
- SPI = "y";
- MTD_SPI_NOR = "y";
- SPI_MT7621 = "y";
- SPI_MASTER = "y";
- SPI_MEM = "y";
-
- REGULATOR = "y";
- REGULATOR_FIXED_VOLTAGE = "y";
- RESET_CONTROLLER = "y";
- POWER_RESET = "y";
- POWER_RESET_GPIO = "y";
- POWER_SUPPLY = "y";
- LED_TRIGGER_PHY = "y";
-
- PCI_DISABLE_COMMON_QUIRKS = "y";
- PCI_DOMAINS = "y";
- PCI_DOMAINS_GENERIC = "y";
- PCI_DRIVERS_GENERIC = "y";
- PCS_MTK_LYNXI = "y";
-
- SOC_BUS = "y";
-
- NET = "y";
- ETHERNET = "y";
- WLAN = "y";
-
- PHYLIB = "y";
- AT803X_PHY = "y";
- FIXED_PHY = "y";
- GENERIC_PHY = "y";
- NET_DSA = "y";
- NET_DSA_MT7530 = "y";
- NET_DSA_MT7530_MDIO = "y";
- NET_DSA_TAG_MTK = "y";
- NET_MEDIATEK_SOC = "y";
- NET_SWITCHDEV = "y";
- NET_VENDOR_MEDIATEK = "y";
-
- SWPHY = "y";
-
- GPIOLIB = "y";
- GPIO_MT7621 = "y";
- OF_GPIO = "y";
-
- EARLY_PRINTK = "y";
-
- NEW_LEDS = "y";
- LEDS_TRIGGERS = "y";
- LEDS_CLASS = "y"; # required by rt2x00lib
- LEDS_CLASS_MULTICOLOR = "y";
- LEDS_BRIGHTNESS_HW_CHANGED = "y";
-
- PRINTK_TIME = "y";
- }
- // lib.optionalAttrs (config.system.service ? vlan) {
- SWCONFIG = "y";
- }
- // lib.optionalAttrs (config.system.service ? watchdog) {
- RALINK_WDT = "y"; # watchdog
- MT7621_WDT = "y"; # or it might be this one
- };
+ config = {
+
+ RALINK = "y";
+ PCI = "y";
+ PHY_MT7621_PCI = "y";
+ PCIE_MT7621 = "y";
+ SOC_MT7621 = "y";
+ CLK_MT7621 = "y";
+ CLOCKSOURCE_WATCHDOG = "y";
+
+ SERIAL_8250_CONSOLE = "y";
+ SERIAL_8250 = "y";
+ SERIAL_CORE_CONSOLE = "y";
+ SERIAL_OF_PLATFORM = "y";
+ SERIAL_8250_NR_UARTS = "3";
+ SERIAL_8250_RUNTIME_UARTS = "3";
+ SERIAL_MCTRL_GPIO = "y";
+
+ CONSOLE_LOGLEVEL_DEFAULT = "8";
+ CONSOLE_LOGLEVEL_QUIET = "4";
+
+ # MTD_UBI_BEB_LIMIT = "20";
+ # MTD_UBI_WL_THRESHOLD = "4096";
+
+ MTD = "y";
+ MTD_BLOCK = "y"; # fix undefined ref to register_mtd_blktrans_dev
+ MTD_RAW_NAND = "y";
+ MTD_NAND_MT7621 = "y";
+ MTD_NAND_MTK_BMT = "y"; # Bad-block Management Table
+ MTD_NAND_ECC_SW_HAMMING = "y";
+ MTD_SPI_NAND = "y";
+ MTD_OF_PARTS = "y";
+ MTD_NAND_CORE = "y";
+ MTD_SPLIT_FIRMWARE = "y";
+ MTD_SPLIT_FIT_FW = "y";
+
+ PINCTRL = "y";
+ PINCTRL_MT7621 = "y";
+
+ I2C = "y";
+ I2C_MT7621 = "y";
+
+ SPI = "y";
+ MTD_SPI_NOR = "y";
+ SPI_MT7621 = "y";
+ SPI_MASTER = "y";
+ SPI_MEM = "y";
+
+ REGULATOR = "y";
+ REGULATOR_FIXED_VOLTAGE = "y";
+ RESET_CONTROLLER = "y";
+ POWER_RESET = "y";
+ POWER_RESET_GPIO = "y";
+ POWER_SUPPLY = "y";
+ LED_TRIGGER_PHY = "y";
+
+ PCI_DISABLE_COMMON_QUIRKS = "y";
+ PCI_DOMAINS = "y";
+ PCI_DOMAINS_GENERIC = "y";
+ PCI_DRIVERS_GENERIC = "y";
+ PCS_MTK_LYNXI = "y";
+
+ SOC_BUS = "y";
+
+ NET = "y";
+ ETHERNET = "y";
+ WLAN = "y";
+
+ PHYLIB = "y";
+ AT803X_PHY = "y";
+ FIXED_PHY = "y";
+ GENERIC_PHY = "y";
+ NET_DSA = "y";
+ NET_DSA_MT7530 = "y";
+ NET_DSA_MT7530_MDIO = "y";
+ NET_DSA_TAG_MTK = "y";
+ NET_MEDIATEK_SOC = "y";
+ NET_SWITCHDEV = "y";
+ NET_VENDOR_MEDIATEK = "y";
+
+ SWPHY = "y";
+
+ GPIOLIB = "y";
+ GPIO_MT7621 = "y";
+ OF_GPIO = "y";
+
+ EARLY_PRINTK = "y";
+
+ NEW_LEDS = "y";
+ LEDS_TRIGGERS = "y";
+ LEDS_CLASS = "y"; # required by rt2x00lib
+ LEDS_CLASS_MULTICOLOR = "y";
+ LEDS_BRIGHTNESS_HW_CHANGED = "y";
+
+ PRINTK_TIME = "y";
+ }
+ // lib.optionalAttrs (config.system.service ? vlan) {
+ SWCONFIG = "y";
+ }
+ // lib.optionalAttrs (config.system.service ? watchdog) {
+ RALINK_WDT = "y"; # watchdog
+ MT7621_WDT = "y"; # or it might be this one
+ };
};
};
}
diff --git a/doc.nix b/doc.nix
@@ -1,4 +1,5 @@
-{ stdenv,
+{
+ stdenv,
lib,
liminix,
gnumake,
@@ -6,7 +7,7 @@
pandoc,
luaPackages,
asciidoctor,
- borderVmConf
+ borderVmConf,
}:
let
json =
@@ -30,13 +31,19 @@ stdenv.mkDerivation {
luaPackages.lyaml
];
- src = lib.sources.sourceFilesBySuffices
- (lib.cleanSource ./. ) [
- ".adoc"
- ".nix" ".rst" "Makefile" ".svg"
- ".fnl" ".py" ".css" ".html"
- ".md" ".html.in"
- ];
+ src = lib.sources.sourceFilesBySuffices (lib.cleanSource ./.) [
+ ".adoc"
+ ".nix"
+ ".rst"
+ "Makefile"
+ ".svg"
+ ".fnl"
+ ".py"
+ ".css"
+ ".html"
+ ".md"
+ ".html.in"
+ ];
buildPhase = ''
cat ${json} | fennel --correlate doc/parse-options.fnl > doc/module-options-generated.inc.rst
diff --git a/doc/hardware.nix b/doc/hardware.nix
@@ -1,18 +1,18 @@
with import <nixpkgs> { };
let
- inherit (builtins) stringLength readDir filter;
+ inherit (builtins) readDir filter;
devices = filter (n: n != "families") (lib.mapAttrsToList (n: t: n) (readDir ../devices));
texts = map (
n:
let
d = import ../devices/${n}/default.nix;
- tag = ".. _${lib.strings.replaceStrings [ " " ] [ "-" ] n}:";
d' = {
description = ''
== ${n}
'';
- } // d;
+ }
+ // d;
in
"\n${d'.description}"
) devices;
diff --git a/examples/arhcive.nix b/examples/arhcive.nix
@@ -14,7 +14,7 @@ let
secrets = import ./extneder-secrets.nix;
inherit (pkgs.liminix.services) oneshot longrun target;
inherit (pkgs.pseudofile) dir symlink;
- inherit (pkgs) writeText serviceFns;
+ inherit (pkgs) writeText;
svc = config.system.service;
in
rec {
diff --git a/examples/demo.nix b/examples/demo.nix
@@ -8,7 +8,6 @@
{ config, pkgs, ... }:
let
inherit (pkgs.liminix.services) bundle oneshot;
- inherit (pkgs) serviceFns;
# EDIT: you can pick your preferred RFC1918 address space
# for NATted connections, if you don't like this one.
ipv4LocalNet = "10.8.0";
diff --git a/examples/recovery.nix b/examples/recovery.nix
@@ -5,7 +5,6 @@
...
}:
let
- inherit (pkgs) serviceFns;
svc = config.system.service;
inherit (pkgs.pseudofile) dir symlink;
inherit (pkgs.liminix.services) oneshot target;
diff --git a/examples/rotuer.nix b/examples/rotuer.nix
@@ -15,7 +15,8 @@ let
secrets = {
domainName = "fake.liminix.org";
firewallRules = { };
- } // (import ./rotuer-secrets.nix);
+ }
+ // (import ./rotuer-secrets.nix);
svc = config.system.service;
wirelessConfig = {
country_code = "GB";
@@ -58,8 +59,7 @@ rec {
start = 10;
end = 240;
hosts =
- { }
- // lib.optionalAttrs (builtins.pathExists ./static-leases.nix) (import ./static-leases.nix);
+ { } // lib.optionalAttrs (builtins.pathExists ./static-leases.nix) (import ./static-leases.nix);
localDomain = "lan";
};
};
@@ -92,7 +92,8 @@ rec {
hw_mode = "g";
channel = "2";
ieee80211n = 1;
- } // wirelessConfig;
+ }
+ // wirelessConfig;
"${secrets.ssid}5" = rec {
interface = config.hardware.networkInterfaces.wlan5;
hw_mode = "a";
@@ -102,7 +103,8 @@ rec {
vht_oper_centr_freq_seg0_idx = channel + 6;
ieee80211n = 1;
ieee80211ac = 1;
- } // wirelessConfig;
+ }
+ // wirelessConfig;
};
};
@@ -151,8 +153,8 @@ rec {
enable = true;
command = ''
${pkgs.s6-networking}/bin/s6-tcpclient 10.0.0.1 9428 ${pkgs.logshippers}/bin/victorialogsend http://loaclhost:9428/insert/jsonline
- '';
- dependencies = [services.qemu-hyp-route];
+ '';
+ dependencies = [ services.qemu-hyp-route ];
};
programs.busybox = {
diff --git a/examples/router-with-l2tp.nix b/examples/router-with-l2tp.nix
@@ -33,10 +33,8 @@ let
address = "194.4.172.12";
};
- inherit (pkgs.liminix.services) oneshot longrun target;
+ inherit (pkgs.liminix.services) oneshot target;
inherit (pkgs.liminix) outputRef;
- inherit (pkgs.pseudofile) dir symlink;
- inherit (pkgs) serviceFns;
svc = config.system.service;
wirelessConfig = {
country_code = "GB";
@@ -110,8 +108,7 @@ rec {
start = 10;
end = 240;
hosts =
- { }
- // lib.optionalAttrs (builtins.pathExists ./static-leases.nix) (import ./static-leases.nix);
+ { } // lib.optionalAttrs (builtins.pathExists ./static-leases.nix) (import ./static-leases.nix);
localDomain = "lan";
};
};
@@ -173,33 +170,31 @@ rec {
};
wireless.networks = {
- "${rsecrets.ssid}" =
- {
- interface = config.hardware.networkInterfaces.wlan;
- hw_mode = "g";
- channel = "6";
- ieee80211n = 1;
- }
- // wirelessConfig
- // {
- wpa_passphrase = outputRef config.services.secrets "wpa_passphrase";
- };
-
- "${rsecrets.ssid}5" =
- rec {
- interface = config.hardware.networkInterfaces.wlan5;
- hw_mode = "a";
- channel = 36;
- ht_capab = "[HT40+]";
- vht_oper_chwidth = 1;
- vht_oper_centr_freq_seg0_idx = channel + 6;
- ieee80211n = 1;
- ieee80211ac = 1;
- }
- // wirelessConfig
- // {
- wpa_passphrase = outputRef config.services.secrets "wpa_passphrase";
- };
+ "${rsecrets.ssid}" = {
+ interface = config.hardware.networkInterfaces.wlan;
+ hw_mode = "g";
+ channel = "6";
+ ieee80211n = 1;
+ }
+ // wirelessConfig
+ // {
+ wpa_passphrase = outputRef config.services.secrets "wpa_passphrase";
+ };
+
+ "${rsecrets.ssid}5" = rec {
+ interface = config.hardware.networkInterfaces.wlan5;
+ hw_mode = "a";
+ channel = 36;
+ ht_capab = "[HT40+]";
+ vht_oper_chwidth = 1;
+ vht_oper_centr_freq_seg0_idx = channel + 6;
+ ieee80211n = 1;
+ ieee80211ac = 1;
+ }
+ // wirelessConfig
+ // {
+ wpa_passphrase = outputRef config.services.secrets "wpa_passphrase";
+ };
};
};
diff --git a/modules/base.nix b/modules/base.nix
@@ -128,7 +128,8 @@ in
"root=${config.hardware.rootDevice}"
"rootfstype=${config.rootfsType}"
"fw_devlink=off"
- ] ++ lib.optional (config.rootOptions != null) "rootflags=${config.rootOptions}";
+ ]
+ ++ lib.optional (config.rootOptions != null) "rootflags=${config.rootOptions}";
system.callService =
path: parameters:
diff --git a/modules/bridge/default.nix b/modules/bridge/default.nix
@@ -44,15 +44,14 @@ in
};
};
};
- config.kernel.config =
- {
- BRIDGE = "y";
- BRIDGE_IGMP_SNOOPING = "y";
- }
- // lib.optionalAttrs (config.system.service ? vlan) {
- # depends on bridge _and_ vlan. I would like there to be
- # a better way to test for the existence of vlan config:
- # maybe the module should set an `enabled` attribute?
- BRIDGE_VLAN_FILTERING = "y";
- };
+ config.kernel.config = {
+ BRIDGE = "y";
+ BRIDGE_IGMP_SNOOPING = "y";
+ }
+ // lib.optionalAttrs (config.system.service ? vlan) {
+ # depends on bridge _and_ vlan. I would like there to be
+ # a better way to test for the existence of vlan config:
+ # maybe the module should set an `enabled` attribute?
+ BRIDGE_VLAN_FILTERING = "y";
+ };
}
diff --git a/modules/dhcp4c/client.nix b/modules/dhcp4c/client.nix
@@ -58,16 +58,21 @@ let
run =
let
script = writeFennel "dhcp-lease-watcher" {
- packages = [ anoia linotify lualinux ];
+ packages = [
+ anoia
+ linotify
+ lualinux
+ ];
mainFunction = "run";
- }
- ./lease-watcher.fnl;
- in ''
+ } ./lease-watcher.fnl;
+ in
+ ''
export PATH=${s6-rc-up-tree}/bin/:$PATH
${script} ${service} ${controlled-name}
'';
};
-in longrun {
+in
+longrun {
name = controlled-name;
run = ''
set -e
diff --git a/modules/firewall/default-rules.nix b/modules/firewall/default-rules.nix
@@ -200,7 +200,7 @@ in
type = "filter";
family = "ip";
- rules = [];
+ rules = [ ];
};
input-ip4 = {
diff --git a/modules/firewall/service.nix b/modules/firewall/service.nix
@@ -25,76 +25,76 @@ let
inherit name family;
type = "ifname";
extraText = ''
- {{;
- local services = { ${concatStringsSep ", " (map toJSON zones.${name})} }
- local ifnames = {}
- for _, v in ipairs(services) do
- local o = output(v, "ifname")
- if o then table.insert(ifnames, o) end
- end
- if (#ifnames > 0) then
- return "elements = { " .. table.concat(ifnames, ", ") .. " }\n"
- else
- return ""
- end
- }}
+ {{;
+ local services = { ${concatStringsSep ", " (map toJSON zones.${name})} }
+ local ifnames = {}
+ for _, v in ipairs(services) do
+ local o = output(v, "ifname")
+ if o then table.insert(ifnames, o) end
+ end
+ if (#ifnames > 0) then
+ return "elements = { " .. table.concat(ifnames, ", ") .. " }\n"
+ else
+ return ""
+ end
+ }}
'';
};
rateHook6 =
- let rules =
- map
- (x: ''
- {{;
- local s = "${x}";
- local n = output(s, "ifname");
- local bw = output(s, "bandwidth");
- if n and bw then
- return "meta l4proto icmpv6 iifname ".. n .. " limit rate over " .. (math.floor (tonumber(bw) / 8 / 20)) .. " bytes/second drop"
- else
- return "# " .. (n or "not n") .. " " .. (bw or "not bw")
- end
- }}
- '')
- (concatLists (builtins.attrValues zones));
- in {
- type = "filter"; family = "ip6";
- hook = "input"; priority = "-1"; policy = "accept";
+ let
+ rules = map (x: ''
+ {{;
+ local s = "${x}";
+ local n = output(s, "ifname");
+ local bw = output(s, "bandwidth");
+ if n and bw then
+ return "meta l4proto icmpv6 iifname ".. n .. " limit rate over " .. (math.floor (tonumber(bw) / 8 / 20)) .. " bytes/second drop"
+ else
+ return "# " .. (n or "not n") .. " " .. (bw or "not bw")
+ end
+ }}
+ '') (concatLists (builtins.attrValues zones));
+ in
+ {
+ type = "filter";
+ family = "ip6";
+ hook = "input";
+ priority = "-1";
+ policy = "accept";
inherit rules;
};
rateHook4 =
- let rules =
- map
- (x: ''
- {{;
- local s = "${x}";
- local n = output(s, "ifname");
- local bw = output(s, "bandwidth");
- if n and bw then
- return "meta l4proto icmp iifname ".. n .. " limit rate over " .. (math.floor (tonumber(bw) / 8 / 20)) .. " bytes/second drop"
- else
- return "# " .. (n or "not n") .. " " .. (bw or "not bw")
- end
- }}
- '')
- (concatLists (builtins.attrValues zones));
- in {
- type = "filter"; family = "ip";
- hook = "input"; priority = "-1"; policy = "accept";
+ let
+ rules = map (x: ''
+ {{;
+ local s = "${x}";
+ local n = output(s, "ifname");
+ local bw = output(s, "bandwidth");
+ if n and bw then
+ return "meta l4proto icmp iifname ".. n .. " limit rate over " .. (math.floor (tonumber(bw) / 8 / 20)) .. " bytes/second drop"
+ else
+ return "# " .. (n or "not n") .. " " .. (bw or "not bw")
+ end
+ }}
+ '') (concatLists (builtins.attrValues zones));
+ in
+ {
+ type = "filter";
+ family = "ip";
+ hook = "input";
+ priority = "-1";
+ policy = "accept";
inherit rules;
};
- sets = (mapAttrs' (n: _: mkSet "ip" n) zones) //
- (mapAttrs' (n: _: mkSet "ip6" n) zones);
- allRules =
- {
- icmp6-ratehook = rateHook6;
- icmp4-ratehook = rateHook4;
- } //
- (lib.recursiveUpdate
- extraRules
- (lib.recursiveUpdate sets rules));
+ sets = (mapAttrs' (n: _: mkSet "ip" n) zones) // (mapAttrs' (n: _: mkSet "ip6" n) zones);
+ allRules = {
+ icmp6-ratehook = rateHook6;
+ icmp4-ratehook = rateHook4;
+ }
+ // (lib.recursiveUpdate extraRules (lib.recursiveUpdate sets rules));
script = firewallgen "firewall1.nft" allRules;
name = "firewall";
service = longrun {
@@ -119,9 +119,9 @@ let
in
svc.secrets.subscriber.build {
action = "usr1";
- watch =
- concatLists
- (mapAttrsToList (_zone : services : map (s: outputRef s "ifname") services) zones);
+ watch = concatLists (
+ mapAttrsToList (_zone: services: map (s: outputRef s "ifname") services) zones
+ );
inherit service;
}
diff --git a/modules/health-check/service.nix b/modules/health-check/service.nix
@@ -11,7 +11,7 @@
healthCheck,
}:
let
- inherit (liminix.services) oneshot longrun;
+ inherit (liminix.services) longrun;
inherit (builtins) toString;
inherit (service) name;
checker =
diff --git a/modules/hostapd/service.nix b/modules/hostapd/service.nix
@@ -9,13 +9,10 @@
{ interface, params }:
let
inherit (liminix.services) longrun;
- inherit (lib) concatStringsSep mapAttrsToList unique;
+ inherit (lib) concatStringsSep mapAttrsToList;
inherit (builtins)
- map
filter
attrValues
- length
- head
typeOf
;
diff --git a/modules/ifwait/ifwait.nix b/modules/ifwait/ifwait.nix
@@ -2,7 +2,7 @@
{
state,
interface,
- service
+ service,
}:
let
inherit (liminix.services) longrun;
diff --git a/modules/logging.nix b/modules/logging.nix
@@ -3,8 +3,6 @@ let
inherit (lib)
mkIf
mkEnableOption
- mkOption
- types
;
in
{
diff --git a/modules/network/default.nix b/modules/network/default.nix
@@ -147,15 +147,18 @@ in
};
dhcp.client =
- lib.warn ''
- system.services.network.dhcp.client is deprecated and will
- be removed in 2026. Use system.service.dhcp4c instead
- ''
- config.system.callService ./dhcpc.nix {
- interface = mkOption {
- type = liminix.lib.types.service;
+ lib.warn
+ ''
+ system.services.network.dhcp.client is deprecated and will
+ be removed in 2026. Use system.service.dhcp4c instead
+ ''
+ config.system.callService
+ ./dhcpc.nix
+ {
+ interface = mkOption {
+ type = liminix.lib.types.service;
+ };
};
- };
};
};
diff --git a/modules/outputs.nix b/modules/outputs.nix
@@ -5,7 +5,7 @@
...
}:
let
- inherit (lib) mkOption types concatStringsSep;
+ inherit (lib) mkOption types;
inherit (pkgs) liminix writeText;
o = config.system.outputs;
in
diff --git a/modules/outputs/boot-extlinux.nix b/modules/outputs/boot-extlinux.nix
@@ -8,8 +8,6 @@ let
inherit (lib)
mkIf
mkEnableOption
- mkOption
- types
concatStringsSep
;
inherit (pkgs.pseudofile) dir symlink;
diff --git a/modules/outputs/boot-fit.nix b/modules/outputs/boot-fit.nix
@@ -8,15 +8,10 @@ let
inherit (lib)
mkIf
mkEnableOption
- mkOption
- types
- concatStringsSep
;
inherit (pkgs.pseudofile) dir symlink;
cfg = config.boot.loader.fit;
o = config.system.outputs;
- cmdline = concatStringsSep " " config.boot.commandLine;
- wantsDtb = config.hardware.dts ? src && config.hardware.dts.src != null;
in
{
options.boot.loader.fit.enable = mkEnableOption "FIT in /boot";
diff --git a/modules/outputs/mtdimage.nix b/modules/outputs/mtdimage.nix
@@ -61,15 +61,14 @@ in
config = {
kernel = {
- config =
- {
- # this needs to be conditional on "not qemu"
- MTD_SPLIT_UIMAGE_FW = "y";
- }
- // lib.optionalAttrs (pkgs.stdenv.isMips) {
- # https://stackoverflow.com/questions/26466470/can-the-logical-erase-block-size-of-an-mtd-device-be-increased
- MTD_SPI_NOR_USE_4K_SECTORS = "n";
- };
+ config = {
+ # this needs to be conditional on "not qemu"
+ MTD_SPLIT_UIMAGE_FW = "y";
+ }
+ // lib.optionalAttrs (pkgs.stdenv.isMips) {
+ # https://stackoverflow.com/questions/26466470/can-the-logical-erase-block-size-of-an-mtd-device-be-increased
+ MTD_SPI_NOR_USE_4K_SECTORS = "n";
+ };
};
programs.busybox.applets = [
diff --git a/modules/outputs/system-configuration.nix b/modules/outputs/system-configuration.nix
@@ -6,12 +6,9 @@
}:
let
inherit (lib)
- mkEnableOption
mkOption
- mkIf
types
;
- inherit (pkgs) runCommand;
in
{
options = {
diff --git a/modules/outputs/ubifs.nix b/modules/outputs/ubifs.nix
@@ -5,7 +5,7 @@
...
}:
let
- inherit (lib) mkIf mkOption types;
+ inherit (lib) mkIf;
o = config.system.outputs;
in
{
diff --git a/modules/outputs/ubimage.nix b/modules/outputs/ubimage.nix
@@ -5,7 +5,7 @@
...
}:
let
- inherit (lib) mkIf mkOption types;
+ inherit (lib) mkOption types;
cfg = config.boot.tftp;
instructions = pkgs.writeText "flash.scr" ''
setenv serverip ${cfg.serverip}
diff --git a/modules/outputs/uimage.nix b/modules/outputs/uimage.nix
@@ -6,7 +6,7 @@
}:
let
inherit (lib) mkOption types concatStringsSep;
- inherit (pkgs) liminix writeText;
+ inherit (pkgs) liminix;
o = config.system.outputs;
in
{
diff --git a/modules/outputs/updater/default.nix b/modules/outputs/updater/default.nix
@@ -5,7 +5,6 @@
...
}:
let
- inherit (lib) mkIf;
o = config.system.outputs;
inherit (pkgs) runCommand;
inherit (lib) mkOption types;
diff --git a/modules/ppp/common.nix b/modules/ppp/common.nix
@@ -22,7 +22,6 @@ let
optional
optionals
escapeShellArgs
- concatStringsSep
;
inherit (liminix.services) longrun;
inherit (builtins) toJSON toString typeOf;
@@ -68,46 +67,45 @@ let
in
o: "{{ ${v o} }}";
- ppp-options' =
- [
- "+ipv6"
- "noauth"
- ]
- ++ optional debug "debug"
- ++ optionals (username != null) [
- "name"
- (literal_or_output username)
- ]
- ++ optionals (password != null) [
- "password"
- (literal_or_output password)
- ]
- ++ optional lcpEcho.adaptive "lcp-echo-adaptive"
- ++ optionals (lcpEcho.interval != null) [
- "lcp-echo-interval"
- (toString lcpEcho.interval)
- ]
- ++ optionals (lcpEcho.failure != null) [
- "lcp-echo-failure"
- (toString lcpEcho.failure)
- ]
- ++ ppp-options
- ++ [
- "ip-up-script"
- ip-up
- "ipv6-up-script"
- ip6-up
- "ipparam"
- name
- "nodetach"
- # usepeerdns requests DNS servers from peer (which is good),
- # then attempts to write them to /nix/store/xxxx/ppp/resolv.conf
- # which causes an unsightly but inconsequential error message
- "usepeerdns"
- "nodefaultroute"
- "logfd"
- "2"
- ];
+ ppp-options' = [
+ "+ipv6"
+ "noauth"
+ ]
+ ++ optional debug "debug"
+ ++ optionals (username != null) [
+ "name"
+ (literal_or_output username)
+ ]
+ ++ optionals (password != null) [
+ "password"
+ (literal_or_output password)
+ ]
+ ++ optional lcpEcho.adaptive "lcp-echo-adaptive"
+ ++ optionals (lcpEcho.interval != null) [
+ "lcp-echo-interval"
+ (toString lcpEcho.interval)
+ ]
+ ++ optionals (lcpEcho.failure != null) [
+ "lcp-echo-failure"
+ (toString lcpEcho.failure)
+ ]
+ ++ ppp-options
+ ++ [
+ "ip-up-script"
+ ip-up
+ "ipv6-up-script"
+ ip6-up
+ "ipparam"
+ name
+ "nodetach"
+ # usepeerdns requests DNS servers from peer (which is good),
+ # then attempts to write them to /nix/store/xxxx/ppp/resolv.conf
+ # which causes an unsightly but inconsequential error message
+ "usepeerdns"
+ "nodefaultroute"
+ "logfd"
+ "2"
+ ];
service = longrun {
inherit name;
run = ''
diff --git a/modules/ppp/default.nix b/modules/ppp/default.nix
@@ -22,13 +22,6 @@
let
inherit (lib) mkOption types;
inherit (pkgs) liminix;
- mkStringOption =
- description:
- mkOption {
- type = types.nullOr types.str;
- default = null;
- inherit description;
- };
in
{
imports = [ ../secrets ];
diff --git a/modules/profiles/gateway.nix b/modules/profiles/gateway.nix
@@ -13,7 +13,7 @@ let
mkIf
types
;
- inherit (pkgs) liminix serviceFns;
+ inherit (pkgs) liminix;
inherit (liminix.services) bundle oneshot;
hostaps =
let
diff --git a/modules/profiles/wap.nix b/modules/profiles/wap.nix
@@ -10,7 +10,6 @@ let
inherit (pkgs.liminix.services) oneshot target;
inherit (pkgs.pseudofile) dir symlink;
- inherit (pkgs) serviceFns;
svc = config.system.service;
cfg = config.profile.wap;
diff --git a/modules/round-robin/default.nix b/modules/round-robin/default.nix
@@ -12,7 +12,6 @@
let
inherit (lib) mkOption types;
inherit (pkgs) liminix;
- inherit (pkgs.liminix.services) longrun;
in
{
options = {
diff --git a/modules/s6/default.nix b/modules/s6/default.nix
@@ -32,10 +32,11 @@ let
logger =
let
- pipecmds =
- [ "${s6}/bin/s6-log -bpd3 -- ${cfg.script} 1" ]
- ++ (lib.optional (cfg ? persistent && cfg.persistent.enable) "/bin/tee /dev/pmsg0")
- ++ (lib.optional cfg.shipping.enable "${pkgs.logtap}/bin/logtap ${fifo} logshipper-socket-event");
+ pipecmds = [
+ "${s6}/bin/s6-log -bpd3 -- ${cfg.script} 1"
+ ]
+ ++ (lib.optional (cfg ? persistent && cfg.persistent.enable) "/bin/tee /dev/pmsg0")
+ ++ (lib.optional cfg.shipping.enable "${pkgs.logtap}/bin/logtap ${fifo} logshipper-socket-event");
in
''
#!${execline}/bin/execlineb -P
@@ -61,12 +62,13 @@ let
flatDeps = s: [ s ] ++ concatMap flatDeps (deps s);
allServices = unique (concatMap flatDeps (builtins.attrValues config.services));
isDependentOnControlled =
- let inherit (lib.lists) any;
- in s:
- isControlled s ||
- (any isDependentOnControlled s.dependencies) ||
- ((s ? contents) &&
- (any isDependentOnControlled s.contents));
+ let
+ inherit (lib.lists) any;
+ in
+ s:
+ isControlled s
+ || (any isDependentOnControlled s.dependencies)
+ || ((s ? contents) && (any isDependentOnControlled s.contents));
# all controlled services depend on this oneshot, which
# makes a list of them so we can identify them at runtime
@@ -88,7 +90,8 @@ let
};
servicesAttrs = {
default = defaultDefaultTarget;
- } // config.services;
+ }
+ // config.services;
in
pkgs.s6-rc-database.override {
services = builtins.attrValues servicesAttrs;
@@ -258,7 +261,7 @@ in
dependencies = mkOption {
description = "services required by the shipping script";
type = types.listOf pkgs.liminix.lib.types.service;
- default = [];
+ default = [ ];
};
};
script = mkOption {
@@ -275,12 +278,13 @@ in
};
config = {
- programs.busybox.applets = mkIf config.logging.shipping.enable [ "mkfifo" ];
+ programs.busybox.applets = mkIf config.logging.shipping.enable [ "mkfifo" ];
services.log-shipper =
let
cfg = config.logging.shipping;
dependencies = config.logging.shipping.dependencies;
- in mkIf cfg.enable (
+ in
+ mkIf cfg.enable (
let
live = longrun {
name = "log-shipper-live";
@@ -297,16 +301,21 @@ in
test -p ${fifoBackfill} || mkfifo ${fifoBackfill}
(cat ${config.logging.directory}/*; sleep 86400) | ${pkgs.logtap}/bin/backfill ${fifoBackfill} ${fifoBackfill}.ts
'';
- dependencies = dependencies ++ [live];
+ dependencies = dependencies ++ [ live ];
};
sink = longrun {
name = "log-shipper-backfill-sink";
run = "${cfg.command} ${fifoBackfill}";
dependencies = dependencies ++ [ source ];
};
- in bundle {
+ in
+ bundle {
name = "log-shipper";
- contents = [live source sink];
+ contents = [
+ live
+ source
+ sink
+ ];
}
);
diff --git a/modules/secrets/default.nix b/modules/secrets/default.nix
@@ -12,7 +12,6 @@
let
inherit (lib) mkOption types;
inherit (pkgs) liminix;
- inherit (pkgs.liminix.services) longrun;
in
{
options.system.service.secrets = {
diff --git a/modules/secrets/outboard.nix b/modules/secrets/outboard.nix
@@ -12,7 +12,7 @@
password,
}:
let
- inherit (liminix.services) oneshot longrun;
+ inherit (liminix.services) longrun;
inherit (lib) optionalString;
in
longrun {
diff --git a/modules/secrets/subscriber.nix b/modules/secrets/subscriber.nix
@@ -5,7 +5,7 @@
s6,
s6-rc,
watch-outputs,
- s6-rc-up-tree
+ s6-rc-up-tree,
}:
{
watch,
@@ -13,13 +13,11 @@
action,
}:
let
- inherit (liminix.services) oneshot longrun;
- inherit (builtins) map length head toString;
- inherit (lib) unique optional optionals concatStringsSep;
+ inherit (liminix.services) longrun;
+ inherit (builtins) map;
+ inherit (lib) optional concatStringsSep;
inherit (service) name;
- watched-services = unique (map (f: f "service") watch);
-
restart-flag =
{
restart = "-r";
@@ -38,8 +36,7 @@ let
watcher =
let
name' = "restart-${name}";
- refs = concatStringsSep " "
- (map (s: "${s "service"}:${s "path"}") watch);
+ refs = concatStringsSep " " (map (s: "${s "service"}:${s "path"}") watch);
in
longrun {
name = name';
@@ -54,8 +51,6 @@ let
};
in
service.overrideAttrs (o: {
- buildInputs = (lim.orEmpty o.buildInputs) ++ optional (watch != []) watcher;
- dependencies =
- (lim.orEmpty o.dependencies)
- ++ optional (watch != []) watcher;
+ buildInputs = (lim.orEmpty o.buildInputs) ++ optional (watch != [ ]) watcher;
+ dependencies = (lim.orEmpty o.dependencies) ++ optional (watch != [ ]) watcher;
})
diff --git a/modules/secrets/tang.nix b/modules/secrets/tang.nix
@@ -12,7 +12,6 @@
}:
let
inherit (liminix.services) longrun;
- inherit (lib) optionalString;
in
longrun {
inherit name;
diff --git a/modules/ssh/ssh.nix b/modules/ssh/ssh.nix
@@ -22,28 +22,27 @@ let
inherit (liminix.services) longrun;
inherit (lib) concatStringsSep mapAttrs mapAttrsToList;
keydir = "/run/${name}/authorized_keys";
- options =
- [
- "-e" # pass environment to child
- "-E" # log to stderr
- "-R" # create hostkeys if needed
- "-P /run/dropbear.pid"
- "-F" # don't fork into background
- ]
- ++ (lib.optional (!allowRoot) "-w")
- ++ (lib.optional (!allowPasswordLogin) "-s")
- ++ (lib.optional (!allowPasswordLoginForRoot) "-g")
- ++ (lib.optional (!allowLocalPortForward) "-j")
- ++ (lib.optional (!allowRemotePortForward) "-k")
- ++ (lib.optional (!allowRemoteConnectionToForwardedPorts) "-a")
- ++ (lib.optionals (authorizedKeys != null) [
- "-U"
- "${keydir}/%n"
- ])
- ++ [
- (if address != null then "-p ${address}:${toString port}" else "-p ${toString port}")
- ]
- ++ [ extraConfig ];
+ options = [
+ "-e" # pass environment to child
+ "-E" # log to stderr
+ "-R" # create hostkeys if needed
+ "-P /run/dropbear.pid"
+ "-F" # don't fork into background
+ ]
+ ++ (lib.optional (!allowRoot) "-w")
+ ++ (lib.optional (!allowPasswordLogin) "-s")
+ ++ (lib.optional (!allowPasswordLoginForRoot) "-g")
+ ++ (lib.optional (!allowLocalPortForward) "-j")
+ ++ (lib.optional (!allowRemotePortForward) "-k")
+ ++ (lib.optional (!allowRemoteConnectionToForwardedPorts) "-a")
+ ++ (lib.optionals (authorizedKeys != null) [
+ "-U"
+ "${keydir}/%n"
+ ])
+ ++ [
+ (if address != null then "-p ${address}:${toString port}" else "-p ${toString port}")
+ ]
+ ++ [ extraConfig ];
isKeyservice = typeOf authorizedKeys == "lambda";
authKeysConcat =
if authorizedKeys != null && !isKeyservice then
diff --git a/modules/tls-certificate/certifix-client.nix b/modules/tls-certificate/certifix-client.nix
@@ -13,7 +13,6 @@
serviceUrl,
}:
let
- inherit (builtins) filter isString split;
inherit (liminix.services) oneshot;
name = "certifix-${lib.strings.sanitizeDerivationName subject}";
caCertFile = writeText "ca.crt" caCertificate;
diff --git a/overlay.nix b/overlay.nix
@@ -20,44 +20,47 @@ let
makeFlags = builtins.filter (x: (builtins.match "(PLAT|MYLIBS).*" x) == null) o.makeFlags;
});
in
- l.override {
- self = l;
- packageOverrides = lua-final: lua-prev:
- let openssl = final.opensslNoThreads;
- in {
- cqueues = lua-prev.cqueues.overrideAttrs(o: {
- externalDeps = [
- {
- name = "CRYPTO";
- dep = openssl;
- }
- {
- name = "OPENSSL";
- dep = openssl;
- }
- ];
- });
- luaossl = lua-prev.luaossl.overrideAttrs(o: {
- externalDeps = [
- {
- name = "CRYPTO";
- dep = openssl;
- }
- {
- name = "OPENSSL";
- dep = openssl;
- }
- ];
- name = "${o.name}-218";
- patches = [
- (fetchpatch {
- url = "https://patch-diff.githubusercontent.com/raw/wahern/luaossl/pull/218.patch";
- hash = "sha256-2GOliY4/RUzOgx3rqee3X3szCdUVxYDut7d+XFcUTJw=";
- })
- ];
- });
- };
- };
+ l.override {
+ self = l;
+ packageOverrides =
+ lua-final: lua-prev:
+ let
+ openssl = final.opensslNoThreads;
+ in
+ {
+ cqueues = lua-prev.cqueues.overrideAttrs (o: {
+ externalDeps = [
+ {
+ name = "CRYPTO";
+ dep = openssl;
+ }
+ {
+ name = "OPENSSL";
+ dep = openssl;
+ }
+ ];
+ });
+ luaossl = lua-prev.luaossl.overrideAttrs (o: {
+ externalDeps = [
+ {
+ name = "CRYPTO";
+ dep = openssl;
+ }
+ {
+ name = "OPENSSL";
+ dep = openssl;
+ }
+ ];
+ name = "${o.name}-218";
+ patches = [
+ (fetchpatch {
+ url = "https://patch-diff.githubusercontent.com/raw/wahern/luaossl/pull/218.patch";
+ hash = "sha256-2GOliY4/RUzOgx3rqee3X3szCdUVxYDut7d+XFcUTJw=";
+ })
+ ];
+ });
+ };
+ };
s6 = prev.s6.overrideAttrs (
o:
@@ -262,7 +265,7 @@ extraPkgs
];
});
- libadwaita = prev.libadwaita.overrideAttrs(o: {
+ libadwaita = prev.libadwaita.overrideAttrs (o: {
# tests fail with a message
# Gdk-DEBUG: error: XDG_RUNTIME_DIR is invalid or not set in the environment.
doCheck = false;
@@ -273,9 +276,9 @@ extraPkgs
mtdutils =
(prev.mtdutils.overrideAttrs (o: {
- src = final.fetchgit {
+ src = final.fetchgit {
url = "git://git.infradead.org/mtd-utils.git";
- rev = "77981a2888c711268b0e7f32af6af159c2288e23";
+ rev = "77981a2888c711268b0e7f32af6af159c2288e23";
hash = "sha256-pHunlPOuvCRyyk9qAiR3Kn3cqS/nZHIxsv6m4nsAcbk=";
};
@@ -301,11 +304,10 @@ extraPkgs
# as a dependency
preConfigure =
let
- arch = if stdenv.hostPlatform.gcc ? arch
- then "-march=${stdenv.hostPlatform.gcc.arch}"
- else "";
- soft = if arch == "-march=24kc" then "-msoft-float" else "";
- in ''
+ arch = if stdenv.hostPlatform.gcc ? arch then "-march=${stdenv.hostPlatform.gcc.arch}" else "";
+ soft = if arch == "-march=24kc" then "-msoft-float" else "";
+ in
+ ''
configureFlagsArray+=(no-threads no-asm CFLAGS="${arch} ${soft}")
'';
# don't need or want this bash script
@@ -328,30 +330,29 @@ extraPkgs
];
buildInputs = o.buildInputs ++ [ final.libslirp ];
});
- overrides =
- {
- hostCpuTargets = map (f: "${f}-softmmu") [
- "arm"
- "aarch64"
- "mips"
- "mipsel"
- ];
- sdlSupport = false;
- numaSupport = false;
- seccompSupport = false;
- usbredirSupport = false;
- libiscsiSupport = false;
- tpmSupport = false;
- uringSupport = false;
- capstoneSupport = false;
- }
- // lib.optionalAttrs (lib.versionOlder lib.version "24.10") {
- texinfo = null;
- nixosTestRunner = true;
- }
- // lib.optionalAttrs (lib.versionAtLeast lib.version "25.04") {
- minimal = true;
- };
+ overrides = {
+ hostCpuTargets = map (f: "${f}-softmmu") [
+ "arm"
+ "aarch64"
+ "mips"
+ "mipsel"
+ ];
+ sdlSupport = false;
+ numaSupport = false;
+ seccompSupport = false;
+ usbredirSupport = false;
+ libiscsiSupport = false;
+ tpmSupport = false;
+ uringSupport = false;
+ capstoneSupport = false;
+ }
+ // lib.optionalAttrs (lib.versionOlder lib.version "24.10") {
+ texinfo = null;
+ nixosTestRunner = true;
+ }
+ // lib.optionalAttrs (lib.versionAtLeast lib.version "25.04") {
+ minimal = true;
+ };
in
q.override overrides;
rsyncSmall =
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -64,7 +64,7 @@ in
lib = {
types =
let
- inherit (lib) mkOption types isDerivation;
+ inherit (lib) types isDerivation;
in
rec {
service = types.package // {
@@ -97,7 +97,7 @@ in
devout = callPackage ./devout { };
fetch-freebsd = callPackage ./fetch-freebsd { };
fennel = callPackage ./fennel { };
- fennelc = callPackage ./fennelc { };
+ fennelc = callPackage ./fennelc { };
fennelrepl = callPackage ./fennelrepl { };
firewallgen = callPackage ./firewallgen { };
firmware-utils = callPackage ./firmware-utils { };
diff --git a/pkgs/fennelc/default.nix b/pkgs/fennelc/default.nix
@@ -1,19 +1,22 @@
{
lua,
- runCommand
+ runCommand,
}:
-let fennel = lua.pkgs.fennel; in
+let
+ fennel = lua.pkgs.fennel;
+in
runCommand "build-fennelc"
-{
- nativeBuildInputs = [ fennel ] ;
-} ''
-LUAPATH=$(ls -d ${fennel}/share/lua/*)
-mkdir -p $out/bin
-(
-exec > $out/bin/fennelc
-echo '#! ${lua}/bin/lua'
-echo "package.path = \"''${LUAPATH}/?.lua;''${LLPATH}/?.lua;\" .. package.path"
-fennel --compile ${./fennelc.fnl}
-)
-chmod +x $out/bin/fennelc
-''
+ {
+ nativeBuildInputs = [ fennel ];
+ }
+ ''
+ LUAPATH=$(ls -d ${fennel}/share/lua/*)
+ mkdir -p $out/bin
+ (
+ exec > $out/bin/fennelc
+ echo '#! ${lua}/bin/lua'
+ echo "package.path = \"''${LUAPATH}/?.lua;''${LLPATH}/?.lua;\" .. package.path"
+ fennel --compile ${./fennelc.fnl}
+ )
+ chmod +x $out/bin/fennelc
+ ''
diff --git a/pkgs/firewallgen/default.nix b/pkgs/firewallgen/default.nix
@@ -14,7 +14,13 @@ let
;
inherit (lib.lists) groupBy;
inherit (lib.attrsets) attrsToList mapAttrsToList;
- inherit (builtins) elemAt map head tail toString;
+ inherit (builtins)
+ elemAt
+ map
+ head
+ tail
+ toString
+ ;
indentLines =
offset: lines:
@@ -63,7 +69,12 @@ let
''
set ${name} {
type ${type}
- ${if elements != [ ] then "elements = { ${concatStringsSep ", " (builtins.trace elements elements)} }" else ""}
+ ${
+ if elements != [ ] then
+ "elements = { ${concatStringsSep ", " (builtins.trace elements elements)} }"
+ else
+ ""
+ }
${optionalString (extraText != null) extraText}
}
'';
@@ -76,16 +87,26 @@ let
extraText ? null,
...
}:
- let
- colonize = v:
- let ty = elemAt (attrsToList v) 0; in "${ty.name}: ${ty.value}";
- in ''
- map ${name} {
- type ${colonize type}
- ${if elements != [ ] then "elements = { ${concatStringsSep ", " (mapAttrsToList (k: v : "${k}: ${toString v}") elements)} }" else ""}
- ${optionalString (extraText != null) extraText}
+ let
+ colonize =
+ v:
+ let
+ ty = elemAt (attrsToList v) 0;
+ in
+ "${ty.name}: ${ty.value}";
+ in
+ ''
+ map ${name} {
+ type ${colonize type}
+ ${
+ if elements != [ ] then
+ "elements = { ${concatStringsSep ", " (mapAttrsToList (k: v: "${k}: ${toString v}") elements)} }"
+ else
+ ""
}
- '';
+ ${optionalString (extraText != null) extraText}
+ }
+ '';
dochainorset =
{
diff --git a/pkgs/firewallgen/test-rules-min.nix b/pkgs/firewallgen/test-rules-min.nix
@@ -157,11 +157,13 @@ in
name = "intf-limits";
kind = "map";
family = "ip6";
- type = { ifname = "bytes"; };
+ type = {
+ ifname = "bytes";
+ };
elements = {
# XXX keys need to be generated from interface outputs
- ppp0 = builtins.floor (70*1000*1000 * 0.05); # 5% of 70MB fttp connection
- lan = builtins.floor (1000*1000*1000 * 0.05); # GB ethernet
+ ppp0 = builtins.floor (70 * 1000 * 1000 * 0.05); # 5% of 70MB fttp connection
+ lan = builtins.floor (1000 * 1000 * 1000 * 0.05); # GB ethernet
};
};
diff --git a/pkgs/kernel/default.nix b/pkgs/kernel/default.nix
@@ -21,18 +21,19 @@ stdenv.mkDerivation rec {
name = "kernel";
inherit src extraPatchPhase;
hardeningDisable = [ "all" ];
- nativeBuildInputs =
- [ buildPackages.stdenv.cc ]
- ++ (with buildPackages.pkgs; [
- rsync
- bc
- bison
- flex
- pkg-config
- openssl
- ncurses.all
- perl
- ]);
+ nativeBuildInputs = [
+ buildPackages.stdenv.cc
+ ]
+ ++ (with buildPackages.pkgs; [
+ rsync
+ bc
+ bison
+ flex
+ pkg-config
+ openssl
+ ncurses.all
+ perl
+ ]);
CC = "${stdenv.cc.bintools.targetPrefix}gcc";
HOSTCC = with buildPackages.pkgs; "gcc -I${openssl}/include -I${ncurses}/include";
HOST_EXTRACFLAGS =
@@ -50,7 +51,8 @@ stdenv.mkDerivation rec {
"headers"
"modulesupport"
"config"
- ] ++ targetNames;
+ ]
+ ++ targetNames;
phases = [
"unpackPhase"
"butcherPkgconfig"
@@ -66,7 +68,8 @@ stdenv.mkDerivation rec {
patches = [
./cmdline-cookie.patch
./mips-malta-fdt-from-bootloader.patch
- ] ++ lib.optional (lib.versionOlder version "5.18.0") ./phram-allow-cached-mappings.patch;
+ ]
+ ++ lib.optional (lib.versionOlder version "5.18.0") ./phram-allow-cached-mappings.patch;
# this is here to work around what I think is a bug in nixpkgs
# packaging of ncurses: it installs pkg-config data files which
diff --git a/pkgs/liminix-tools/services/default.nix b/pkgs/liminix-tools/services/default.nix
@@ -40,7 +40,7 @@ let
buildInputs ? [ ],
restart-on-upgrade ? false,
controller ? null,
- properties ? {}
+ properties ? { },
}:
stdenvNoCC.mkDerivation {
# we use stdenvNoCC to avoid generating derivations with names
@@ -59,12 +59,14 @@ let
timeout-up
timeout-down
restart-on-upgrade
- ;
+ ;
propertiesText =
- let a = mapAttrsRecursive
- (path: value: "writepath ${concatStringsSep "/" path} ${builtins.toString value}\n")
- properties;
- in collect builtins.isString a;
+ let
+ a = mapAttrsRecursive (
+ path: value: "writepath ${concatStringsSep "/" path} ${builtins.toString value}\n"
+ ) properties;
+ in
+ collect builtins.isString a;
buildInputs =
buildInputs ++ dependencies ++ contents ++ lib.optional (controller != null) controller;
diff --git a/pkgs/logshippers/default.nix b/pkgs/logshippers/default.nix
@@ -11,9 +11,14 @@
}:
let
name = "logshippers";
- luafy = name : source :
+ luafy =
+ name: source:
writeFennel name {
- packages = [ anoia lualinux fennel ];
+ packages = [
+ anoia
+ lualinux
+ fennel
+ ];
macros = [ anoia.dev ];
mainFunction = "run";
} source;
diff --git a/pkgs/logtap/default.nix b/pkgs/logtap/default.nix
@@ -3,12 +3,16 @@
fennelc,
lualinux,
lua,
- anoia
+ anoia,
}:
stdenv.mkDerivation {
name = "logtap";
nativeBuildInputs = [ fennelc ];
- buildInputs = [ lua lualinux anoia ];
+ buildInputs = [
+ lua
+ lualinux
+ anoia
+ ];
makeFlags = [ "PREFIX=${placeholder "out"}" ];
src = ./.;
}
diff --git a/pkgs/mac80211/default.nix b/pkgs/mac80211/default.nix
@@ -110,18 +110,19 @@ let
inherit src;
hardeningDisable = [ "all" ];
- nativeBuildInputs =
- [ buildPackages.stdenv.cc ]
- ++ (with buildPackages.pkgs; [
- bc
- bison
- flex
- pkg-config
- openssl
- which
- kmod
- cpio
- ]);
+ nativeBuildInputs = [
+ buildPackages.stdenv.cc
+ ]
+ ++ (with buildPackages.pkgs; [
+ bc
+ bison
+ flex
+ pkg-config
+ openssl
+ which
+ kmod
+ cpio
+ ]);
inherit CC CROSS_COMPILE;
ARCH = arch;
dontStrip = true;
@@ -185,7 +186,8 @@ let
let
c = {
module = d;
- } // configs.${d};
+ }
+ // configs.${d};
in
c.module
) drivers
diff --git a/pkgs/output-template/default.nix b/pkgs/output-template/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
src = ./.;
buildInputs = [ lua ];
- nativeBuildInputs = [ fennelrepl ] ;
+ nativeBuildInputs = [ fennelrepl ];
buildPhase = ''
fennelrepl --test ./output-template.fnl
cp -p ${
diff --git a/pkgs/watch-outputs/default.nix b/pkgs/watch-outputs/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
src = ./.;
buildInputs = [ lua ];
- nativeBuildInputs = [ fennelrepl ] ;
+ nativeBuildInputs = [ fennelrepl ];
buildPhase = ''
fennelrepl --test ./watch-outputs.fnl
diff --git a/tests/min-copy-closure/test.nix b/tests/min-copy-closure/test.nix
@@ -5,7 +5,6 @@ let
liminix-config = ./configuration.nix;
}
);
- rogue = lmx.pkgs.rogue;
myPkg = lmx.pkgs.rsyncSmall;
img = lmx.outputs.vmroot;
pkgs = import <nixpkgs> { overlays = [ (import ../../overlay.nix) ]; };
diff --git a/tests/pppoe/configuration.nix b/tests/pppoe/configuration.nix
@@ -47,5 +47,8 @@ rec {
domain = "fake.liminix.org";
};
- defaultProfile.packages = with pkgs; [ nftables hello ];
+ defaultProfile.packages = with pkgs; [
+ nftables
+ hello
+ ];
}