liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 1ff779c1a91a8d5c01f3924085f0c66c2c683d9e
parent ac8b971cc0dcb4846405ed782a2a8c39fd3d9e32
Author: Arnout Engelen <arnout@bzzt.net>
Date:   Tue, 17 Dec 2024 20:24:14 +0100

use Linux kernel sources associated with openwrt by default

Diffstat:
Mdevices/belkin-rt3200/default.nix | 5-----
Mdevices/families/qemu.nix | 5-----
Mdevices/gl-ar750/default.nix | 6------
Mdevices/gl-mt300a/default.nix | 5-----
Mdevices/gl-mt300n-v2/default.nix | 5-----
Mdevices/tp-archer-ax23/default.nix | 5-----
Mdevices/zyxel-nwa50ax/default.nix | 6------
Mmodules/kernel/default.nix | 6+++---
Mpkgs/openwrt/default.nix | 11+++++++++++
9 files changed, 14 insertions(+), 40 deletions(-)

diff --git a/devices/belkin-rt3200/default.nix b/devices/belkin-rt3200/default.nix @@ -55,11 +55,6 @@ ]; config = { kernel = { - src = pkgs.pkgsBuildBuild.fetchurl { - name = "linux.tar.gz"; - url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz"; - hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ="; - }; extraPatchPhase = '' ${pkgs.openwrt.applyPatches.mediatek} ''; diff --git a/devices/families/qemu.nix b/devices/families/qemu.nix @@ -5,11 +5,6 @@ ]; config = { kernel = { - src = pkgs.pkgsBuildBuild.fetchurl { - name = "linux.tar.gz"; - url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz"; - hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ="; - }; config = { MTD = "y"; MTD_BLOCK = "y"; diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix @@ -157,12 +157,6 @@ appendDTB = true; }; kernel = { - src = pkgs.pkgsBuildBuild.fetchurl { - name = "linux.tar.gz"; - url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz"; - hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ="; - }; - # Mainline linux 5.19 doesn't have device-tree support for # this device or even for the SoC, so we use the extensive # OpenWrt kernel patches diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix @@ -114,11 +114,6 @@ }; kernel = { - src = pkgs.fetchurl { - name = "linux.tar.gz"; - url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz"; - hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ="; - }; extraPatchPhase = '' ${openwrt.applyPatches.ramips} ${openwrt.applyPatches.rt2x00} diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix @@ -125,11 +125,6 @@ }; kernel = { - src = pkgs.fetchurl { - name = "linux.tar.gz"; - url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz"; - hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ="; - }; extraPatchPhase = '' ${openwrt.applyPatches.ramips} ''; diff --git a/devices/tp-archer-ax23/default.nix b/devices/tp-archer-ax23/default.nix @@ -50,11 +50,6 @@ ]; config = { kernel = { - src = pkgs.pkgsBuildBuild.fetchurl { - name = "linux.tar.gz"; - url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz"; - hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ="; - }; extraPatchPhase = '' ${pkgs.openwrt.applyPatches.ramips} ''; diff --git a/devices/zyxel-nwa50ax/default.nix b/devices/zyxel-nwa50ax/default.nix @@ -250,14 +250,8 @@ # IMAGE/ramboot-factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi kernel = { - src = pkgs.fetchurl { - name = "linux.tar.gz"; - url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz"; - hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ="; - }; extraPatchPhase = '' ${openwrt.applyPatches.ramips} - ''; config = { diff --git a/modules/kernel/default.nix b/modules/kernel/default.nix @@ -6,7 +6,7 @@ { lib, pkgs, config, ...}: let inherit (lib) mkOption types ; - inherit (pkgs) liminix; + inherit (pkgs) liminix openwrt; mergeConditionals = conf : conditions : # for each key in conditions, if it is present in conf @@ -21,8 +21,8 @@ let in { options = { kernel = { - src = mkOption { type = types.path; } ; - version = mkOption { type = types.str; default = "5.15.137";} ; + src = mkOption { type = types.path; default = openwrt.kernelSrc; } ; + version = mkOption { type = types.str; default = openwrt.kernelVersion;} ; modular = mkOption { type = types.bool; default = true; diff --git a/pkgs/openwrt/default.nix b/pkgs/openwrt/default.nix @@ -29,6 +29,17 @@ let ''; in { inherit src; + + # The kernel sources typically used with this version of openwrt + # You can find this in `include/kernel-5.15` or similar in the + # openwrt sources + kernelSrc = pkgsBuildBuild.fetchurl { + name = "linux.tar.gz"; + url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz"; + hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ="; + }; + kernelVersion = "5.15.137"; + applyPatches.ath79 = doPatch "ath79"; applyPatches.ramips = doPatch "ramips"; applyPatches.mediatek = doPatch "mediatek"; # aarch64