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"; type = "app";
program = "${drv}/bin/nova-image"; program = "${drv}/bin/nova-image";
function = attrs: bootDesc: function = attrs: bootDesc:
nixpkgs.runCommand "nova-iso" attrs nixpkgs.runCommand "image.elf" attrs
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-image "${bootDesc}" > $out''; ''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-image "${bootDesc}" > $out'';
}; };

View File

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