summaryrefslogtreecommitdiff
blob: 04db47eb4f2cac38d5066133e0e119a3c10656bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

inherit linux-info linux-mod

DESCRIPTION="Amazon EC2 Elastic Network Adapter (ENA) kernel driver"
HOMEPAGE="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking-ena.html"
SRC_URI="https://github.com/amzn/amzn-drivers/archive/ena_linux_${PV}.zip -> ${P}-linux.zip"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"

S="${WORKDIR}/amzn-drivers-ena_linux_${PV}/kernel/linux/ena"

MODULE_NAMES="ena(net:${S}:${S})"
BUILD_TARGETS="all"

pkg_setup() {
	linux-mod_pkg_setup
	BUILD_PARAMS="CONFIG_MODULE_SIG=n KERNEL_DIR=${KV_DIR}"
}

src_prepare() {
	eapply_user

	sed -i -e 's!/lib/modules/\$(BUILD_KERNEL)/build!$(KERNEL_DIR)!g' \
		"Makefile" || die "Unable to fix Makefile"
}

src_install() {
	linux-mod_src_install
	dodoc README RELEASENOTES.md
}