Skip to content

Commit

Permalink
misc: add passthru, thus every nodes in workflow can be accessed by n…
Browse files Browse the repository at this point in the history
…ix commands
  • Loading branch information
xieby1 committed Nov 15, 2024
1 parent 68e6586 commit 5b09a3b
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 13 deletions.
3 changes: 2 additions & 1 deletion builders/cptBuilder/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{ callPackage

, gcpt
, imgBuilder
}: let
# TODO: move folders to cptBuilder/
qemu = callPackage ./qemu {};
nemu = callPackage ./nemu {};
gcpt = imgBuilder.gcpt;
stage1-profiling = callPackage ./1.profiling.nix {
inherit qemu nemu gcpt;
};
Expand Down
8 changes: 5 additions & 3 deletions builders/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

, benchmark
}: let
gcpt = callPackage ./imgBuilder { inherit benchmark; };
checkpoints = callPackage ./cptBuilder { inherit gcpt; };
in checkpoints
imgBuilder = callPackage ./imgBuilder { inherit benchmark; };
cptBuilder = callPackage ./cptBuilder { inherit imgBuilder; };
in cptBuilder.overrideAttrs (old: {
passthru = { inherit imgBuilder cptBuilder; };
})
7 changes: 1 addition & 6 deletions builders/imgBuilder/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{ callPackage
, riscv64-cc
, riscv64-libc-static

, benchmark
}: let
gcpt = callPackage ./gcpt { inherit benchmark; };
# TODO: not passthru here, in gcpt
in gcpt.overrideAttrs (old: {
passthru = {
inherit riscv64-cc riscv64-libc-static benchmark;
};
passthru = { inherit gcpt; };
})
1 change: 1 addition & 0 deletions builders/imgBuilder/gcpt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ in stdenv.mkDerivation {
installPhase = ''
cp build/gcpt.bin $out
'';
passthru = { inherit opensbi; };
}
1 change: 1 addition & 0 deletions builders/imgBuilder/linux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ in stdenv.mkDerivation {
installPhase = ''
cp arch/riscv/boot/Image $out
'';
passthru = { inherit initramfs common-build; };
}
4 changes: 3 additions & 1 deletion builders/imgBuilder/linux/initramfs/base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ let
nod /dev/null 644 0 0 c 1 3
'';
gen_init_cpio = callPackage ./gen_init_cpio {};
in runCommand name {} ''
in runCommand name {
inherit cpio_list gen_init_cpio;
} ''
mkdir -p $out
${gen_init_cpio}/bin/gen_init_cpio -t 0 ${cpio_list} > $out/${name}
''
4 changes: 3 additions & 1 deletion builders/imgBuilder/linux/initramfs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
# TODO: check if `run` doest not exist, throw an error
benchmark-run = benchmark.run;
};
in runCommand "${benchmark.name}.cpio" {} ''
in runCommand "${benchmark.name}.cpio" {
inherit base overlays;
} ''
cp ${base}/init.cpio $out
chmod +w $out
cd ${benchmark}
Expand Down
5 changes: 4 additions & 1 deletion builders/imgBuilder/linux/initramfs/overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ let
echo exit
${trapCommand}
'';
in runCommand name {} ''
in runCommand name {
inherit before_workload qemu_trap nemu_trap;
inherit inittab run_sh;
} ''
mkdir -p $out/bin
cp ${riscv64-busybox}/bin/busybox $out/bin/
ln -s /bin/busybox $out/init
Expand Down
1 change: 1 addition & 0 deletions builders/imgBuilder/opensbi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ in stdenv.mkDerivation {
installPhase = ''
cp build/platform/generic/firmware/fw_payload.bin $out
'';
passthru = { inherit linux dts common-build; };
}

0 comments on commit 5b09a3b

Please sign in to comment.