Merge pull request #53991 from arianvp/fix-initrd
build-support/make-initrd: Don't derive derivation name from file name
This commit is contained in:
commit
f29b88df44
@ -16,10 +16,16 @@
|
|||||||
, name ? "initrd"
|
, name ? "initrd"
|
||||||
, compressor ? "gzip -9n"
|
, compressor ? "gzip -9n"
|
||||||
, prepend ? []
|
, prepend ? []
|
||||||
|
, lib
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
# !!! Move this into a public lib function, it is probably useful for others
|
||||||
|
toValidStoreName = x: with builtins;
|
||||||
|
lib.concatStringsSep "-" (filter (x: !(isList x)) (split "[^a-zA-Z0-9_=.?-]+" x));
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
inherit name;
|
inherit name;
|
||||||
|
|
||||||
builder = ./make-initrd.sh;
|
builder = ./make-initrd.sh;
|
||||||
|
|
||||||
makeUInitrd = stdenv.hostPlatform.platform.kernelTarget == "uImage";
|
makeUInitrd = stdenv.hostPlatform.platform.kernelTarget == "uImage";
|
||||||
@ -36,8 +42,12 @@ stdenv.mkDerivation rec {
|
|||||||
# Note: we don't use closureInfo yet, as that won't build with nix-1.x.
|
# Note: we don't use closureInfo yet, as that won't build with nix-1.x.
|
||||||
# See #36268.
|
# See #36268.
|
||||||
exportReferencesGraph =
|
exportReferencesGraph =
|
||||||
map (x: [("closure-" + baseNameOf x.symlink) x.object]) contents;
|
lib.zipListsWith
|
||||||
|
(x: i: [("closure-${toValidStoreName (baseNameOf x.symlink)}-${toString i}") x.object])
|
||||||
|
contents
|
||||||
|
(lib.range 0 (lib.length contents - 1));
|
||||||
pathsFromGraph = ./paths-from-graph.pl;
|
pathsFromGraph = ./paths-from-graph.pl;
|
||||||
|
|
||||||
inherit compressor prepend;
|
inherit compressor prepend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user