diff options
author | ysblokje | 2022-07-03 10:52:13 +0200 |
---|---|---|
committer | ysblokje | 2022-07-03 10:52:13 +0200 |
commit | 2af4e1d8c785ac633b0bd327e4c452db7e66a0da (patch) | |
tree | 57814f29365003b3d04d5817dbc33f612ff40d4d | |
parent | c9c46359179a72b7860ea6582c5d3b7556c6c2b0 (diff) | |
download | aur-2af4e1d8c785ac633b0bd327e4c452db7e66a0da.tar.gz |
rtl 8125 driver without DKMS
I wanted a version that is more in line with the other r81xx driver
already in community.
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | PKGBUILD | 87 | ||||
-rw-r--r-- | dkms.conf | 8 | ||||
-rw-r--r-- | linux518.patch | 25 |
4 files changed, 80 insertions, 68 deletions
@@ -1,23 +1,17 @@ pkgbase = r8125 - pkgdesc = r8125 kernel driver for linux - pkgver = 9.003.05 + pkgdesc = A kernel module for Realtek r8125 network cards + pkgver = 9.009.01 pkgrel = 1 - url = https://www.realtek.com/ + url = http://www.realtek.com.tw arch = x86_64 - license = GPL2 + license = GPL makedepends = linux-headers - source = https://github.com/ibmibmibm/r8125/archive/9.003.05.tar.gz - source = dkms.conf - sha256sums = 75196ec98afcefbb6706307104d32131a27abba24ac333633790264968d548d6 - sha256sums = 7a6b42b6ebbd76ae3c40e10f824c2dae88448fab3ba074916b3be5c2b4bef448 + conflicts = r8125-dkms + source = https://codeberg.org/ysblokje/r8125/archive/9.009.01.tar.gz + source = linux518.patch + sha256sums = 4d36509ace216c954895751145c93914101ceba7945e6c7f1131f9970d2f8c7c + sha256sums = 8ef6947eafde2b69fd03f92c2ec4f789b1ecdbc6201a498d0a2c2fe4622fecea pkgname = r8125 - -pkgname = r8125-dkms - pkgdesc = r8125 kernel driver sources for linux - depends = dkms - optdepends = linux-headers: Build the module for Arch kernel - optdepends = linux-lts-headers: Build the module for LTS Arch kernel - provides = 8125=9.003.05 - conflicts = r8125 - + depends = glibc + depends = linux @@ -1,52 +1,53 @@ -# Maintainer: Shen-Ta Hsieh <ibmibmibm(at)gmail(dot)com> -# Contributor: Shen-Ta Hsieh <ibmibmibm(at)gmail(dot)com> - -_pkgbase=r8125 -pkgname=(r8125 r8125-dkms) -pkgver=9.003.05 +# Maintainer: Ysblokje < ysblokje at gmail com > +# Contributor: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com> +# +# Credits for the original version of this version of the file +# go to the r8168 package people + +pkgname=r8125 +pkgver=9.009.01 pkgrel=1 -pkgdesc="r8125 kernel driver for linux" +pkgdesc="A kernel module for Realtek r8125 network cards" +url="http://www.realtek.com.tw" +license=("GPL") arch=('x86_64') -url="https://www.realtek.com/" -license=('GPL2') -makedepends=(linux-headers) -source=("https://github.com/ibmibmibm/r8125/archive/${pkgver}.tar.gz" - 'dkms.conf') -sha256sums=('75196ec98afcefbb6706307104d32131a27abba24ac333633790264968d548d6' - '7a6b42b6ebbd76ae3c40e10f824c2dae88448fab3ba074916b3be5c2b4bef448') - -build() { - _kernver=$(</usr/src/linux/version) - - tar -xf "${pkgver}.tar.gz" - cd "${_pkgbase}-${pkgver}"/src - make -C "/lib/modules/${_kernver}/build" M="$(pwd)" modules +conflicts=('r8125-dkms') +makedepends=('linux-headers') +source=(https://codeberg.org/ysblokje/r8125/archive/${pkgver}.tar.gz + linux518.patch) +sha256sums=('4d36509ace216c954895751145c93914101ceba7945e6c7f1131f9970d2f8c7c' + '8ef6947eafde2b69fd03f92c2ec4f789b1ecdbc6201a498d0a2c2fe4622fecea') + +prepare() { + cd "$pkgname" + patch -Np1 -i ../linux518.patch } -package_r8125() { - # Install - _kernver=$(</usr/src/linux/version) - - msg2 "Starting make install..." - install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/extramodules" -m644 "${_pkgbase}-${pkgver}/src/r8125.ko" - find "${pkgdir}" -name '*.ko' -exec gzip -n {} + +build() { + cd "$pkgname" + # avoid using the Makefile directly -- it doesn't understand + # any kernel but the current. + make -C /usr/src/linux M="$PWD/src" \ + ENABLE_USE_FIRMWARE_FILE=y \ + CONFIG_R8168_NAPI=y \ + CONFIG_R8168_VLAN=y \ + CONFIG_ASPM=y \ + ENABLE_S5WOL=y \ + ENABLE_EEE=y \ + modules } -package_r8125-dkms() { - pkgdesc="r8125 kernel driver sources for linux" - depends=('dkms') - optdepends=('linux-headers: Build the module for Arch kernel' - 'linux-lts-headers: Build the module for LTS Arch kernel') - provides=("8125=$pkgver") - conflicts+=(r8125) - # Copy dkms.conf - install -Dm644 dkms.conf "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf +package() { + depends=('glibc' 'linux') - # Set name and version - sed -e "s/@_PKGBASE@/${_pkgbase}/" \ - -e "s/@PKGVER@/${pkgver}/" \ - -i "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf + local extradir=/usr/lib/modules/$(</usr/src/linux/version)/extramodules + cd "$pkgname" + install -Dt "$pkgdir$extradir" -m644 src/*.ko + find "$pkgdir" -name '*.ko' -exec strip --strip-debug {} + + find "$pkgdir" -name '*.ko' -exec xz {} + - # Copy sources (including Makefile) - cp -r ${_pkgbase}-${pkgver}/* "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/ + echo "blacklist r8169" | \ + install -Dm644 /dev/stdin "$pkgdir/usr/lib/modprobe.d/$pkgname.conf" } + +# vim:set sw=0 noet: diff --git a/dkms.conf b/dkms.conf deleted file mode 100644 index f4bf03438956..000000000000 --- a/dkms.conf +++ /dev/null @@ -1,8 +0,0 @@ -PACKAGE_NAME="@_PKGBASE@" -PACKAGE_VERSION="@PKGVER@" -MAKE="make -C $kernel_source_dir M=$source_tree/@_PKGBASE@-@PKGVER@/src modules" -CLEAN="make -C $kernel_source_dir M=$source_tree/@_PKGBASE@-@PKGVER@/src clean" -BUILT_MODULE_NAME[0]="@_PKGBASE@" -BUILT_MODULE_LOCATION[0]="src" -DEST_MODULE_LOCATION[0]="/kernel/drivers/net/ethernet/realtek" -AUTOINSTALL="yes" diff --git a/linux518.patch b/linux518.patch new file mode 100644 index 000000000000..47df10bb3503 --- /dev/null +++ b/linux518.patch @@ -0,0 +1,25 @@ +diff --git a/src/r8125_n.c b/src/r8125_n.c +index 0bc5eec..667b24b 100755 +--- a/src/r8125_n.c ++++ b/src/r8125_n.c +@@ -11952,11 +11952,20 @@ rtl8125_init_board(struct pci_dev *pdev, + + if ((sizeof(dma_addr_t) > 4) && + use_dac && ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) + !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && + !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) { ++#else ++ !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) && ++ !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) { ++#endif + dev->features |= NETIF_F_HIGHDMA; + } else { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) + rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); ++#else ++ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); ++#endif + if (rc < 0) { + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) + if (netif_msg_probe(tp)) |