# Maintainer: Jerry Xiao _srcname=iwlwifi-ax101 pkgname=${_srcname}-dkms pkgver=6.1.15 pkgrel=2 pkgdesc="Intel wireless chips driver fixed for ax101 from linux ($pkgver)" arch=('any') url="https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi" license=('GPL2') depends=('dkms') makedepends=('git') source=("https://mirrors.ustc.edu.cn/kernel.org/linux/kernel/v${pkgver%%.*}.x/linux-${pkgver}.tar.xz" "dkms.conf" "0001-ax101.patch") sha256sums=('2c16dfe2168a2e64ac0d55a12d625ebfb963818bb48b60c1868c7c460644c4fd' 'f17ed01e8bfb36dfbf62982a29ad87b5c4ac86d8a5b2fb33716f844c3ff12824' '4d3a12b9e44d4e8ef3b6dead7203f4b8798b2ec512109e1e0aa47264b24c7b75') extensions=() prepare() { cd "$srcdir/linux-$pkgver" cd drivers/net/wireless/intel/iwlwifi # https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1910510.html sed -i 's|$(srctree)/||' {d,m}vm/Makefile patch -p1 -i "$srcdir/0001-ax101.patch" } package() { # Install Kbuild #install -Dm644 Kbuild "${pkgdir}/usr/src/${_srcname}-${pkgver}/Kbuild" # Install dkms.conf install -Dm644 dkms.conf "${pkgdir}/usr/src/${_srcname}-${pkgver}/dkms.conf" # Install sources (including Makefile) cp -rT "linux-${pkgver}/drivers/net/wireless/intel/iwlwifi" "${pkgdir}/usr/src/${_srcname}-${pkgver}" # Set name and version sed -e "s/@PKGNAME@/${_srcname}/" \ -e "s/@PKGVER@/${pkgver}/" \ -i "${pkgdir}"/usr/src/${_srcname}-${pkgver}/dkms.conf # Add postinst and prerm scripts postinst="src/postinst" prerm="src/prerm" cat << EOF > "${srcdir}/postinst" dkms remove -m ${_srcname} -v ${pkgver} --all >/dev/null 2>&1 || true dkms add -m ${_srcname} -v ${pkgver} for d in /usr/lib/modules/*/build; do kver=\${d%/*} dkms install -m ${_srcname} -v ${pkgver} -k \${kver##*/} || true done EOF cat << EOF > "${srcdir}/prerm" for d in /usr/lib/modules/*/build; do kver=\${d%/*} dkms uninstall -m ${_srcname} -v ${pkgver} -k \${kver##*/} || true done dkms remove -m ${_srcname} -v ${pkgver} --all || true EOF }