mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
nixos/initrd: add extraFirmwarePaths option (#391166)
This commit is contained in:
commit
b15e9e7d3d
5 changed files with 23 additions and 2 deletions
|
@ -19,6 +19,7 @@ let
|
|||
kernel = config.system.modulesTree;
|
||||
firmware = config.hardware.firmware;
|
||||
allowMissing = false;
|
||||
inherit (config.boot.initrd) extraFirmwarePaths;
|
||||
};
|
||||
|
||||
|
||||
|
@ -484,6 +485,14 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
boot.initrd.extraFirmwarePaths = mkOption {
|
||||
default = [ ];
|
||||
type = types.listOf types.str;
|
||||
description = ''
|
||||
Other firmware files (relative to `"''${config.hardware.firmware}/lib/firmware"`) to include in the final initrd we are building.
|
||||
'';
|
||||
};
|
||||
|
||||
boot.initrd.checkJournalingFS = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
|
|
|
@ -105,6 +105,7 @@ let
|
|||
kernel = config.system.modulesTree;
|
||||
firmware = config.hardware.firmware;
|
||||
allowMissing = false;
|
||||
inherit (config.boot.initrd) extraFirmwarePaths;
|
||||
};
|
||||
|
||||
initrdBinEnv = pkgs.buildEnv {
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
rootModules,
|
||||
kmod,
|
||||
allowMissing ? false,
|
||||
extraFirmwarePaths ? [ ],
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation {
|
||||
|
@ -25,6 +26,7 @@ stdenvNoCC.mkDerivation {
|
|||
firmware
|
||||
rootModules
|
||||
allowMissing
|
||||
extraFirmwarePaths
|
||||
;
|
||||
allowedReferences = [ "out" ];
|
||||
}
|
||||
|
|
|
@ -87,6 +87,15 @@ for module in $(< ~-/closure); do
|
|||
done || :
|
||||
done
|
||||
|
||||
for path in $extraFirmwarePaths; do
|
||||
mkdir -p $(dirname $out/lib/firmware/$path)
|
||||
for name in "$path" "$path.xz" "$path.zst" ""; do
|
||||
if cp -v --parents --no-preserve=mode lib/firmware/$name "$out" 2>/dev/null; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if test -e lib/firmware/edid ; then
|
||||
echo "lib/firmware/edid found, copying."
|
||||
mkdir -p "$out/lib/firmware"
|
||||
|
|
|
@ -709,9 +709,9 @@ with pkgs;
|
|||
|
||||
compressFirmwareZstd = callPackage ../build-support/kernel/compress-firmware.nix { type = "zstd"; };
|
||||
|
||||
makeModulesClosure = { kernel, firmware, rootModules, allowMissing ? false }:
|
||||
makeModulesClosure = { kernel, firmware, rootModules, allowMissing ? false, extraFirmwarePaths ? [ ] }:
|
||||
callPackage ../build-support/kernel/modules-closure.nix {
|
||||
inherit kernel firmware rootModules allowMissing;
|
||||
inherit kernel firmware rootModules allowMissing extraFirmwarePaths;
|
||||
};
|
||||
|
||||
mkBinaryCache = callPackage ../build-support/binary-cache { };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue