Rename cfg option from "enable" --> "replace"

- Allows for @qzed's kernel patch: 22ef83836c
This commit is contained in:
mexisme 2021-03-06 15:29:13 +13:00
parent 128b64dada
commit 98d19435d0
4 changed files with 17 additions and 12 deletions

View file

@ -15,7 +15,7 @@ The kernel-specific derivations are under the `kernel/` sub-directory.
In order to simplify maintenance of the Nix code, only the most-recent kernel patch-set is expected In order to simplify maintenance of the Nix code, only the most-recent kernel patch-set is expected
to be maintained in this repo. to be maintained in this repo.
_*NOTE:*_Some built-in Kernel config items need to be set, that aren't set by default: _*NOTE:*_ Some built-in Kernel config items need to be set, that aren't set by default:
- https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing - https://github.com/linux-surface/surface-aggregator-module/wiki/Testing-and-Installing
## Firmware, Drivers and Support Tools ## Firmware, Drivers and Support Tools
@ -65,15 +65,19 @@ The most effective fix to-date is to remove the `board-2.bin` file or replace it
`board.bin` file. `board.bin` file.
The derivative in `firmware/surface-go/ath10k/` can configure this, if you set the option The derivative in `firmware/surface-go/ath10k/` can configure this, if you set the option
`config.hardware.microsoft-surface.firmware.surface-go-ath10k.enable` to `true`. `config.hardware.microsoft-surface.firmware.surface-go-ath10k.replace` to `true`.
Note that this is slightly destructive, as it deletes all the `board.bin` and `board-2.bin` files _*NOTE:*_ This is destructive, as it deletes all the `board.bin` and `board-2.bin` files for the
for the `ath10k` QCA6174 device, and replaces them with KillerNetworking's version. `ath10k` QCA6174 device, and replaces them with KillerNetworking's version.
This is the only way (currently) to force the driver to use the new firmware. This is the only way (currently) to force the driver to use the new firmware.
For more details, see: https://github.com/linux-surface/linux-surface/wiki/Surface-Go#wifi-firmware For more details, see: https://github.com/linux-surface/linux-surface/wiki/Surface-Go#wifi-firmware
There was an attempt to get this firmware incorporated into the aggregate `board-2.bin`, _*NOTE:*_ There's some work to patch the kernel to make it easier to override which firmware file
to use for QCA6174, which would obviate this more-destructuve approach:
- https://github.com/linux-surface/kernel/commit/22ef83836c4aa89e9eb98de9b47ed24b6c2a1d45
_*NOTE:*_ There was an attempt to get this firmware incorporated into the aggregate `board-2.bin`,
but (as of this writing) the request appears to have been ignored: but (as of this writing) the request appears to have been ignored:
- https://github.com/linux-surface/linux-surface/issues/41 - https://github.com/linux-surface/linux-surface/issues/41

View file

@ -14,15 +14,16 @@
- [X] Install the binaries - [X] Install the binaries
** DONE Remove `ipts` firmware derivative ** DONE Remove `ipts` firmware derivative
- This is only needed on the 4.19 kernel - This is only needed on the 4.19 kernel
** DOING Investigate problem with ath10k wifi firmware on Surface Go ** DONE Investigate problem with ath10k wifi firmware on Surface Go
:LOGBOOK: :LOGBOOK:
- State "DOING" from "TODO" [2021-02-09 Tue 17:19] - State "DOING" from "TODO" [2021-02-09 Tue 17:19]
- State "DONE" from "DOING" [2021-03-06 Sat 15:27]
:END: :END:
*** DONE README entry explaining problem(s) with nonfree firmware on Surface Go *** DONE README entry explaining problem(s) with nonfree firmware on Surface Go
:LOGBOOK: :LOGBOOK:
- State "DONE" from "TODO" [2021-02-09 Tue 17:17] - State "DONE" from "TODO" [2021-02-09 Tue 17:17]
:END: :END:
*** DOING Create derivative for `ath10k` firmware on Surface Go *** DONE Create derivative for `ath10k` firmware on Surface Go
:LOGBOOK: :LOGBOOK:
- State "DOING" from "TODO" [2021-02-09 Tue 17:18] - State "DOING" from "TODO" [2021-02-09 Tue 17:18]
:END: :END:
@ -31,8 +32,8 @@
- [X] Download `board.bin` from Killer Networks? - [X] Download `board.bin` from Killer Networks?
- [X] Install ath10k firmware fix for Surface Go - [X] Install ath10k firmware fix for Surface Go
- `board-2.bin` needs to be removed / replaced with `board.bin` - `board-2.bin` needs to be removed / replaced with `board.bin`
- [ ] Add a config option for enabling the Surface Go Firmware - [X] Add a config option for enabling the Surface Go Firmware
- [ ] Replace the vendorised `board.bin` with a `fetchurl` - [-] Replace the vendorised `board.bin` with a `fetchurl`
- Getting HTTP 406 when using `fetchurl` or `nix-prefetch-url` that has to be diagnosed - Getting HTTP 406 when using `fetchurl` or `nix-prefetch-url` that has to be diagnosed
* Support Tools * Support Tools
** TODO Incorporate @hpfr's function(s) from this commit: ** TODO Incorporate @hpfr's function(s) from this commit:

View file

@ -5,14 +5,14 @@ in
{ {
options = { options = {
hardware.microsoft-surface.firmware.surface-go-ath10k = { hardware.microsoft-surface.firmware.surface-go-ath10k = {
enable = lib.mkEnableOption ''Use the "board.bin" firmware for ath10k-based WiFi on Surface Go.''; replace = lib.mkEnableOption ''Use the "board.bin" firmware for ath10k-based WiFi on Surface Go.'';
}; };
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.replace {
hardware.enableAllFirmware = true; hardware.enableAllFirmware = true;
hardware.firmware = [ hardware.firmware = [
(pkgs.callPackage ./ath10k.nix {}) (pkgs.callPackage ./ath10k-replace.nix {})
]; ];
boot.extraModprobeConfig = lib.mkDefault '' boot.extraModprobeConfig = lib.mkDefault ''