From e845495edb4bb8bbf4c89da632e861cac6017614 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Sun, 21 May 2017 15:25:55 +0200 Subject: [PATCH 1/5] lkl: add meta.homepage --- pkgs/applications/virtualization/lkl/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/virtualization/lkl/default.nix b/pkgs/applications/virtualization/lkl/default.nix index 134df59159b..878c10e01dc 100644 --- a/pkgs/applications/virtualization/lkl/default.nix +++ b/pkgs/applications/virtualization/lkl/default.nix @@ -39,6 +39,7 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "LKL (Linux Kernel Library) aims to allow reusing the Linux kernel code as extensively as possible with minimal effort and reduced maintenance overhead"; + homepage = https://github.com/lkl/linux/; platforms = [ "x86_64-linux" ]; # Darwin probably works too but I haven't tested it license = licenses.gpl2; maintainers = with maintainers; [ copumpkin ]; From e983d4306e2a72774411f813b2dd1348a034a417 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Tue, 23 May 2017 01:41:22 +0200 Subject: [PATCH 2/5] lkl: bc & python are native build inputs --- pkgs/applications/virtualization/lkl/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/lkl/default.nix b/pkgs/applications/virtualization/lkl/default.nix index 878c10e01dc..d99377a3233 100644 --- a/pkgs/applications/virtualization/lkl/default.nix +++ b/pkgs/applications/virtualization/lkl/default.nix @@ -4,7 +4,9 @@ stdenv.mkDerivation rec { name = "lkl-${stdenv.lib.substring 0 7 rev}"; rev = "d74707304d4e4614081ae2a612a833aeb46622b5"; - buildInputs = [ bc python fuse libarchive ]; + nativeBuildInputs = [ bc python ]; + + buildInputs = [ fuse libarchive ]; src = fetchFromGitHub { inherit rev; From 8c8f40a1285bda11ccd972a83aca0ea41f208446 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Tue, 23 May 2017 01:59:49 +0200 Subject: [PATCH 3/5] lkl: d747073 -> 2017-03-24 - Moves to a more recent kernel (4.10, I think ...) - API break re the previous version - cptofs: fix root directory copy - add support for disks with custom ops - add LKL_HIJACK_NET_QDISC to configure qdisc policy - add LKL_HIJACK_SYSCTL to configure sysctl values --- pkgs/applications/virtualization/lkl/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/virtualization/lkl/default.nix b/pkgs/applications/virtualization/lkl/default.nix index d99377a3233..26a0e097c47 100644 --- a/pkgs/applications/virtualization/lkl/default.nix +++ b/pkgs/applications/virtualization/lkl/default.nix @@ -1,8 +1,8 @@ { stdenv, fetchFromGitHub, bc, python, fuse, libarchive }: stdenv.mkDerivation rec { - name = "lkl-${stdenv.lib.substring 0 7 rev}"; - rev = "d74707304d4e4614081ae2a612a833aeb46622b5"; + name = "lkl-2017-03-24"; + rev = "a063e1631db5e2b9b04f184c5e6d185c1cd645cb"; nativeBuildInputs = [ bc python ]; @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { inherit rev; owner = "lkl"; repo = "linux"; - sha256 = "0x1hdjsrj6hfk1sgfw11ihm00fmp6g158sr2q3cgjy2b6jnsr4hp"; + sha256 = "07dmira76i0ki577sra4fdl1wvzfzxzd75252lza0sc6jdzrrwvj"; }; # Fix a /usr/bin/env reference in here that breaks sandboxed builds From e0b623a56d7d3914cedaafaeaf9cff2d722c6615 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Tue, 23 May 2017 23:55:55 +0200 Subject: [PATCH 4/5] lkl: break description into longDescription and a briefer descr --- pkgs/applications/virtualization/lkl/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/virtualization/lkl/default.nix b/pkgs/applications/virtualization/lkl/default.nix index 26a0e097c47..2f563ab635e 100644 --- a/pkgs/applications/virtualization/lkl/default.nix +++ b/pkgs/applications/virtualization/lkl/default.nix @@ -40,7 +40,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; meta = with stdenv.lib; { - description = "LKL (Linux Kernel Library) aims to allow reusing the Linux kernel code as extensively as possible with minimal effort and reduced maintenance overhead"; + description = "The Linux kernel as a library"; + longDescription = '' + LKL (Linux Kernel Library) aims to allow reusing the Linux kernel code as + extensively as possible with minimal effort and reduced maintenance + overhead + ''; homepage = https://github.com/lkl/linux/; platforms = [ "x86_64-linux" ]; # Darwin probably works too but I haven't tested it license = licenses.gpl2; From 49ecd62c087473f0e60aa8c89a0dd1d196427b2e Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Wed, 24 May 2017 00:43:22 +0200 Subject: [PATCH 5/5] lkl: split outputs Breaking out lib allows users to link against lkl without pulling the kitchen sink into their closure. --- pkgs/applications/virtualization/lkl/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/virtualization/lkl/default.nix b/pkgs/applications/virtualization/lkl/default.nix index 2f563ab635e..e40d054520f 100644 --- a/pkgs/applications/virtualization/lkl/default.nix +++ b/pkgs/applications/virtualization/lkl/default.nix @@ -4,6 +4,8 @@ stdenv.mkDerivation rec { name = "lkl-2017-03-24"; rev = "a063e1631db5e2b9b04f184c5e6d185c1cd645cb"; + outputs = [ "dev" "lib" "out" ]; + nativeBuildInputs = [ bc python ]; buildInputs = [ fuse libarchive ]; @@ -19,15 +21,15 @@ stdenv.mkDerivation rec { prePatch = "patchShebangs arch/lkl/scripts"; installPhase = '' - mkdir -p $out/{bin,lib} + mkdir -p $out/bin $lib/lib $dev - # This tool assumes a different directory structure so let's point it at the right location cp tools/lkl/bin/lkl-hijack.sh $out/bin - substituteInPlace $out/bin/lkl-hijack.sh --replace '/../' '/../lib' + sed -i $out/bin/lkl-hijack.sh \ + -e "s,LD_LIBRARY_PATH=.*,LD_LIBRARY_PATH=$lib/lib," cp tools/lkl/{cptofs,cpfromfs,fs2tar,lklfuse} $out/bin - cp -r tools/lkl/include $out - cp tools/lkl/liblkl*.{a,so} $out/lib + cp -r tools/lkl/include $dev/ + cp tools/lkl/liblkl*.{a,so} $lib/lib ''; # We turn off format and fortify because of these errors (fortify implies -O2, which breaks the jitter entropy code):