# Contributor: Stefan Reimer # Maintainer: Stefan Reimer # https://awsdocs-neuron.readthedocs-hosted.com/en/latest/release-notes/runtime/aws-neuronx-dkms/index.html#neuron-driver-release-notes # curl https://apt.repos.neuron.amazonaws.com/dists/jammy/main/binary-amd64/Packages | grep dkms # pkgname=aws-neuron-driver # renovate: datasource=deb depName=aws-neuronx-dkms registryUrl=https://apt.repos.neuron.amazonaws.com?suite=jammy&components=main&binaryArch=amd64 pkgver=2.21.37.0 pkgrel=0 pkgdesc="Linux Kernel module for AWS Neuron INF instances" url="https://awsdocs-neuron.readthedocs-hosted.com/en/latest/release-notes/index.html#" arch="x86_64" license="GPL-2.0" makedepends="bash xz linux-headers linux-virt-dev" options="!check" source="$pkgname-$pkgver.deb::https://apt.repos.neuron.amazonaws.com/pool/main/a/aws-neuronx-dkms/aws-neuronx-dkms_"$pkgver"_all.deb" unpack() { ar -x "$srcdir/$pkgname-$pkgver.deb" && find . -type d -exec chmod 755 {} \; && tar xfJo data.tar.xz mv usr/src/aws-neuronx-"$pkgver" "$srcdir/$pkgname-$pkgver" rm -rf usr data.tar.xz control.tar.xz debian-binary # What is wrong with AWS ? find $srcdir/$pkgname-$pkgver -type d -exec chmod 755 {} \; } build() { # Hack running the build inside a container other uname -r returns host kernel KERNEL_VERSION=$(basename $(ls -d /lib/modules/*-virt)) unset CFLAGS CPPFLAGS CXXFLAGS unset LDFLAGS # patch for recent gcc warning/errors, cause AWS cannot be bothered apparently for f in neuron_dma.c neuron_sysfs_metrics.c v1/neuron_dhal_v1.c v2/neuron_dhal_v2.c; do sed -i -e 's/const static/static const/' $f done make KERNEL_SRC_DIR=/lib/modules/$KERNEL_VERSION/build } package() { KERNEL_VERSION=$(basename $(ls -d /lib/modules/*-virt)) depends="linux-virt~$(echo $KERNEL_VERSION | sed -e 's/-.*$//')" mkdir -p "$pkgdir"/lib/modules/$KERNEL_VERSION/kernel "$pkgdir"/lib/udev/rules.d gzip -9 -c neuron.ko > "$pkgdir"/lib/modules/$KERNEL_VERSION/kernel/neuron.ko.gz echo 'KERNEL=="neuron*", MODE="0666"' > "$pkgdir"/lib/udev/rules.d/90-neuron-udev.rules } sha512sums=" 039fddfc05ef9d2e36aa6611e39240598d1e75fe4999a2c3f8fe08e95fa98cb153897000a2948665fcb45b81f37171bd6702e8a3b2d63b6e262975d1bc5abf7b aws-neuron-driver-2.21.37.0.deb "