2
0
Fork 0
Browse Source

Place binaries into $out directories rather than simply as $out

absolute-needed
Emery Hemingway 2 years ago
parent
commit
ba2d96d419
  1. 7
      lib/default.nix
  2. 2
      packages/bender/default.nix
  3. 4
      tests/default.nix
  4. 6
      tests/driver-hw.nix
  5. 6
      tests/driver-nova.nix
  6. 4
      tests/sotest_hw_config.dhall
  7. 8
      tests/sotest_nova_config.dhall

7
lib/default.nix

@ -88,11 +88,12 @@ in rec {
dhall to-directory-tree --output bootstrap \
<<< "${./compile-boot.dhall} ${bootstrapDhall} \"bootstrap\""
mkdir -p $out
build_core \
"${testPkgs.base-hw-pc.bootstrapObj}" \
bootstrap/modules_asm \
0x00200000 \
$out
$out/image.elf
'';
};
@ -102,6 +103,8 @@ in rec {
build = compileBoot name env boot;
buildCommand = ''
mkdir -p $out
# compile the boot modules into one object file
$CC -c -x assembler -o "boot_modules.o" "$build/modules_asm"
@ -113,7 +116,7 @@ in rec {
-z max-page-size=0x1000 \
-Ttext=0x100000 -gc-sections \
"${testPkgs.base-nova.coreObj}" boot_modules.o \
-o $out
-o $out/image.elf
'';
};

2
packages/bender/default.nix

@ -19,5 +19,5 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
cmakeFlags = [ "-DVERSION=${version}" ];
installPhase = "install standalone/bender $out";
installPhase = "install -Dt $out standalone/bender";
}

4
tests/default.nix

@ -79,10 +79,10 @@ listToAttrs ((concatLists (map (testsToList) [ linux hw nova ]))) // {
name = "sotest";
buildCommand = ''
mkdir zip; cd zip
cp "${testPkgs.bender}" bender
cp "${testPkgs.bender}/bender" bender
cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
${concatStringsSep "\n"
(map (test: "cp ${test.image} ${test.image.name}") allTests)}
(map (test: "cp ${test.image}/image.elf ${test.image.name}") allTests)}
mkdir -p $out/nix-support
${buildPackages.zip}/bin/zip "$out/binaries.zip" *
cat << EOF > "$out/project.json"

6
tests/driver-hw.nix

@ -90,12 +90,12 @@ let
global env
global spawn_id
set TEST_MIB [expr (([file size ${image}] + $env(TEST_RAM)) >> 20) + 24]
set TEST_MIB [expr (([file size ${image}/image.elf] + $env(TEST_RAM)) >> 20) + 24]
spawn ${buildPackages.qemu_test}/bin/qemu-system-x86_64 \
-machine q35 -serial mon:stdio -nographic \
-m size=$TEST_MIB \
-kernel "${testPkgs.bender}" \
-initrd "${image}" \
-kernel "${testPkgs.bender}/bender" \
-initrd "${image}/image.elf" \
${toString qemuArgs}
wait_for_output $wait_for_re $timeout_value $spawn_id
}

6
tests/driver-nova.nix

@ -91,13 +91,13 @@ let
global env
global spawn_id
set TEST_MIB [expr (([file size ${image}] + $env(TEST_RAM)) >> 20) + 24]
set TEST_MIB [expr (([file size ${image}/image.elf] + $env(TEST_RAM)) >> 20) + 24]
spawn ${buildPackages.qemu_test}/bin/qemu-system-x86_64 \
-machine q35 -cpu phenom -smp 2 \
-serial mon:stdio -nographic \
-m size=$TEST_MIB \
-kernel "${testPkgs.bender}" \
-initrd "${testPkgs.NOVA}/hypervisor-x86_64 arg=iommu novpid serial,${image}" \
-kernel "${testPkgs.bender}/bender" \
-initrd "${testPkgs.NOVA}/hypervisor-x86_64 arg=iommu novpid serial,${image}/image.elf" \
${toString qemuArgs}
wait_for_output $wait_for_re $timeout_value $spawn_id
}

4
tests/sotest_hw_config.dhall

@ -1,4 +0,0 @@
{ boot_items =
[ { exec = "bender", load = [ "image.elf" ], name = "Genode base-hw" } ]
, extra_dependencies = [ { name = "bender", url = "https://sotest.io/bender" } ]
}

8
tests/sotest_nova_config.dhall

@ -1,8 +0,0 @@
{ boot_items =
[ { exec = "bender"
, load = [ "hypervisor serial novga iommu", "image.elf" ]
, name = "NOVA with Genode"
}
]
, extra_dependencies = [ { name = "bender", url = "https://sotest.io/bender" } ]
}
Loading…
Cancel
Save