Skip to content

Commit 0775044

Browse files
brianmcgilliondanielfullmer
authored andcommitted
fix unused module errors
NixOS/nixpkgs#366004 introduced a change that warns and errors out when modules are defined and not acutally set for a particular target. This patch rectifies that by going back the the previous method of ignoring those errors and not breaking the build. Commentary is left inline to explain the situation and possible future solutions. tested against orin agx target for ghaf. there are similar solutions being deployed in nixpkgs to work around this e.g. NixOS/nixpkgs#375165 Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
1 parent c434043 commit 0775044

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

kernel/default.nix

+17
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ buildLinux (args // {
1616

1717
defconfig = "tegra_defconfig";
1818

19+
# https://github.com/NixOS/nixpkgs/pull/366004
20+
# introduced a breaking change that if a module is declared but it is not being used it will fail
21+
# if you try to suppress each of he errors e.g.
22+
# REISERFS_FS_SECURITY = lib.mkForce unset; within structuredExtraConfig
23+
# that list runs to a long 100+ modules so we go back to the previous default and ignore them
24+
ignoreConfigErrors = true;
25+
26+
# disabling the dependency on the common-config would seem appropriate as we define our own defconfig
27+
# however, it seems that some of the settings for e.g. fw loading are only made available there.
28+
# TODO: a future task could be to set this, disable ignoreConfigErrors and add the needed modules to the
29+
# structuredExtraConfig below.
30+
#enableCommonConfig = false;
31+
1932
# Using applyPatches here since it's not obvious how to append an extra
2033
# postPatch. This is not very efficient.
2134
src = applyPatches {
@@ -102,6 +115,10 @@ buildLinux (args // {
102115

103116
### So nat.service and firewall work ###
104117
NF_TABLES = module; # This one should probably be in common-config.nix
118+
# this NFT_NAT is not actually being set. when build with enableCommonConfig = false;
119+
# and not ignoreConfigErrors = true; it will fail with error about unused option
120+
# unused means that it wanted to set it as a module, but make oldconfig didn't ask it about that option,
121+
# so it didn't get a chance to set it.
105122
NFT_NAT = module;
106123
NFT_MASQ = module;
107124
NFT_REJECT = module;

0 commit comments

Comments
 (0)