Add aarch64 platform
Add the hw-virt_qemu platform to tests, rename hw to hw-pc.
This commit is contained in:
parent
3f646b6fa6
commit
559f4aa3c0
|
@ -1,6 +1,6 @@
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
{ self, nixpkgs, nixpkgsLocal, packages }:
|
{ system, self, nixpkgs, nixpkgsLocal, packages }:
|
||||||
|
|
||||||
let
|
let
|
||||||
dhallApps = let
|
dhallApps = let
|
||||||
|
@ -68,6 +68,18 @@ in dhallApps // {
|
||||||
program = "${drv}/bin/generate-manifest";
|
program = "${drv}/bin/generate-manifest";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
render-init = let
|
||||||
|
drv = import ./render-init {
|
||||||
|
apps = self;
|
||||||
|
inherit nixpkgs packages;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
type = "app";
|
||||||
|
program = "${drv}/bin/render-init";
|
||||||
|
};
|
||||||
|
|
||||||
|
} // (if system == "x86_64-genode" then {
|
||||||
|
|
||||||
hw-image = let
|
hw-image = let
|
||||||
drv = import ./hw-image {
|
drv = import ./hw-image {
|
||||||
stdenv = packages.stdenv;
|
stdenv = packages.stdenv;
|
||||||
|
@ -82,17 +94,6 @@ in dhallApps // {
|
||||||
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/hw-image "${bootDesc}" > $out'';
|
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/hw-image "${bootDesc}" > $out'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nova-image = let
|
|
||||||
drv = import ./nova-image {
|
|
||||||
stdenv = packages.stdenv;
|
|
||||||
apps = self;
|
|
||||||
inherit nixpkgs packages;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
type = "app";
|
|
||||||
program = "${drv}/bin/nova-image";
|
|
||||||
};
|
|
||||||
|
|
||||||
hw-iso = let
|
hw-iso = let
|
||||||
drv = import ./hw-iso {
|
drv = import ./hw-iso {
|
||||||
stdenv = packages.stdenv;
|
stdenv = packages.stdenv;
|
||||||
|
@ -107,6 +108,17 @@ in dhallApps // {
|
||||||
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/hw-iso "${bootDesc}" > $out'';
|
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/hw-iso "${bootDesc}" > $out'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nova-image = let
|
||||||
|
drv = import ./nova-image {
|
||||||
|
stdenv = packages.stdenv;
|
||||||
|
apps = self;
|
||||||
|
inherit nixpkgs packages;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
type = "app";
|
||||||
|
program = "${drv}/bin/nova-image";
|
||||||
|
};
|
||||||
|
|
||||||
nova-iso = let
|
nova-iso = let
|
||||||
drv = import ./nova-iso {
|
drv = import ./nova-iso {
|
||||||
stdenv = packages.stdenv;
|
stdenv = packages.stdenv;
|
||||||
|
@ -121,14 +133,5 @@ in dhallApps // {
|
||||||
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-iso "${bootDesc}" > $out'';
|
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-iso "${bootDesc}" > $out'';
|
||||||
};
|
};
|
||||||
|
|
||||||
render-init = let
|
} else
|
||||||
drv = import ./render-init {
|
{ })
|
||||||
apps = self;
|
|
||||||
inherit nixpkgs packages;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
type = "app";
|
|
||||||
program = "${drv}/bin/render-init";
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ nixpkgs.writeScriptBin "hw-iso" (with nixpkgs.buildPackages;
|
||||||
out="hw.iso"
|
out="hw.iso"
|
||||||
|
|
||||||
# build ISO layout
|
# build ISO layout
|
||||||
cp ${packages.NOVA}/hypervisor* boot/hypervisor
|
|
||||||
cp ${./isolinux.cfg} boot/syslinux/isolinux.cfg
|
cp ${./isolinux.cfg} boot/syslinux/isolinux.cfg
|
||||||
cp \
|
cp \
|
||||||
$SYSLINUX/isolinux.bin \
|
$SYSLINUX/isolinux.bin \
|
||||||
|
|
12
flake.nix
12
flake.nix
|
@ -10,7 +10,7 @@
|
||||||
outputs = { self, nixpkgs }:
|
outputs = { self, nixpkgs }:
|
||||||
let
|
let
|
||||||
localSystems = [ "x86_64-linux" ];
|
localSystems = [ "x86_64-linux" ];
|
||||||
crossSystems = [ "x86_64-genode" ];
|
crossSystems = [ "aarch64-genode" "x86_64-genode" ];
|
||||||
|
|
||||||
forAllLocalSystems = f:
|
forAllLocalSystems = f:
|
||||||
nixpkgs.lib.genAttrs localSystems (system: f system);
|
nixpkgs.lib.genAttrs localSystems (system: f system);
|
||||||
|
@ -70,6 +70,7 @@
|
||||||
# pass thru Nixpkgs
|
# pass thru Nixpkgs
|
||||||
|
|
||||||
packages = forAllCrossSystems ({ system, localSystem, crossSystem }:
|
packages = forAllCrossSystems ({ system, localSystem, crossSystem }:
|
||||||
|
nixpkgs.lib.filterAttrs (n: v: v != null)
|
||||||
nixpkgsFor.${system}.genodePackages);
|
nixpkgsFor.${system}.genodePackages);
|
||||||
|
|
||||||
devShell = forAllLocalSystems (system:
|
devShell = forAllLocalSystems (system:
|
||||||
|
@ -87,6 +88,7 @@
|
||||||
glibc.dev
|
glibc.dev
|
||||||
gnumake
|
gnumake
|
||||||
libxml2
|
libxml2
|
||||||
|
qemu
|
||||||
tcl
|
tcl
|
||||||
which
|
which
|
||||||
xorriso
|
xorriso
|
||||||
|
@ -109,6 +111,7 @@
|
||||||
apps = let
|
apps = let
|
||||||
apps' = forAllCrossSystems ({ system, localSystem, crossSystem }:
|
apps' = forAllCrossSystems ({ system, localSystem, crossSystem }:
|
||||||
import ./apps {
|
import ./apps {
|
||||||
|
system = crossSystem;
|
||||||
self = self.apps.${system};
|
self = self.apps.${system};
|
||||||
nixpkgs = nixpkgsFor.${system};
|
nixpkgs = nixpkgsFor.${system};
|
||||||
nixpkgsLocal = nixpkgsFor.${localSystem};
|
nixpkgsLocal = nixpkgsFor.${localSystem};
|
||||||
|
@ -121,12 +124,15 @@
|
||||||
import ./tests {
|
import ./tests {
|
||||||
inherit self;
|
inherit self;
|
||||||
apps = self.apps.${system};
|
apps = self.apps.${system};
|
||||||
buildPackages = nixpkgsFor.${localSystem};
|
localPackages = nixpkgsFor.${localSystem};
|
||||||
genodepkgs = self.packages.${system};
|
genodepkgs = self.packages.${system};
|
||||||
lib = self.lib.${system};
|
lib = self.lib.${system};
|
||||||
nixpkgs = nixpkgsFor.${system};
|
nixpkgs = nixpkgsFor.${system};
|
||||||
legacyPackages = self.legacyPackages.${system};
|
legacyPackages = self.legacyPackages.${system};
|
||||||
});
|
});
|
||||||
in { x86_64-linux = checks'.x86_64-linux-x86_64-genode; };
|
in checks' // {
|
||||||
|
x86_64-linux = with builtins;
|
||||||
|
foldl' (x: y: x // y) { } (attrValues checks');
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ in rec {
|
||||||
> $out/config.dhall.bin
|
> $out/config.dhall.bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hwImage = name: env: boot:
|
hwImage = coreLinkAddr: bootstrapLinkAddr: basePkg: name: env: boot:
|
||||||
nixpkgs.stdenv.mkDerivation {
|
nixpkgs.stdenv.mkDerivation {
|
||||||
name = name + "-hw-image";
|
name = name + "-hw-image";
|
||||||
build = compileBoot name env boot;
|
build = compileBoot name env boot;
|
||||||
|
@ -80,9 +80,9 @@ in rec {
|
||||||
}
|
}
|
||||||
|
|
||||||
build_core \
|
build_core \
|
||||||
"${testPkgs.base-hw-pc.coreObj}" \
|
"${basePkg.coreObj}" \
|
||||||
"$build/modules_asm" \
|
"$build/modules_asm" \
|
||||||
0xffffffc000000000 \
|
${coreLinkAddr} \
|
||||||
core.elf
|
core.elf
|
||||||
|
|
||||||
dhall to-directory-tree --output bootstrap \
|
dhall to-directory-tree --output bootstrap \
|
||||||
|
@ -90,9 +90,9 @@ in rec {
|
||||||
|
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
build_core \
|
build_core \
|
||||||
"${testPkgs.base-hw-pc.bootstrapObj}" \
|
"${basePkg.bootstrapObj}" \
|
||||||
bootstrap/modules_asm \
|
bootstrap/modules_asm \
|
||||||
0x00200000 \
|
${bootstrapLinkAddr} \
|
||||||
$out/image.elf
|
$out/image.elf
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,26 @@
|
||||||
|
commit 848a25e8c97075ddead404beff15f122fd0fd624
|
||||||
|
Author: Emery Hemingway <ehmry@posteo.net>
|
||||||
|
Date: Tue Jun 2 11:37:03 2020 +0530
|
||||||
|
|
||||||
|
Genode support
|
||||||
|
|
||||||
diff --git a/bfd/config.bfd b/bfd/config.bfd
|
diff --git a/bfd/config.bfd b/bfd/config.bfd
|
||||||
index 6391f35684..f2ab802fb5 100644
|
index 6391f35684..fba459d066 100644
|
||||||
--- a/bfd/config.bfd
|
--- a/bfd/config.bfd
|
||||||
+++ b/bfd/config.bfd
|
+++ b/bfd/config.bfd
|
||||||
|
@@ -229,7 +229,7 @@ case "${targ}" in
|
||||||
|
targ_archs="$targ_archs bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch"
|
||||||
|
want64=true
|
||||||
|
;;
|
||||||
|
- aarch64-*-elf | aarch64-*-rtems*)
|
||||||
|
+ aarch64-*-elf | aarch64-*-rtems* | aarch64-*-genode*)
|
||||||
|
targ_defvec=aarch64_elf64_le_vec
|
||||||
|
targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec"
|
||||||
|
want64=true
|
||||||
@@ -554,7 +554,7 @@ case "${targ}" in
|
@@ -554,7 +554,7 @@ case "${targ}" in
|
||||||
targ_selvecs=hppa_elf32_vec
|
targ_selvecs=hppa_elf32_vec
|
||||||
;;
|
;;
|
||||||
|
|
||||||
- i[3-7]86-*-elf* | i[3-7]86-*-rtems*)
|
- i[3-7]86-*-elf* | i[3-7]86-*-rtems*)
|
||||||
+ i[3-7]86-*-elf* | i[3-7]86-*-rtems* | i[3-7]86-*-genode*)
|
+ i[3-7]86-*-elf* | i[3-7]86-*-rtems* | i[3-7]86-*-genode*)
|
||||||
targ_defvec=i386_elf32_vec
|
targ_defvec=i386_elf32_vec
|
||||||
|
@ -34,11 +49,19 @@ index c95acc681d..388c305636 100755
|
||||||
;;
|
;;
|
||||||
qnx*)
|
qnx*)
|
||||||
diff --git a/gas/configure.tgt b/gas/configure.tgt
|
diff --git a/gas/configure.tgt b/gas/configure.tgt
|
||||||
index 3d0415c1aa..7cd96b6be4 100644
|
index 3d0415c1aa..177a82876f 100644
|
||||||
--- a/gas/configure.tgt
|
--- a/gas/configure.tgt
|
||||||
+++ b/gas/configure.tgt
|
+++ b/gas/configure.tgt
|
||||||
@@ -139,7 +139,8 @@ case ${generic_target} in
|
@@ -123,6 +123,7 @@ generic_target=${cpu_type}-$vendor-$os
|
||||||
|
case ${generic_target} in
|
||||||
|
aarch64*-*-elf*) fmt=elf;;
|
||||||
|
aarch64*-*-fuchsia*) fmt=elf;;
|
||||||
|
+ aarch64*-*-genode*) fmt=elf;;
|
||||||
|
aarch64*-*-linux*) fmt=elf em=linux
|
||||||
|
case ${cpu}-${os} in
|
||||||
|
aarch64*-linux-gnu_ilp32) arch=aarch64:32 ;;
|
||||||
|
@@ -139,7 +140,8 @@ case ${generic_target} in
|
||||||
|
|
||||||
arm-*-phoenix*) fmt=elf ;;
|
arm-*-phoenix*) fmt=elf ;;
|
||||||
arm-*-elf) fmt=elf ;;
|
arm-*-elf) fmt=elf ;;
|
||||||
- arm-*-eabi* | arm-*-rtems*) fmt=elf em=armeabi ;;
|
- arm-*-eabi* | arm-*-rtems*) fmt=elf em=armeabi ;;
|
||||||
|
@ -47,7 +70,7 @@ index 3d0415c1aa..7cd96b6be4 100644
|
||||||
arm-*-symbianelf*) fmt=elf em=symbian ;;
|
arm-*-symbianelf*) fmt=elf em=symbian ;;
|
||||||
arm-*-kaos*) fmt=elf ;;
|
arm-*-kaos*) fmt=elf ;;
|
||||||
arm-*-conix*) fmt=elf ;;
|
arm-*-conix*) fmt=elf ;;
|
||||||
@@ -213,6 +214,7 @@ case ${generic_target} in
|
@@ -213,6 +215,7 @@ case ${generic_target} in
|
||||||
i386-*-elfiamcu) fmt=elf arch=iamcu ;;
|
i386-*-elfiamcu) fmt=elf arch=iamcu ;;
|
||||||
i386-*-elf*) fmt=elf ;;
|
i386-*-elf*) fmt=elf ;;
|
||||||
i386-*-fuchsia*) fmt=elf ;;
|
i386-*-fuchsia*) fmt=elf ;;
|
||||||
|
@ -56,9 +79,18 @@ index 3d0415c1aa..7cd96b6be4 100644
|
||||||
i386-*-bsd*) fmt=aout em=386bsd ;;
|
i386-*-bsd*) fmt=aout em=386bsd ;;
|
||||||
i386-*-nacl*) fmt=elf em=nacl
|
i386-*-nacl*) fmt=elf em=nacl
|
||||||
diff --git a/ld/configure.tgt b/ld/configure.tgt
|
diff --git a/ld/configure.tgt b/ld/configure.tgt
|
||||||
index fad8b2e5c8..04f7fa0e70 100644
|
index fad8b2e5c8..7179dbff3a 100644
|
||||||
--- a/ld/configure.tgt
|
--- a/ld/configure.tgt
|
||||||
+++ b/ld/configure.tgt
|
+++ b/ld/configure.tgt
|
||||||
|
@@ -47,7 +47,7 @@ targ64_extra_libpath=
|
||||||
|
case "${targ}" in
|
||||||
|
aarch64_be-*-elf) targ_emul=aarch64elfb
|
||||||
|
targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b armelfb armelf" ;;
|
||||||
|
-aarch64-*-elf | aarch64-*-rtems*)
|
||||||
|
+aarch64-*-elf | aarch64-*-rtems* | aarch64-*-genode*)
|
||||||
|
targ_emul=aarch64elf
|
||||||
|
targ_extra_emuls="aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb" ;;
|
||||||
|
aarch64-*-cloudabi*) targ_emul=aarch64cloudabi
|
||||||
@@ -115,7 +115,7 @@ arm-*-nto*) targ_emul=armnto ;;
|
@@ -115,7 +115,7 @@ arm-*-nto*) targ_emul=armnto ;;
|
||||||
arm-*-phoenix*) targ_emul=armelf ;;
|
arm-*-phoenix*) targ_emul=armelf ;;
|
||||||
armeb-*-elf | armeb-*-eabi*)
|
armeb-*-elf | armeb-*-eabi*)
|
||||||
|
|
|
@ -20,8 +20,10 @@ in {
|
||||||
++ [ "--without-bash-malloc" ]; # no sbrk please
|
++ [ "--without-bash-malloc" ]; # no sbrk please
|
||||||
});
|
});
|
||||||
|
|
||||||
binutils-unwrapped =
|
binutils-unwrapped = overrideTargetAttrs binutils-unwrapped (attrs: {
|
||||||
addPatches binutils-unwrapped [ ./binutils/support-genode.patch ];
|
patches = attrs.patches ++ [ ./binutils/support-genode.patch ];
|
||||||
|
nativeBuildInputs = [ final.updateAutotoolsGnuConfigScriptsHook ];
|
||||||
|
});
|
||||||
|
|
||||||
cmake = overrideTargetAttrs cmake (attrs: {
|
cmake = overrideTargetAttrs cmake (attrs: {
|
||||||
postInstall = with stdenv; ''
|
postInstall = with stdenv; ''
|
||||||
|
@ -56,8 +58,6 @@ in {
|
||||||
|
|
||||||
gdb = addPatches gdb [ ./gdb/genode.patch ];
|
gdb = addPatches gdb [ ./gdb/genode.patch ];
|
||||||
|
|
||||||
inherit (final.genodeSources) genodeBase;
|
|
||||||
|
|
||||||
genodeLibcCross = callPackage ./libc { };
|
genodeLibcCross = callPackage ./libc { };
|
||||||
|
|
||||||
genodePackages = import ../packages { nixpkgs = final; };
|
genodePackages = import ../packages { nixpkgs = final; };
|
||||||
|
@ -66,12 +66,13 @@ in {
|
||||||
|
|
||||||
libcCrossChooser = name:
|
libcCrossChooser = name:
|
||||||
if stdenv.targetPlatform.isGenode then
|
if stdenv.targetPlatform.isGenode then
|
||||||
targetPackages.genodeLibcCross or genodeLibcCross
|
targetPackages.genodeLibcCross
|
||||||
else
|
else
|
||||||
prev.libcCrossChooser name;
|
prev.libcCrossChooser name;
|
||||||
|
|
||||||
llvmPackages_8 = callPackage ./llvm-8 ({
|
llvmPackages_8 = callPackage ./llvm-8 ({
|
||||||
inherit (stdenvAdapters) overrideCC;
|
inherit (stdenvAdapters) overrideCC;
|
||||||
|
inherit (targetPackages.genodeSources) genodeBase;
|
||||||
buildLlvmTools = buildPackages.llvmPackages_8.tools;
|
buildLlvmTools = buildPackages.llvmPackages_8.tools;
|
||||||
targetLlvmLibraries = targetPackages.llvmPackages_8.libraries;
|
targetLlvmLibraries = targetPackages.llvmPackages_8.libraries;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
{ genodeSources, genodeBase, symlinkJoin }:
|
{ genodeSources, symlinkJoin }:
|
||||||
|
|
||||||
symlinkJoin {
|
symlinkJoin {
|
||||||
name = "posix";
|
name = "posix";
|
||||||
|
|
|
@ -36,9 +36,9 @@ else
|
||||||
|
|
||||||
meta = with stdenv.lib;
|
meta = with stdenv.lib;
|
||||||
src.meta // {
|
src.meta // {
|
||||||
description =
|
description = "Microhypervisor";
|
||||||
"The NOVA OS Virtualization Architecture is a project aimed at constructing a secure virtualization environment with a small trusted computing base.";
|
|
||||||
homepage = "http://hypervisor.org/";
|
homepage = "http://hypervisor.org/";
|
||||||
|
platforms = platforms.x86;
|
||||||
license = licenses.gpl2;
|
license = licenses.gpl2;
|
||||||
maintainers = [ maintainers.ehmry ];
|
maintainers = [ maintainers.ehmry ];
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,6 +35,8 @@ let
|
||||||
};
|
};
|
||||||
in listToAttrs (map f names);
|
in listToAttrs (map f names);
|
||||||
|
|
||||||
|
basePatches = [ ./genodelabs/cxx-align.patch ];
|
||||||
|
|
||||||
in depotPkgs // {
|
in depotPkgs // {
|
||||||
inherit stdenv genodeSources;
|
inherit stdenv genodeSources;
|
||||||
|
|
||||||
|
@ -44,20 +46,37 @@ in depotPkgs // {
|
||||||
KERNEL = "hw";
|
KERNEL = "hw";
|
||||||
BOARD = "pc";
|
BOARD = "pc";
|
||||||
targets = [ "bootstrap" "core" "timer" "lib/ld" ];
|
targets = [ "bootstrap" "core" "timer" "lib/ld" ];
|
||||||
patches = [ ./genodelabs/cxx-align.patch ];
|
patches = basePatches;
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mv $out/core-hw-pc.o $coreObj
|
mv $out/core-hw-pc.o $coreObj
|
||||||
mv $out/bootstrap-hw-pc.o $bootstrapObj
|
mv $out/bootstrap-hw-pc.o $bootstrapObj
|
||||||
mv $out/ld-hw.lib.so $out/ld.lib.so
|
mv $out/ld-hw.lib.so $out/ld.lib.so
|
||||||
mv $out/hw_timer_drv $out/timer_drv
|
mv $out/hw_timer_drv $out/timer_drv
|
||||||
'';
|
'';
|
||||||
|
meta.platforms = [ "x86_64-genode" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
base-hw-virt_qemu = buildUpstream {
|
||||||
|
name = "base-hw-virt_qemu";
|
||||||
|
outputs = [ "out" "coreObj" "bootstrapObj" ];
|
||||||
|
KERNEL = "hw";
|
||||||
|
BOARD = "virt_qemu";
|
||||||
|
targets = [ "bootstrap" "core" "timer" "lib/ld" ];
|
||||||
|
patches = basePatches;
|
||||||
|
postInstall = ''
|
||||||
|
mv $out/core-hw-virt_qemu.o $coreObj
|
||||||
|
mv $out/bootstrap-hw-virt_qemu.o $bootstrapObj
|
||||||
|
mv $out/ld-hw.lib.so $out/ld.lib.so
|
||||||
|
mv $out/hw_timer_drv $out/timer_drv
|
||||||
|
'';
|
||||||
|
meta.platforms = [ "aarch64-genode" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
base-linux = buildUpstream {
|
base-linux = buildUpstream {
|
||||||
name = "base-linux";
|
name = "base-linux";
|
||||||
KERNEL = "linux";
|
KERNEL = "linux";
|
||||||
targets = [ "core" "timer" "lib/ld" ];
|
targets = [ "core" "timer" "lib/ld" ];
|
||||||
patches = [ ./genodelabs/cxx-align.patch ];
|
patches = basePatches;
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $out/lib
|
mkdir -p $out/lib
|
||||||
mv $out/ld-linux.lib.so $out/lib/ld.lib.so
|
mv $out/ld-linux.lib.so $out/lib/ld.lib.so
|
||||||
|
@ -71,7 +90,7 @@ in depotPkgs // {
|
||||||
outputs = [ "out" "coreObj" ];
|
outputs = [ "out" "coreObj" ];
|
||||||
KERNEL = "nova";
|
KERNEL = "nova";
|
||||||
targets = [ "core" "timer" "lib/ld" ];
|
targets = [ "core" "timer" "lib/ld" ];
|
||||||
patches = [ ./genodelabs/cxx-align.patch ];
|
patches = basePatches;
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mv $out/core-nova.o $coreObj
|
mv $out/core-nova.o $coreObj
|
||||||
mv $out/ld-nova.lib.so $out/ld.lib.so
|
mv $out/ld-nova.lib.so $out/ld.lib.so
|
||||||
|
|
|
@ -5,17 +5,23 @@ with buildPackages;
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "20.05";
|
version = "20.05";
|
||||||
genodeSources = let
|
|
||||||
platform = targetPackages.targetPlatform;
|
|
||||||
|
|
||||||
arch = with platform;
|
platform = targetPackages.targetPlatform;
|
||||||
if isx86_64 then
|
|
||||||
"x86_64"
|
arch = with platform;
|
||||||
else
|
if isx86_64 then
|
||||||
throw "unknown Genode arch for platform ${platform.system}";
|
"x86_64"
|
||||||
|
else if isAarch64 then
|
||||||
|
"arm_v8a"
|
||||||
|
else
|
||||||
|
throw "unknown Genode arch for platform ${platform.system}";
|
||||||
|
|
||||||
|
genodeSources = let
|
||||||
|
|
||||||
toolPrefix = if platform.isx86 then
|
toolPrefix = if platform.isx86 then
|
||||||
"genode-x86-"
|
"genode-x86-"
|
||||||
|
else if platform.isAarch64 then
|
||||||
|
"genode-aarch64-"
|
||||||
else
|
else
|
||||||
throw "unknown tool prefix for Genode arch ${arch}";
|
throw "unknown tool prefix for Genode arch ${arch}";
|
||||||
in stdenvNoCC.mkDerivation {
|
in stdenvNoCC.mkDerivation {
|
||||||
|
@ -43,14 +49,6 @@ let
|
||||||
stdenv' =
|
stdenv' =
|
||||||
targetPackages.stdenvAdapters.overrideCC targetPackages.stdenv toolchain;
|
targetPackages.stdenvAdapters.overrideCC targetPackages.stdenv toolchain;
|
||||||
|
|
||||||
platform = stdenv'.targetPlatform;
|
|
||||||
|
|
||||||
arch = with platform;
|
|
||||||
if isx86_64 then
|
|
||||||
"x86_64"
|
|
||||||
else
|
|
||||||
throw "unknown Genode arch for platform ${platform.system}";
|
|
||||||
|
|
||||||
preparePort = name:
|
preparePort = name:
|
||||||
{ hash ? "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
{ hash ? "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
||||||
, patches ? [ ], ... }@args:
|
, patches ? [ ], ... }@args:
|
||||||
|
@ -109,7 +107,8 @@ let
|
||||||
(import ./ports.nix { inherit buildPackages; });
|
(import ./ports.nix { inherit buildPackages; });
|
||||||
|
|
||||||
buildUpstream = { name, targets, portInputs ? [ ], nativeBuildInputs ? [ ]
|
buildUpstream = { name, targets, portInputs ? [ ], nativeBuildInputs ? [ ]
|
||||||
, patches ? [ ], enableParallelBuilding ? true, ... }@extraAttrs:
|
, patches ? [ ], enableParallelBuilding ? true, meta ? { }, ...
|
||||||
|
}@extraAttrs:
|
||||||
let havePatches = patches != [ ];
|
let havePatches = patches != [ ];
|
||||||
|
|
||||||
in stdenv'.mkDerivation (extraAttrs // {
|
in stdenv'.mkDerivation (extraAttrs // {
|
||||||
|
@ -149,10 +148,12 @@ let
|
||||||
find build/bin -follow -type f -exec install -Dt $out '{}' \;
|
find build/bin -follow -type f -exec install -Dt $out '{}' \;
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
meta = { platforms = stdenv.lib.platforms.genode; } // meta;
|
||||||
});
|
});
|
||||||
|
|
||||||
buildDepot = { name, apiOnly ? false, portInputs ? [ ]
|
buildDepot = { name, apiOnly ? false, portInputs ? [ ]
|
||||||
, nativeBuildInputs ? [ ], ... }@extraAttrs:
|
, nativeBuildInputs ? [ ], meta ? { }, ... }@extraAttrs:
|
||||||
|
|
||||||
stdenv'.mkDerivation (extraAttrs // {
|
stdenv'.mkDerivation (extraAttrs // {
|
||||||
pname = name;
|
pname = name;
|
||||||
|
@ -202,6 +203,7 @@ let
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
meta = { platforms = stdenv.lib.platforms.genode; } // meta;
|
||||||
});
|
});
|
||||||
|
|
||||||
buildOverrides = callPackage ./targets.nix { inherit ports; };
|
buildOverrides = callPackage ./targets.nix { inherit ports; };
|
||||||
|
|
|
@ -65,7 +65,10 @@ let
|
||||||
'';
|
'';
|
||||||
} // {
|
} // {
|
||||||
isGNU = true;
|
isGNU = true;
|
||||||
targetPrefix = "genode-x86-";
|
targetPrefix = {
|
||||||
|
aarch64-genode = "genode-arm-";
|
||||||
|
x86_64-genode = "genode-x86-";
|
||||||
|
}.${stdenv.targetPlatform.system} or null;
|
||||||
};
|
};
|
||||||
|
|
||||||
wrapped = wrapCC cc;
|
wrapped = wrapCC cc;
|
||||||
|
|
|
@ -22,9 +22,10 @@ in stdenv.mkDerivation {
|
||||||
|
|
||||||
patches = [ ./genode.patch ./elftool.patch ./time.patch ];
|
patches = [ ./genode.patch ./elftool.patch ./time.patch ];
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = with stdenv; ''
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
sh configure.sh
|
sh configure.sh
|
||||||
|
${lib.optionalString (hostPlatform.isAarch64) "rm -fr tests/test_fpu"}
|
||||||
rm -fr tests/test_tls
|
rm -fr tests/test_tls
|
||||||
runHook postConfigure
|
runHook postConfigure
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -80,7 +80,7 @@ index 147c245..d3efb36 100644
|
||||||
GENODE_LDFLAGS := -nostdlib -z max-page-size=$(CONFIG_GUEST_PAGE_SIZE) -shared \
|
GENODE_LDFLAGS := -nostdlib -z max-page-size=$(CONFIG_GUEST_PAGE_SIZE) -shared \
|
||||||
-gc-sections --eh-frame-hdr --entry=0x0 -T genode/genode_rel.ld
|
-gc-sections --eh-frame-hdr --entry=0x0 -T genode/genode_rel.ld
|
||||||
diff --git a/bindings/genode/bindings.cc b/bindings/genode/bindings.cc
|
diff --git a/bindings/genode/bindings.cc b/bindings/genode/bindings.cc
|
||||||
index 5785ae5..2b7db70 100644
|
index a4a4a34..6f439c6 100644
|
||||||
--- a/bindings/genode/bindings.cc
|
--- a/bindings/genode/bindings.cc
|
||||||
+++ b/bindings/genode/bindings.cc
|
+++ b/bindings/genode/bindings.cc
|
||||||
@@ -44,8 +44,6 @@ extern struct mft1_note __solo5_mft1_note;
|
@@ -44,8 +44,6 @@ extern struct mft1_note __solo5_mft1_note;
|
||||||
|
@ -92,7 +92,7 @@ index 5785ae5..2b7db70 100644
|
||||||
#include "../../tenders/common/mft.c"
|
#include "../../tenders/common/mft.c"
|
||||||
|
|
||||||
namespace Solo5
|
namespace Solo5
|
||||||
@@ -111,32 +109,32 @@ struct Solo5::Device
|
@@ -117,32 +115,32 @@ struct Solo5::Device
|
||||||
{
|
{
|
||||||
virtual
|
virtual
|
||||||
solo5_result_t
|
solo5_result_t
|
||||||
|
@ -131,7 +131,7 @@ index 5785ae5..2b7db70 100644
|
||||||
return SOLO5_R_EINVAL; }
|
return SOLO5_R_EINVAL; }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -610,11 +608,44 @@ solo5_block_read(solo5_handle_t handle, solo5_off_t offset,
|
@@ -615,11 +613,44 @@ solo5_block_read(solo5_handle_t handle, solo5_off_t offset,
|
||||||
|
|
||||||
|
|
||||||
solo5_result_t
|
solo5_result_t
|
||||||
|
@ -177,7 +177,7 @@ index 5785ae5..2b7db70 100644
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|
||||||
|
|
||||||
@@ -632,7 +663,7 @@ void Component::construct(Genode::Env &env)
|
@@ -637,7 +668,7 @@ void Component::construct(Genode::Env &env)
|
||||||
mft_get_builtin_mft1(&__solo5_mft1_note, &mft, &mft_size);
|
mft_get_builtin_mft1(&__solo5_mft1_note, &mft, &mft_size);
|
||||||
|
|
||||||
if (mft_validate(mft, mft_size) != 0) {
|
if (mft_validate(mft, mft_size) != 0) {
|
||||||
|
@ -216,18 +216,16 @@ index 0f1ca5c..0000000
|
||||||
-uintptr_t SSP_GUARD;
|
-uintptr_t SSP_GUARD;
|
||||||
-void SSP_FAIL (void) { }
|
-void SSP_FAIL (void) { }
|
||||||
diff --git a/configure.sh b/configure.sh
|
diff --git a/configure.sh b/configure.sh
|
||||||
index f762933..e75f41a 100755
|
index 0828409..61fa885 100755
|
||||||
--- a/configure.sh
|
--- a/configure.sh
|
||||||
+++ b/configure.sh
|
+++ b/configure.sh
|
||||||
@@ -233,6 +233,23 @@ config_host_openbsd()
|
@@ -254,6 +254,21 @@ config_host_openbsd()
|
||||||
CONFIG_GENODE=
|
CONFIG_GENODE=
|
||||||
}
|
}
|
||||||
|
|
||||||
+config_host_genode()
|
+config_host_genode()
|
||||||
+{
|
+{
|
||||||
+ cc_is_clang || die "Only Clang is supported on Genode"
|
+ cc_is_clang || die "Only Clang is supported on Genode"
|
||||||
+ [ "${CONFIG_ARCH}" = "x86_64" ] ||
|
|
||||||
+ die "Only 'x86_64' is supported on Genode"
|
|
||||||
+
|
+
|
||||||
+ MAKECONF_CXXFLAGS="-mno-retpoline -Wno-mismatched-tags -Wno-undefined-bool-conversion -Wno-uninitialized -Wno-unknown-attributes -Wno-unused-variable -Wno-unused-parameter"
|
+ MAKECONF_CXXFLAGS="-mno-retpoline -Wno-mismatched-tags -Wno-undefined-bool-conversion -Wno-uninitialized -Wno-unknown-attributes -Wno-unused-variable -Wno-unused-parameter"
|
||||||
+ MAKECONF_LDFLAGS="-nopie"
|
+ MAKECONF_LDFLAGS="-nopie"
|
||||||
|
@ -243,7 +241,7 @@ index f762933..e75f41a 100755
|
||||||
# Check for a tools-only build.
|
# Check for a tools-only build.
|
||||||
OPT_ONLY_TOOLS=
|
OPT_ONLY_TOOLS=
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
@@ -245,6 +262,7 @@ fi
|
@@ -266,6 +281,7 @@ fi
|
||||||
|
|
||||||
# Allow external override of CC.
|
# Allow external override of CC.
|
||||||
CC=${CC:-cc}
|
CC=${CC:-cc}
|
||||||
|
@ -251,18 +249,22 @@ index f762933..e75f41a 100755
|
||||||
LD=${LD:-ld}
|
LD=${LD:-ld}
|
||||||
|
|
||||||
CC_MACHINE=$(${CC} -dumpmachine)
|
CC_MACHINE=$(${CC} -dumpmachine)
|
||||||
@@ -272,6 +290,10 @@ case ${CC_MACHINE} in
|
@@ -293,6 +309,14 @@ case ${CC_MACHINE} in
|
||||||
CONFIG_ARCH=x86_64 CONFIG_HOST=OpenBSD
|
CONFIG_ARCH=x86_64 CONFIG_HOST=OpenBSD
|
||||||
CONFIG_GUEST_PAGE_SIZE=0x1000
|
CONFIG_GUEST_PAGE_SIZE=0x1000
|
||||||
;;
|
;;
|
||||||
+ x86_64-*genode*)
|
+ x86_64-*genode*)
|
||||||
+ CONFIG_ARCH=x86_64 CONFIG_HOST=Genode
|
+ CONFIG_ARCH=x86_64 CONFIG_HOST=Genode
|
||||||
+ CONFIG_GUEST_PAGE_SIZE=0x1000
|
+ CONFIG_GUEST_PAGE_SIZE=0x1000
|
||||||
|
+ ;;
|
||||||
|
+ aarch64-*genode*)
|
||||||
|
+ CONFIG_ARCH=aarch64 CONFIG_HOST=Genode
|
||||||
|
+ CONFIG_GUEST_PAGE_SIZE=0x1000
|
||||||
+ ;;
|
+ ;;
|
||||||
*)
|
*)
|
||||||
die "Unsupported toolchain target: ${CC_MACHINE}"
|
die "Unsupported toolchain target: ${CC_MACHINE}"
|
||||||
;;
|
;;
|
||||||
@@ -303,6 +325,9 @@ case "${CONFIG_HOST}" in
|
@@ -325,6 +349,9 @@ case "${CONFIG_HOST}" in
|
||||||
OpenBSD)
|
OpenBSD)
|
||||||
config_host_openbsd
|
config_host_openbsd
|
||||||
;;
|
;;
|
||||||
|
@ -272,7 +274,7 @@ index f762933..e75f41a 100755
|
||||||
*)
|
*)
|
||||||
die "Unsupported build OS: ${CONFIG_HOST}"
|
die "Unsupported build OS: ${CONFIG_HOST}"
|
||||||
;;
|
;;
|
||||||
@@ -315,7 +340,7 @@ esac
|
@@ -337,7 +364,7 @@ esac
|
||||||
# GNU make. Given the differences in quoting rules between the two
|
# GNU make. Given the differences in quoting rules between the two
|
||||||
# (unable to sensibly use VAR="VALUE"), our convention is as follows:
|
# (unable to sensibly use VAR="VALUE"), our convention is as follows:
|
||||||
#
|
#
|
||||||
|
@ -281,7 +283,7 @@ index f762933..e75f41a 100755
|
||||||
# available to Makefiles.
|
# available to Makefiles.
|
||||||
#
|
#
|
||||||
# 2. Shell scripts parse the subset of *lines* starting with "CONFIG_". I.e.
|
# 2. Shell scripts parse the subset of *lines* starting with "CONFIG_". I.e.
|
||||||
@@ -333,11 +358,13 @@ CONFIG_VIRTIO=${CONFIG_VIRTIO}
|
@@ -355,11 +382,13 @@ CONFIG_VIRTIO=${CONFIG_VIRTIO}
|
||||||
CONFIG_MUEN=${CONFIG_MUEN}
|
CONFIG_MUEN=${CONFIG_MUEN}
|
||||||
CONFIG_GENODE=${CONFIG_GENODE}
|
CONFIG_GENODE=${CONFIG_GENODE}
|
||||||
MAKECONF_CFLAGS=${MAKECONF_CFLAGS}
|
MAKECONF_CFLAGS=${MAKECONF_CFLAGS}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
{ genodeSources, genodeBase }:
|
{ genodeSources }:
|
||||||
|
|
||||||
let port = genodeSources.ports.stdcxx;
|
let port = genodeSources.ports.stdcxx;
|
||||||
in genodeSources.buildUpstream {
|
in genodeSources.buildUpstream {
|
||||||
|
@ -8,7 +8,7 @@ in genodeSources.buildUpstream {
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [ "out" "dev" ];
|
||||||
targets = [ "LIB=stdcxx" ];
|
targets = [ "LIB=stdcxx" ];
|
||||||
portInputs = [ genodeSources.ports.libc port ];
|
portInputs = [ genodeSources.ports.libc port ];
|
||||||
propagatedBuildInputs = [ genodeBase ];
|
propagatedBuildInputs = [ genodeSources.genodeBase ];
|
||||||
|
|
||||||
STDCXX_PORT = port;
|
STDCXX_PORT = port;
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
|
|
|
@ -1,25 +1,21 @@
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
{ self, apps, buildPackages, genodepkgs, lib, nixpkgs, legacyPackages }:
|
{ self, apps, localPackages, genodepkgs, lib, nixpkgs, legacyPackages }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
callTest = path:
|
callTest = path:
|
||||||
import path {
|
import path {
|
||||||
pkgs = testPkgs;
|
pkgs = testPkgs;
|
||||||
inherit nixpkgs buildPackages legacyPackages;
|
inherit nixpkgs localPackages legacyPackages;
|
||||||
};
|
};
|
||||||
|
|
||||||
testFiles = map callTest [
|
testFiles = map callTest [ ./log.nix ./posix.nix ./vmm_x86.nix ./x86.nix ]
|
||||||
./log.nix
|
++ (callTest ./solo5);
|
||||||
./posix.nix
|
|
||||||
./vmm_x86.nix
|
|
||||||
./x86.nix
|
|
||||||
] ++ (callTest ./solo5);
|
|
||||||
|
|
||||||
testPkgs = genodepkgs;
|
testPkgs = genodepkgs;
|
||||||
|
|
||||||
qemu' = buildPackages.qemu_test;
|
qemu' = localPackages.qemu;
|
||||||
|
|
||||||
qemuBinary = qemuPkg:
|
qemuBinary = qemuPkg:
|
||||||
{
|
{
|
||||||
|
@ -27,14 +23,17 @@ let
|
||||||
x86_64-genode = "${qemuPkg}/bin/qemu-system-x86_64";
|
x86_64-genode = "${qemuPkg}/bin/qemu-system-x86_64";
|
||||||
}.${genodepkgs.stdenv.hostPlatform.system};
|
}.${genodepkgs.stdenv.hostPlatform.system};
|
||||||
|
|
||||||
platforms = [
|
cores = [
|
||||||
{
|
{
|
||||||
prefix = "hw-pc-";
|
prefix = "hw-pc-";
|
||||||
specs = [ "x86" "hw" ];
|
specs = [ "x86" "hw" ];
|
||||||
basePkg = testPkgs.base-hw-pc;
|
platforms = [ "x86_64-genode" ];
|
||||||
makeImage = lib.hwImage;
|
basePackages = [ testPkgs.base-hw-pc ]
|
||||||
|
++ map testPkgs.genodeSources.depot [ "rtc_drv" ];
|
||||||
|
makeImage =
|
||||||
|
lib.hwImage "0xffffffc000000000" "0x00200000" testPkgs.base-hw-pc;
|
||||||
startVM = vmName: image: ''
|
startVM = vmName: image: ''
|
||||||
#! ${buildPackages.runtimeShell}
|
#! ${localPackages.runtimeShell}
|
||||||
exec ${qemuBinary qemu'} \
|
exec ${qemuBinary qemu'} \
|
||||||
-name ${vmName} \
|
-name ${vmName} \
|
||||||
-machine q35 \
|
-machine q35 \
|
||||||
|
@ -45,13 +44,35 @@ let
|
||||||
"$@"
|
"$@"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
prefix = "hw-virt_qemu-";
|
||||||
|
specs = [ "aarch64" "hw" ];
|
||||||
|
platforms = [ "aarch64-genode" ];
|
||||||
|
basePackages = with testPkgs; [ base-hw-virt_qemu rtc-dummy ];
|
||||||
|
makeImage = lib.hwImage "0xffffffc000000000" "0x40000000"
|
||||||
|
testPkgs.base-hw-virt_qemu;
|
||||||
|
startVM = vmName: image: ''
|
||||||
|
#! ${localPackages.runtimeShell}
|
||||||
|
exec ${qemuBinary qemu'} \
|
||||||
|
-name ${vmName} \
|
||||||
|
-M virt,virtualization=true,gic_version=3 \
|
||||||
|
-cpu cortex-a53 \
|
||||||
|
-smp 4 \
|
||||||
|
-m 384 \
|
||||||
|
-kernel "${image}/image.elf" \
|
||||||
|
$QEMU_OPTS \
|
||||||
|
"$@"
|
||||||
|
'';
|
||||||
|
}
|
||||||
{
|
{
|
||||||
prefix = "nova-";
|
prefix = "nova-";
|
||||||
specs = [ "x86" "nova" ];
|
specs = [ "x86" "nova" ];
|
||||||
basePkg = testPkgs.base-nova;
|
platforms = [ "x86_64-genode" ];
|
||||||
|
basePackages = [ testPkgs.base-nova ]
|
||||||
|
++ map testPkgs.genodeSources.depot [ "rtc_drv" ];
|
||||||
makeImage = lib.novaImage;
|
makeImage = lib.novaImage;
|
||||||
startVM = vmName: image: ''
|
startVM = vmName: image: ''
|
||||||
#! ${buildPackages.runtimeShell}
|
#! ${localPackages.runtimeShell}
|
||||||
exec ${qemuBinary qemu'} \
|
exec ${qemuBinary qemu'} \
|
||||||
-name ${vmName} \
|
-name ${vmName} \
|
||||||
-machine q35 \
|
-machine q35 \
|
||||||
|
@ -64,7 +85,11 @@ let
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
testDriver = with buildPackages;
|
cores' = builtins.filter (core:
|
||||||
|
builtins.any (x: x == genodepkgs.stdenv.hostPlatform.system) core.platforms)
|
||||||
|
cores;
|
||||||
|
|
||||||
|
testDriver = with localPackages;
|
||||||
let testDriverScript = ./test-driver/test-driver.py;
|
let testDriverScript = ./test-driver/test-driver.py;
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "nixos-test-driver";
|
name = "nixos-test-driver";
|
||||||
|
@ -101,8 +126,8 @@ let
|
||||||
machine.wait_until_serial_output('child "init" exited with exit value 0')
|
machine.wait_until_serial_output('child "init" exited with exit value 0')
|
||||||
'';
|
'';
|
||||||
|
|
||||||
makeTest = with buildPackages;
|
makeTest = with localPackages;
|
||||||
{ prefix, specs, basePkg, makeImage, startVM }:
|
{ prefix, specs, platforms, basePackages, makeImage, startVM }:
|
||||||
{ name ? "unnamed", testScript ? defaultTestScript,
|
{ name ? "unnamed", testScript ? defaultTestScript,
|
||||||
# Skip linting (mainly intended for faster dev cycles)
|
# Skip linting (mainly intended for faster dev cycles)
|
||||||
skipLint ? false, ... }@t:
|
skipLint ? false, ... }@t:
|
||||||
|
@ -113,7 +138,7 @@ let
|
||||||
buildVM = vmName:
|
buildVM = vmName:
|
||||||
{ config, inputs, env ? { }, extraPaths ? [ ] }:
|
{ config, inputs, env ? { }, extraPaths ? [ ] }:
|
||||||
let
|
let
|
||||||
storeTarball = buildPackages.runCommand "store" { } ''
|
storeTarball = localPackages.runCommand "store" { } ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
tar cf "$out/store.tar" --absolute-names ${toString inputs} ${
|
tar cf "$out/store.tar" --absolute-names ${toString inputs} ${
|
||||||
toString extraPaths
|
toString extraPaths
|
||||||
|
@ -136,14 +161,13 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
storeManifest = lib.mergeManifests (map addManifest inputs);
|
storeManifest = lib.mergeManifests (map addManifest inputs);
|
||||||
manifest = lib.mergeManifests (map addManifest
|
manifest = lib.mergeManifests (map addManifest (basePackages
|
||||||
([ basePkg testPkgs.sotest-producer storeTarball ]
|
++ [ testPkgs.sotest-producer storeTarball ]
|
||||||
++ map testPkgs.genodeSources.depot [
|
++ map testPkgs.genodeSources.depot [
|
||||||
"init"
|
"init"
|
||||||
"rtc_drv"
|
"vfs"
|
||||||
"vfs"
|
"cached_fs_rom"
|
||||||
"cached_fs_rom"
|
]));
|
||||||
]));
|
|
||||||
config' = "${
|
config' = "${
|
||||||
./test-wrapper.dhall
|
./test-wrapper.dhall
|
||||||
} (${config}) $(stat --format '%s' ${storeTarball}/store.tar) ${storeManifest} ${manifest}";
|
} (${config}) $(stat --format '%s' ${storeTarball}/store.tar) ${storeManifest} ${manifest}";
|
||||||
|
@ -155,7 +179,7 @@ let
|
||||||
image = makeImage vmName env' config';
|
image = makeImage vmName env' config';
|
||||||
startVM' = startVM vmName image;
|
startVM' = startVM vmName image;
|
||||||
in {
|
in {
|
||||||
script = buildPackages.writeScriptBin "run-${vmName}-vm" startVM';
|
script = localPackages.writeScriptBin "run-${vmName}-vm" startVM';
|
||||||
|
|
||||||
config = lib.runDhallCommand (name + ".dhall") env' ''
|
config = lib.runDhallCommand (name + ".dhall") env' ''
|
||||||
${apps.dhall.program} <<< "${config'}" > $out
|
${apps.dhall.program} <<< "${config'}" > $out
|
||||||
|
@ -246,16 +270,16 @@ let
|
||||||
test // { inherit nodes driver test; };
|
test // { inherit nodes driver test; };
|
||||||
|
|
||||||
testList = let
|
testList = let
|
||||||
f = platform:
|
f = core:
|
||||||
let makeTest' = makeTest platform;
|
let makeTest' = makeTest core;
|
||||||
in test:
|
in test:
|
||||||
if (test.constraints or (_: true)) platform.specs then {
|
if (test.constraints or (_: true)) core.specs then {
|
||||||
name = platform.prefix + test.name;
|
name = core.prefix + test.name;
|
||||||
value = makeTest' test;
|
value = makeTest' test;
|
||||||
} else
|
} else
|
||||||
null;
|
null;
|
||||||
|
|
||||||
in lib.lists.crossLists f [ platforms testFiles ];
|
in lib.lists.crossLists f [ cores' testFiles ];
|
||||||
|
|
||||||
in builtins.listToAttrs (builtins.filter (_: _ != null) testList)
|
in builtins.listToAttrs (builtins.filter (_: _ != null) testList)
|
||||||
|
|
||||||
|
@ -278,7 +302,7 @@ in builtins.listToAttrs (builtins.filter (_: _ != null) testList)
|
||||||
load = [ "hypervisor serial novga iommu" test.image.name ];
|
load = [ "hypervisor serial novga iommu" test.image.name ];
|
||||||
}) novaTests);
|
}) novaTests);
|
||||||
|
|
||||||
in buildPackages.stdenv.mkDerivation {
|
in localPackages.stdenv.mkDerivation {
|
||||||
name = "sotest";
|
name = "sotest";
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
mkdir zip; cd zip
|
mkdir zip; cd zip
|
||||||
|
@ -288,7 +312,7 @@ in builtins.listToAttrs (builtins.filter (_: _ != null) testList)
|
||||||
(map (test: "cp ${test.image}/image.elf ${test.name}.image.elf")
|
(map (test: "cp ${test.image}/image.elf ${test.name}.image.elf")
|
||||||
allTests)}
|
allTests)}
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
${buildPackages.zip}/bin/zip "$out/binaries.zip" *
|
${localPackages.zip}/bin/zip "$out/binaries.zip" *
|
||||||
cat << EOF > "$out/project.json"
|
cat << EOF > "$out/project.json"
|
||||||
${builtins.toJSON projectCfg}
|
${builtins.toJSON projectCfg}
|
||||||
EOF
|
EOF
|
||||||
|
|
|
@ -19,7 +19,9 @@ in map solo5Test [
|
||||||
{
|
{
|
||||||
name = "multi";
|
name = "multi";
|
||||||
machine = {
|
machine = {
|
||||||
config = "${./.}/solo5.dhall";
|
config = "${./.}/solo5.dhall { isAarch64 = ${
|
||||||
|
if pkgs.stdenv.hostPlatform.isAarch64 then "True" else "False"
|
||||||
|
} }";
|
||||||
inputs = map genodeMake [ "app/ping" ] ++ (map genodeDepot [
|
inputs = map genodeMake [ "app/ping" ] ++ (map genodeDepot [
|
||||||
"ram_block"
|
"ram_block"
|
||||||
"nic_bridge"
|
"nic_bridge"
|
||||||
|
|
|
@ -29,16 +29,23 @@ let toSimple =
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let tests
|
in λ(params : { isAarch64 : Bool })
|
||||||
: Prelude.Map.Type Text Child.Type
|
→ let tests
|
||||||
= [ { mapKey = "quiet", mapValue = toSimple "quiet" }
|
: Prelude.Map.Type Text Child.Type
|
||||||
, { mapKey = "hello", mapValue = toSimple "hello" }
|
= toMap
|
||||||
, { mapKey = "globals", mapValue = toSimple "globals" }
|
{ quiet = toSimple "quiet"
|
||||||
, { mapKey = "fpu", mapValue = toSimple "fpu" }
|
, hello = toSimple "hello"
|
||||||
, { mapKey = "time", mapValue = ./time.dhall }
|
, globals = toSimple "globals"
|
||||||
, { mapKey = "blk", mapValue = ./blk.dhall }
|
, time = ./time.dhall
|
||||||
, { mapKey = "net", mapValue = ./net.dhall }
|
, blk = ./blk.dhall
|
||||||
, { mapKey = "net_2if", mapValue = ./net_2if.dhall }
|
, net = ./net.dhall
|
||||||
]
|
, net_2if = ./net_2if.dhall
|
||||||
|
}
|
||||||
|
# ( if params.isAarch64
|
||||||
|
|
||||||
in Test::{ children = tests }
|
then Prelude.Map.empty Text Child.Type
|
||||||
|
|
||||||
|
else toMap { fpu = toSimple "fpu" }
|
||||||
|
)
|
||||||
|
|
||||||
|
in Test::{ children = tests }
|
||||||
|
|
Loading…
Reference in New Issue