2
0
Fork 0

Boot Qemu with -kernel, skip ISO

This commit is contained in:
Ehmry - 2020-02-05 12:11:44 +01:00
parent 6052822283
commit 1744edee2e
2 changed files with 10 additions and 12 deletions

View File

@ -30,7 +30,7 @@ rec {
type = "app";
program = "${drv}/bin/nova-image";
function = attrs: bootDesc:
nixpkgs.runCommand "nova-iso" attrs
nixpkgs.runCommand "image.elf" attrs
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-image "${bootDesc}" > $out'';
};

View File

@ -49,7 +49,7 @@ let
MANIFEST = manifest;
} // env;
iso = apps.nova-iso.function env'
image = apps.nova-image.function env'
"${./driver-nova-config.dhall} ${testConfig}";
baseSetup = ''
@ -93,17 +93,14 @@ let
spawn ${hostPkgs.qemu_test}/bin/qemu-system-x86_64 \
-machine q35 -serial mon:stdio -nographic \
-m size=${toString qemuMem} \
-cdrom ${iso}
-kernel "${testPkgs.bender}" \
-initrd "${testPkgs.NOVA}/hypervisor-x86_64 arg=iommu novpid serial,${image}"
wait_for_output $wait_for_re $timeout_value $spawn_id
}
# TODO: not in TCL
global env
set out $env(out)
set fd [open "$out/nix-support/hydra-build-products" w]
puts $fd "file iso ${iso}"
close $fd
'';
driver = with hostPkgs;
@ -129,7 +126,7 @@ let
test = passMeta (runTests driver);
in test // {
inherit driver iso test manifest;
inherit driver image test manifest;
config = hostPkgs.runCommand (name + ".dhall") env' ''
export XDG_CACHE_HOME=''${TMPDIR:-/tmp}
@ -137,17 +134,18 @@ let
"(${./driver-nova-config.dhall} ${testConfig})" > $out
'';
iso = apps.nova-iso.function env'
"(${./driver-nova-config.dhall} ${testConfig})";
xml = hostPkgs.runCommand (name + ".config") env' ''
export XDG_CACHE_HOME=''${TMPDIR:-/tmp}
${apps.render-init.program} \
"(${./driver-nova-config.dhall} ${testConfig}).config" > $out'';
sotest = hostPkgs.runCommand "nova-${name}-sotest" env' ''
export XDG_CACHE_HOME=''${TMPDIR:-/tmp}
${apps.nova-image.program} \
"${./driver-nova-config.dhall} ${testConfig}" > image.elf
cp "${testPkgs.bender}" bender
cp "${testPkgs.NOVA}/hypervisor-x86_64" hypervisor
cp ${image} image.elf
mkdir -p $out/nix-support
${hostPkgs.zip}/bin/zip "$out/binaries.zip" \
bender hypervisor image.elf
@ -169,6 +167,6 @@ in {
isNova = true;
};
pkgs = testPkgs;
inherit depot;
inherit depot hostPkgs;
} // args));
}