Merge pull request #33449 from Mic92/libelf-fallout

fix kernel modules that broke with 4.14
This commit is contained in:
Orivej Desh 2018-01-06 06:47:49 +00:00 committed by GitHub
commit 75c5a66dc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 26 deletions

View file

@ -1,15 +1,15 @@
{ stdenv, fetchFromGitHub, makeWrapper, cmake, llvmPackages_5, kernel { stdenv, fetchFromGitHub, fetchpatch, makeWrapper, cmake, llvmPackages_5, kernel
, flex, bison, elfutils, python, pythonPackages, luajit, netperf, iperf }: , flex, bison, elfutils, python, pythonPackages, luajit, netperf, iperf, libelf }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "0.4.0"; version = "0.5.0";
name = "bcc-${version}"; name = "bcc-${version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "iovisor"; owner = "iovisor";
repo = "bcc"; repo = "bcc";
rev = "v${version}"; rev = "v${version}";
sha256 = "106ri3yhjhp3dgsjb05y4j6va153d5nqln3zjdz6qfz87svak0rw"; sha256 = "0bb3244xll5sqx0lvrchg71qy2zg0yj6r5h4v5fvrg1fjhaldys9";
}; };
buildInputs = [ buildInputs = [
@ -17,7 +17,17 @@ stdenv.mkDerivation rec {
elfutils python pythonPackages.netaddr luajit netperf iperf elfutils python pythonPackages.netaddr luajit netperf iperf
]; ];
nativeBuildInputs = [ makeWrapper cmake flex bison ]; patches = [
# fix build with llvm > 5.0.0 && < 6.0.0
(fetchpatch {
url = "https://github.com/iovisor/bcc/commit/bd7fa55bb39b8978dafd0b299e35616061e0a368.patch";
sha256 = "1sgxhsq174iihyk1x08py73q8fh78d7y3c90k5nh8vcw2pf1xbnf";
})
];
nativeBuildInputs = [ makeWrapper cmake flex bison ]
# libelf is incompatible with elfutils-libelf
++ stdenv.lib.filter (x: x != libelf) kernel.moduleBuildDependencies;
cmakeFlags="-DBCC_KERNEL_MODULES_DIR=${kernel.dev}/lib/modules"; cmakeFlags="-DBCC_KERNEL_MODULES_DIR=${kernel.dev}/lib/modules";

View file

@ -1,41 +1,41 @@
{ lib, stdenv, fetchFromGitHub, kernel, kmod }: { lib, stdenv, fetchFromGitHub, kernel, kmod }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "1.2.0"; version = "1.5.0";
name = "ena-${version}-${kernel.version}"; name = "ena-${version}-${kernel.version}";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "amzn"; owner = "amzn";
repo = "amzn-drivers"; repo = "amzn-drivers";
rev = "ena_linux_${version}"; rev = "ena_linux_${version}";
sha256 = "0m0jqd6gyk4r43w6p5dvp1djg2qgvyhnzmg53sszlh55mlgla714"; sha256 = "1h3vnwa2129advyws69n0sqyra4nz68mng6g84whbvhzjyx810sj";
}; };
hardeningDisable = [ "pic" ]; hardeningDisable = [ "pic" ];
nativeBuildInputs = kernel.moduleBuildDependencies;
# linux 3.12 # linux 3.12
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration"; NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
configurePhase = configurePhase = ''
'' cd kernel/linux/ena
cd kernel/linux/ena substituteInPlace Makefile --replace '/lib/modules/$(BUILD_KERNEL)' ${kernel.dev}/lib/modules/${kernel.modDirVersion}
substituteInPlace Makefile --replace '/lib/modules/$(BUILD_KERNEL)' ${kernel.dev}/lib/modules/${kernel.modDirVersion} '';
'';
installPhase = installPhase = ''
'' strip -S ena.ko
strip -S ena.ko dest=$out/lib/modules/${kernel.modDirVersion}/misc
dest=$out/lib/modules/${kernel.modDirVersion}/misc mkdir -p $dest
mkdir -p $dest cp ena.ko $dest/
cp ena.ko $dest/ xz $dest/ena.ko
xz $dest/ena.ko '';
'';
meta = { meta = with stdenv.lib; {
description = "Amazon Elastic Network Adapter (ENA) driver for Linux"; description = "Amazon Elastic Network Adapter (ENA) driver for Linux";
homepage = https://github.com/amzn/amzn-drivers; homepage = https://github.com/amzn/amzn-drivers;
license = lib.licenses.gpl2; license = licenses.gpl2;
maintainers = [ lib.maintainers.eelco ]; maintainers = [ maintainers.eelco ];
platforms = lib.platforms.linux; platforms = platforms.linux;
}; };
} }

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "ixgbevf-${version}-${kernel.version}"; name = "ixgbevf-${version}-${kernel.version}";
version = "4.2.1"; version = "4.3.3";
src = fetchurl { src = fetchurl {
url = "mirror://sourceforge/e1000/ixgbevf-${version}.tar.gz"; url = "mirror://sourceforge/e1000/ixgbevf-${version}.tar.gz";
sha256 = "1666hsavaspjmf45ij396mkndzk6g0n3ibr2glfdhjfqhfy35zb8"; sha256 = "0kq8y0944kaprw445wb8iswdck2jmc0xpkx0iv6idy3r5cc4hvyg";
}; };
nativeBuildInputs = kernel.moduleBuildDependencies; nativeBuildInputs = kernel.moduleBuildDependencies;