mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
nixos/etc: fix using etc overlay on cross-compiled systems
We need to run tooling from the build platform when generating the EROFS.
This commit is contained in:
parent
3664857c48
commit
560cd874a3
@ -64,14 +64,6 @@ let
|
|||||||
|
|
||||||
etcHardlinks = filter (f: f.mode != "symlink" && f.mode != "direct-symlink") etc';
|
etcHardlinks = filter (f: f.mode != "symlink" && f.mode != "direct-symlink") etc';
|
||||||
|
|
||||||
build-composefs-dump = pkgs.buildPackages.runCommand "build-composefs-dump.py"
|
|
||||||
{
|
|
||||||
buildInputs = [ pkgs.buildPackages.python3 ];
|
|
||||||
} ''
|
|
||||||
install ${./build-composefs-dump.py} $out
|
|
||||||
patchShebangs --host $out
|
|
||||||
'';
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -295,10 +287,12 @@ in
|
|||||||
system.build.etcMetadataImage =
|
system.build.etcMetadataImage =
|
||||||
let
|
let
|
||||||
etcJson = pkgs.writeText "etc-json" (builtins.toJSON etc');
|
etcJson = pkgs.writeText "etc-json" (builtins.toJSON etc');
|
||||||
etcDump = pkgs.runCommand "etc-dump" { } "${build-composefs-dump} ${etcJson} > $out";
|
etcDump = pkgs.runCommand "etc-dump" { } ''
|
||||||
|
${lib.getExe pkgs.buildPackages.python3} ${./build-composefs-dump.py} ${etcJson} > $out
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
pkgs.runCommand "etc-metadata.erofs" {
|
pkgs.runCommand "etc-metadata.erofs" {
|
||||||
nativeBuildInputs = [ pkgs.composefs pkgs.erofs-utils ];
|
nativeBuildInputs = with pkgs.buildPackages; [ composefs erofs-utils ];
|
||||||
} ''
|
} ''
|
||||||
mkcomposefs --from-file ${etcDump} $out
|
mkcomposefs --from-file ${etcDump} $out
|
||||||
fsck.erofs $out
|
fsck.erofs $out
|
||||||
|
Loading…
Reference in New Issue
Block a user