Skip to content

Commit

Permalink
[nix] replace streamLayeredImage to buildImage
Browse files Browse the repository at this point in the history
Proot have too many bugs to be fixed, it is better to use qemu to build
the docker image.

Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin committed May 27, 2024
1 parent c44bc92 commit cabbb15
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions nix/t1/release/docker-layers.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{ lib
# build deps
, dockerTools
, buildEnv
, runCommand
, runtimeShell

# Runtime deps
, bashInteractive
Expand All @@ -17,24 +19,27 @@
}:

let
# Don't use buildImage which relies on KVM feature
self = dockerTools.streamLayeredImage {
# dockerTools.buildImage relies on KVM feature, don't run it inside VMs
self = dockerTools.buildImage rec {
name = "chipsalliance/t1-${configName}";
tag = "latest";

contents = with dockerTools; [
usrBinEnv
binSh
copyToRoot = buildEnv {
name = "${name}.imageroot";
paths = with dockerTools; [
usrBinEnv
binSh

bashInteractive
which
bashInteractive
which

emulator-wrapped
]
++ rv32-stdenv.initialPath;
emulator-wrapped
] ++ rv32-stdenv.initialPath;
pathsToLink = [ "/bin" ];
};

enableFakechroot = true;
fakeRootCommands = ''
runAsRoot = ''
#!${runtimeShell}
echo "Start finalizing rootfs"
echo "Creating testcase directory"
Expand All @@ -53,14 +58,6 @@ let
# Cmd = [ ];
WorkingDir = "/workspace";
};

passthru = {
final-image = runCommand "convert-layer-to-final-image" { } ''
mkdir $out
${bashInteractive}/bin/bash ${self} > $out/image.tar
'';
};
};
in
self

0 comments on commit cabbb15

Please sign in to comment.