Skip to content

Commit 177716b

Browse files
committed
module: Add support for separate Kmods
1 parent 2743018 commit 177716b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

builder/module-config.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ let
77
variant = config.hardware.subtarget;
88
packagesArch = config.hardware.arch;
99
feedsSha256 = config.feedsHash;
10+
kmodsSha256 = config.kmodsHash;
1011
sha256 = config.sumsFileHash;
1112
}) variantFiles profiles expandDeps corePackages packagesByFeed allPackages;
1213

builder/module-options.nix

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ let
44
latestRelease = import ../latest-release.nix;
55

66
releaseHashesFile = ../hashes/${config.release}.nix;
7-
releaseHashes =
7+
releaseHashes =
88
if (builtins.pathExists releaseHashesFile)
99
then import releaseHashesFile
1010
else builtins.throw "No hashed information found about OpenWRT ${config.release}";
1111
hashedTarget = releaseHashes.targets.${config.hardware.target}.${config.hardware.subtarget} or
1212
(builtins.throw "No hashed information for OpenWRT ${config.release} found for ${config.hardware.target}/${config.hardware.subtarget}");
1313
hashedFeeds = releaseHashes.packages.${config.hardware.arch} or
1414
(builtins.throw "No hashed information for OpenWRT ${config.release} about packages found for ${config.hardware.arch} architecture");
15+
kmodsFeeds =
16+
if (lib.versionAtLeast config.release "24")
17+
then releaseHashes.kmods.${config.hardware.target}.${config.hardware.subtarget} or
18+
(builtins.throw "No hashed information for OpenWRT ${config.release} about Kmods found for ${config.hardware.target}/${config.hardware.subtarget}")
19+
else { };
1520

1621
defaultSumsFileHash = hashedTarget.sha256;
1722

@@ -235,6 +240,25 @@ in
235240
'';
236241
};
237242

243+
kmodsHash = lib.mkOption {
244+
type = lib.types.attrsOf lib.types.raw;
245+
default = kmodsFeeds;
246+
example = lib.options.literalExpression ''
247+
{
248+
"6.6.67-1-a19d0a45cee591b95352ac365f8a784b".sha256 = "sha256-23n2qV9PDubOeGEf43i29o+qL5B9ZU4wQOYoanfPFSQ=";
249+
"6.6.67-1-316f788de839e861f7fea23702a4776b".sha256 = "sha256-cM1S2NLATkxL3TzPzkCD1fEe36xf5C7sF4TPVPDIBGc=";
250+
}
251+
'';
252+
internal = true;
253+
description = ''
254+
A "feed", where each key is a kernel version and each value is a `sha256` sum of `Packages`.
255+
256+
:::{.warning}
257+
Must be created per target + subtarget combination.
258+
:::
259+
'';
260+
};
261+
238262
build = {
239263
extraDerivationArgs = lib.mkOption {
240264
type = lib.types.raw;

0 commit comments

Comments
 (0)