aboutsummaryrefslogtreecommitdiffstats
path: root/testing/aws-ena-driver-vanilla
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-03-05 10:51:22 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-03-05 11:23:33 +0000
commitc93cb784c174f65f3ac408a0a0450e516cbc4f58 (patch)
tree4521636f293dcdbeeed97cb4bd2f9023a3592ff1 /testing/aws-ena-driver-vanilla
parent0ed944b76c71ec1c5f68dd5ea05725c894ab826e (diff)
downloadaports-c93cb784c174f65f3ac408a0a0450e516cbc4f58.tar.bz2
aports-c93cb784c174f65f3ac408a0a0450e516cbc4f58.tar.xz
testing/aws-ena-driver-vanilla: cleanup
refactor it so it is more consistent with the other kernel drivers
Diffstat (limited to 'testing/aws-ena-driver-vanilla')
-rw-r--r--testing/aws-ena-driver-vanilla/APKBUILD59
1 files changed, 35 insertions, 24 deletions
diff --git a/testing/aws-ena-driver-vanilla/APKBUILD b/testing/aws-ena-driver-vanilla/APKBUILD
index 9ccd9e898e..80ab577443 100644
--- a/testing/aws-ena-driver-vanilla/APKBUILD
+++ b/testing/aws-ena-driver-vanilla/APKBUILD
@@ -1,24 +1,21 @@
# Maintainer: Mike Crute <mike@crute.us>
-_flavor="${FLAVOR:-hardened}"
-_pkgver=1.5.0
-_pkgrel=2
-
-# This APK is co-versioned with the kernel instead of using the upstream
-# version, so pull in the kernel pkg version as _kernver and kernel pkg rel as
-# _kernrel
-if [ -f ../../main/linux-${_flavor}/APKBUILD ]; then
- eval $(sed -n \
- -e '/^pkgver/s/^pkg/_kern/p' \
- -e '/^pkgrel/s/^pkg/_kern/p' \
- ../../main/linux-${_flavor}/APKBUILD)
-fi
-
-_kern_abi="${_kernver}-${_kernrel}-${_flavor}"
-
-pkgname="aws-ena-driver-${_flavor}"
-pkgver="${_kernver}"
-pkgrel="$(( ${_kernrel} + ${_pkgrel} ))"
+_name=aws-ena-driver
+_flavor=${FLAVOR:-vanilla}
+_kpkg=linux-$_flavor
+_kver=4.14.24
+_krel=0
+
+_kpkgver="$_kver-r$_krel"
+_kabi="$_kver-$_krel-$_flavor"
+
+_flavor="${FLAVOR:-vanilla}"
+_ver=1.5.0
+_rel=0
+
+pkgname=$_name-$_flavor
+pkgver=$_kver
+pkgrel=$(( $_krel + $_rel ))
pkgdesc="Linux Kernel driver for Elastic Network Adapter (ENA) family"
url="https://github.com/amzn/amzn-drivers"
arch="x86 x86_64"
@@ -26,21 +23,35 @@ license="GPL-2.0"
# Upstream has no tests
options="!strip !check"
depends=
-makedepends="linux-${_flavor}-dev=${_kernver}-r${_kernrel}"
+makedepends="linux-${_flavor}-dev=${_kver}-r${_krel}"
install=
-source="https://github.com/amzn/amzn-drivers/archive/ena_linux_${_pkgver}.tar.gz ena.conf"
-builddir="$srcdir/amzn-drivers-ena_linux_${_pkgver}"
+source="https://github.com/amzn/amzn-drivers/archive/ena_linux_${_ver}.tar.gz ena.conf"
+builddir="$srcdir/amzn-drivers-ena_linux_${_ver}"
+
+prepare() {
+ default_prepare
+ # verify the kernel version
+ local _kapkbuild=../../main/linux-$_pkgver/APKBUILD
+ if [ -f $_kapkbuild ]; then
+ ( . $_kapkbuild
+ pkgname=$_name-$_flavor
+ [ "$_kver" != "$pkgver" ] && die "please update _kver to $pkgver"
+ [ "$_krel" != "$pkgrel" ] && die "please update _krel to $pkgrel"
+ return 0
+ )
+ fi
+}
build() {
cd "$builddir/kernel/linux/ena"
- make BUILD_KERNEL="$_kern_abi"
+ make BUILD_KERNEL="$_kabi"
}
package() {
cd "$builddir/kernel/linux/ena"
install -Dm644 "$srcdir"/ena.conf "$pkgdir"/etc/modules-load.d/ena.conf
install -Dm644 ena.ko \
- "$pkgdir/lib/modules/${_kern_abi}/kernel/drivers/net/ethernet/amazon/ena/ena.ko"
+ "$pkgdir/lib/modules/${_kabi}/kernel/drivers/net/ethernet/amazon/ena/ena.ko"
}
sha512sums="32c3aee0aa806ffd1c6f78e3ce95c73699fd5fb0871a749d4ba54aba03390793ef92b4f76017d660bdf0907c91337d82b9570fffa93232f42becc240970310fa ena_linux_1.5.0.tar.gz