Skip to content

Commit

Permalink
config: replace passthru={...} with passthru=args
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Dec 17, 2024
1 parent b6c0f41 commit ed7614c
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 27 deletions.
4 changes: 2 additions & 2 deletions builders/cptBuilder/1.profiling.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
, intervals
, simulator
, profiling_log
}:
}@args:
let
name = "${lib.removeSuffix ".gcpt" img.name}.1_profiling";

Expand Down Expand Up @@ -36,7 +36,7 @@ let
];

in runCommand name {
passthru = { inherit qemu nemu img; };
passthru = args;
} ''
mkdir -p $out
Expand Down
4 changes: 2 additions & 2 deletions builders/cptBuilder/2.cluster.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
, maxK
, simpoint
, stage1-profiling
}: runCommand "${lib.removeSuffix ".1_profiling" stage1-profiling.name}.2_cluster" {
passthru = { inherit simpoint stage1-profiling; };
}@args: runCommand "${lib.removeSuffix ".1_profiling" stage1-profiling.name}.2_cluster" {
passthru = args;
} (''
mkdir -p $out
'' + (builtins.toString [
Expand Down
4 changes: 2 additions & 2 deletions builders/cptBuilder/3.checkpoint.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
, checkpoint_format
, simulator
, checkpoint_log
}:
}@args:
let
qemuCommand = [
"${qemu}/bin/qemu-system-riscv64"
Expand All @@ -36,7 +36,7 @@ let
];

in runCommand "${lib.removeSuffix ".2_cluster" stage2-cluster.name}.3_checkpoint" {
passthru = { inherit qemu nemu img stage2-cluster; };
passthru = args;
} ''
mkdir -p $out
Expand Down
4 changes: 2 additions & 2 deletions builders/imgBuilder/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{ gcpt }: gcpt.overrideAttrs (old: {
passthru = { inherit gcpt; };
{ gcpt }@args: gcpt.overrideAttrs (old: {
passthru = args;
})
4 changes: 2 additions & 2 deletions builders/imgBuilder/gcpt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
, riscv64-cc
, rmExt
, opensbi
}: stdenv.mkDerivation {
}@args: stdenv.mkDerivation {
name = "${rmExt opensbi.name}.gcpt";

src = fetchFromGitHub {
Expand All @@ -29,5 +29,5 @@
installPhase = ''
cp build/gcpt.bin $out
'';
passthru = { inherit opensbi; };
passthru = args;
}
4 changes: 2 additions & 2 deletions builders/imgBuilder/linux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
, initramfs
# TODO: use overlayfs to reduce disk usage
, common-build
}: stdenv.mkDerivation {
}@args: stdenv.mkDerivation {
name = "${rmExt initramfs.name}.linux";
src = common-build;
buildInputs = [
Expand All @@ -35,5 +35,5 @@
installPhase = ''
cp arch/riscv/boot/Image $out
'';
passthru = { inherit initramfs common-build; };
passthru = args;
}
6 changes: 2 additions & 4 deletions builders/imgBuilder/linux/initramfs/base/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, runCommand

, gen_init_cpio
}:
}@args:
let
name = "init.cpio";
cpio_list = writeText "cpio_list" ''
Expand All @@ -28,9 +28,7 @@ let
nod /dev/null 644 0 0 c 1 3
'';
in runCommand name {
passthru = {
inherit cpio_list gen_init_cpio;
};
passthru = args // { inherit cpio_list; };
} ''
mkdir -p $out
${gen_init_cpio}/bin/gen_init_cpio -t 0 ${cpio_list} > $out/${name}
Expand Down
6 changes: 2 additions & 4 deletions builders/imgBuilder/linux/initramfs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
, benchmark
, base
, overlays
}: let
}@args: let
cpioPatched = cpio.overrideAttrs (old: { patches = [./cpio_reset_timestamp.patch]; });
in runCommand "${benchmark.name}.cpio" {
passthru = {
inherit base overlays;
};
passthru = args // { inherit cpioPatched; };
} ''
cp ${base}/init.cpio $out
chmod +w $out
Expand Down
7 changes: 2 additions & 5 deletions builders/imgBuilder/linux/initramfs/overlays/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
, nemu_trap
, trapCommand
, benchmark-run
}:
}@args:
let
name = "initramfs-overlays";
riscv64-busybox = riscv64-pkgs.busybox.override {
Expand All @@ -26,10 +26,7 @@ let
${trapCommand}
'';
in runCommand name {
passthru = {
inherit before_workload qemu_trap nemu_trap;
inherit inittab run_sh;
};
passthru = args // { inherit inittab run_sh; };
} ''
mkdir -p $out/bin
cp ${riscv64-busybox}/bin/busybox $out/bin/
Expand Down
4 changes: 2 additions & 2 deletions builders/imgBuilder/opensbi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
, linux
, dts
, common-build
}: stdenv.mkDerivation {
}@args: stdenv.mkDerivation {
name = "${rmExt linux.name}.opensbi";

src = common-build;
Expand Down Expand Up @@ -57,5 +57,5 @@
installPhase = ''
cp build/platform/generic/firmware/fw_payload.bin $out
'';
passthru = { inherit linux dts common-build; };
passthru = args;
}

0 comments on commit ed7614c

Please sign in to comment.