solo5: 0.6.9 -> 0.7.3

This commit is contained in:
Lana Black 2022-08-11 17:11:54 +00:00 committed by ehmry
parent 26a5727935
commit 44ef78759e
2 changed files with 28 additions and 12 deletions

View File

@ -2,7 +2,7 @@
, pkg-config, qemu, syslinux, util-linux }:
let
version = "0.6.9";
version = "0.7.3";
# list of all theoretically available targets
targets = [
"genode"
@ -21,14 +21,16 @@ in stdenv.mkDerivation {
src = fetchurl {
url = "https://github.com/Solo5/solo5/releases/download/v${version}/solo5-v${version}.tar.gz";
sha256 = "03lvk9mab3yxrmi73wrvvhykqcydjrsda0wj6aasnjm5lx9jycpr";
sha256 = "sha256-8LftT22XzmmWxgYez+BAHDX4HOyl5DrwrpuO2+bqqcY=";
};
patches = [ ./test_sleep.patch ];
hardeningEnable = [ "pie" ];
configurePhase = ''
runHook preConfigure
sh configure.sh
sh configure.sh --prefix=/
runHook postConfigure
'';
@ -38,15 +40,7 @@ in stdenv.mkDerivation {
runHook preInstall
export DESTDIR=$out
export PREFIX=$out
make install-tools
# get CONFIG_* vars from Makeconf which also parse in sh
grep '^CONFIG_' Makeconf > nix_tmp_targetconf
source nix_tmp_targetconf
# install opam / pkg-config files for all enabled targets
${lib.concatMapStrings (bind: ''
[ -n "$CONFIG_${lib.toUpper bind}" ] && make install-opam-${bind}
'') targets}
make install
substituteInPlace $out/bin/solo5-virtio-mkimage \
--replace "/usr/lib/syslinux" "${syslinux}/share/syslinux" \

View File

@ -0,0 +1,22 @@
diff --git a/tests/test_time/test_time.c b/tests/test_time/test_time.c
index 931500b..cde64ad 100644
--- a/tests/test_time/test_time.c
+++ b/tests/test_time/test_time.c
@@ -110,7 +110,8 @@ int solo5_app_main(const struct solo5_start_info *si __attribute__((unused)))
/*
* Verify that we did not sleep less than requested (see above).
*/
- if (delta < NSEC_PER_SEC) {
+ const solo5_time_t slack = 100000000ULL;
+ if (delta < NSEC_PER_SEC - slack) {
printf("[%d] ERROR: slept too little (expected at least %llu ns)\n",
iters, (unsigned long long)NSEC_PER_SEC);
failed = true;
@@ -120,7 +121,6 @@ int solo5_app_main(const struct solo5_start_info *si __attribute__((unused)))
* Verify that we did not sleep more than requested, within reason
* (scheduling delays, general inaccuracy of the current timing code).
*/
- const solo5_time_t slack = 100000000ULL;
if (delta > (NSEC_PER_SEC + slack)) {
printf("[%d] ERROR: slept too much (expected at most %llu ns)\n",
iters, (unsigned long long)slack);