From c12a03b8511f4742123959f0cb3c96a441ac2581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 19 Aug 2022 23:59:13 +0200 Subject: Improve kernel support and hostapd --- nixos/modules/hostapd.nix | 2 +- nixos/modules/turris-defaults.nix | 17 ----------------- nixos/modules/turris-mox-support.nix | 29 +++++++++++++++++++++++++++++ nixos/modules/turris-omnia-support.nix | 28 ++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 nixos/modules/turris-mox-support.nix create mode 100644 nixos/modules/turris-omnia-support.nix (limited to 'nixos/modules') diff --git a/nixos/modules/hostapd.nix b/nixos/modules/hostapd.nix index de3035b..0dd5d23 100644 --- a/nixos/modules/hostapd.nix +++ b/nixos/modules/hostapd.nix @@ -448,6 +448,7 @@ let interface=${iface} driver=${icfg.driver} + use_driver_iface_addr=1 hw_mode=${icfg.hwMode} channel=${toString icfg.channel} country_code=${icfg.countryCode} @@ -477,7 +478,6 @@ let ${concatMapStringsSep "\n" (bss: '' bss=${bss} - use_driver_iface_addr=1 ${configBss icfg.bss."${bss}"}'') (attrNames icfg.bss)} ${icfg.extraConfig} diff --git a/nixos/modules/turris-defaults.nix b/nixos/modules/turris-defaults.nix index f79b8c4..bba3d18 100644 --- a/nixos/modules/turris-defaults.nix +++ b/nixos/modules/turris-defaults.nix @@ -33,23 +33,10 @@ in { # Use early print to the serial console boot.kernelParams = [ "boot.shell_on_fail" - ] ++ optionals (config.turris.board == "mox") [ - "earlycon=ar3700_uart,0xd0012000" "console=ttyMV0,115200" - "pcie_aspm=off" # Fix for crashes due to SError Interrupt on ath10k load - ] ++ optionals (config.turris.board == "omnia") [ - "earlyprintk" "console=ttyS0,115200" ]; # Use the latest kernel boot.kernelPackages = mkDefault pkgs.linuxPackages_latest; - boot.kernelPatches = mkIf (config.turris.board == "omnia") [{ - name = "omnia"; - patch = null; - extraConfig = '' - LEDS_CLASS_MULTICOLOR y - LEDS_TURRIS_OMNIA y - ''; - }]; # The supported deployment is on BTRFS boot.supportedFilesystems = [ "btrfs" ]; @@ -78,10 +65,6 @@ in { # The additional administration packages environment.systemPackages = with pkgs; [ htop - ] ++ optionals (config.turris.board == "mox") [ - #mox-otp - ] ++ optionals (config.turris.board == "omnia") [ - libatsha204 ]; # No need for installer tools in standard system diff --git a/nixos/modules/turris-mox-support.nix b/nixos/modules/turris-mox-support.nix new file mode 100644 index 0000000..9596b15 --- /dev/null +++ b/nixos/modules/turris-mox-support.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + + config = mkIf (config.turris.board == "mox") { + # Use early print to the serial console + boot.kernelParams = [ + "earlycon=ar3700_uart,0xd0012000" "console=ttyMV0,115200" + "pcie_aspm=off" # Fix for crashes due to SError Interrupt on ath10k load + ]; + # Custom kernel config + boot.kernelPatches = [{ + name = "rwtm"; + patch = null; + extraConfig = '' + TURRIS_MOX_RWTM y + ARMADA_37XX_RWTM_MBOX y + ''; + }]; + + # The additional administration packages + environment.systemPackages = with pkgs; [ + #mox-otp + ]; + + }; +} diff --git a/nixos/modules/turris-omnia-support.nix b/nixos/modules/turris-omnia-support.nix new file mode 100644 index 0000000..b68affc --- /dev/null +++ b/nixos/modules/turris-omnia-support.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + + config = mkIf (config.turris.board == "omnia") { + # Use early print to the serial console + boot.kernelParams = [ + "earlyprintk" "console=ttyS0,115200" + ]; + # Custom kernel config + boot.kernelPatches = [{ + name = "omnia"; + patch = null; + extraConfig = '' + LEDS_CLASS_MULTICOLOR y + LEDS_TURRIS_OMNIA y + ''; + }]; + + # The additional administration packages + environment.systemPackages = with pkgs; [ + libatsha204 + ]; + + }; +} -- cgit v1.2.3