commit f8a275d1a31f7fd9cb716c70d44f24f203a313ee
parent 0ee9c76c333cd59d5fd664b6a2a3d3a6a454a861
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:
9 files changed, 14 insertions(+), 40 deletions(-)
diff --git a/devices/belkin-rt3200/default.nix b/devices/belkin-rt3200/default.nix
@@ -79,11 +79,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
@@ -161,12 +161,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