summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Gathoye2017-06-10 15:32:28 +0200
committerWilliam Gathoye2017-06-10 16:03:06 +0200
commit357441cdee702ce8adeb7d8ff24db3bc69cec7be (patch)
tree2e286451def898dca46e3b43b590c3cb825c8857
parent275e4dae81d67f3c90335907a98b93e5f62b87ed (diff)
downloadaur-357441cdee702ce8adeb7d8ff24db3bc69cec7be.tar.gz
Get package features from asix-ax88179-dkms
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD64
-rw-r--r--asix-dkms.conf (renamed from dkms.conf)3
-rw-r--r--asix-dkms.install21
4 files changed, 52 insertions, 46 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 64ba9eaa948d..ed589baeb84e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,8 @@
pkgbase = asix-dkms
pkgdesc = Driver for USB ASIX Ethernet models AX88760 AX88772 AX88772A AX88772B AX88772C AX88178
pkgver = 4.20.0
- pkgrel = 1
+ pkgrel = 2
url = http://www.asix.com.tw/
- install = asix-dkms.install
arch = i686
arch = x86_64
license = GPL
@@ -11,13 +10,10 @@ pkgbase = asix-dkms
provides = asix-dkms
provides = asix-module
conflicts = asix-module
- options = !strip
source = http://asix.com.tw/FrootAttach/driver/AX88772C_772B_772A_760_772_178_LINUX_DRIVER_v4.20.0_Source.tar.gz
- source = dkms.conf
- source = asix-dkms.install
+ source = asix-dkms.conf
sha512sums = 1c51cba49481b7a7273019c9ce6fdf988cfbeeb270cef78a5722439f8fd0e07e9e05bc4983b81998724413df803f3aabe5a75d0367a0423751115e4c2f64009d
- sha512sums = c6230810dfe963452b89800f220713ef3c5539b27f5d2e94b302f51f3b5cd65ed364e7f326b2fb61fdfbe6b831909f2d50c88ce93c5805e3af3d280dc03f0fe1
- sha512sums = f6612ca32a5cd8848878b495bbb41e18fbe4ad442f3b2f81d53ef6fc2bcacc18cb188f96108abf76f514f026d3d45ba4134c2f3efed09d88b5718cbff62b6a41
+ sha512sums = ded1bed08f61ce207e394fc4f49345f0ea50639f53fb797907402b3503feecc485ba85fb799f2b3bc9c22cd4a250509c5eb99d4b36d42228a9475a9e7d67b293
pkgname = asix-dkms
diff --git a/PKGBUILD b/PKGBUILD
index 05d9972f2619..519706ec59b9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=asix-dkms
pkgver=4.20.0
-pkgrel=1
+pkgrel=2
pkgdesc="Driver for USB ASIX Ethernet models AX88760 AX88772 AX88772A AX88772B AX88772C AX88178"
arch=('i686' 'x86_64')
@@ -18,18 +18,15 @@ depends=('dkms')
provides=('asix-dkms' 'asix-module')
conflicts=("asix-module")
-install=${pkgname}.install
-options=(!strip)
-
_filename="AX88772C_772B_772A_760_772_178_LINUX_DRIVER_v${pkgver}_Source"
source=(
"http://asix.com.tw/FrootAttach/driver/${_filename}.tar.gz"
- "dkms.conf"
- "asix-dkms.install")
+ 'asix-dkms.conf'
+)
sha512sums=(
'1c51cba49481b7a7273019c9ce6fdf988cfbeeb270cef78a5722439f8fd0e07e9e05bc4983b81998724413df803f3aabe5a75d0367a0423751115e4c2f64009d'
- 'c6230810dfe963452b89800f220713ef3c5539b27f5d2e94b302f51f3b5cd65ed364e7f326b2fb61fdfbe6b831909f2d50c88ce93c5805e3af3d280dc03f0fe1'
- '534ea77f5aa8a008be53def7d45c5ccc89b0b36402d97ebdb71def59882a0b3655d95f2cac9ae16480b5e9ecd562f7acb9ad1c38b5e7fd7b4aa5edf94de4e7e6')
+ 'ded1bed08f61ce207e394fc4f49345f0ea50639f53fb797907402b3503feecc485ba85fb799f2b3bc9c22cd4a250509c5eb99d4b36d42228a9475a9e7d67b293'
+)
package() {
# We are in the source directory ./src/
@@ -39,15 +36,48 @@ package() {
installDir="$pkgdir/usr/src/${pkgname%-dkms}-${pkgver}"
install -dm755 "$installDir"
- install -m644 "$srcdir/dkms.conf" "$installDir"
- install -dm755 "$pkgdir/etc/modprobe.d"
- install -dm755 "$pkgdir/etc/modules-load.d"
- # Set name and version
- sed -e "s/@_PKGBASE@/${pkgname%-dkms}/" \
- -e "s/@PKGVER@/$pkgver/" \
- -i "$installDir/dkms.conf"
+ # The kernel from kernel.org does provide an outdated module asix.
+ # Arch Linux packages that module in their default kernel (normal + lts).
+ # We need to blacklist this module. This makes sure it is not loaded as
+ # ours will be conflicting with the default module.
+ install -dm755 "${pkgdir}/etc/modprobe.d"
+ install -m644 /dev/null \
+ "${pkgdir}/etc/modprobe.d/blacklist-asix.conf"
+ printf "blacklist asix\n" \
+ > "${pkgdir}/etc/modprobe.d/blacklist-asix.conf"
+
+ # Load asix-dkms automatically at boot
+ install -dm755 "${pkgdir}/etc/modules-load.d"
+ install -m644 /dev/null \
+ "${pkgdir}/etc/modules-load.d/asix-dkms.conf"
+ printf "${pkgname}\n" \
+ > "${pkgdir}/etc/modules-load.d/asix-dkms.conf"
+
+ # Patch dkms file and rename it to the mandatory dkms.conf filename.
+ install -m644 "${pkgname}.conf" "${installDir}/dkms.conf"
+ sed -e "s/@PKGVER@/${pkgver}/" \
+ -i "${installDir}/dkms.conf"
+
+ # Install module source
+ cd "${srcdir}/${_filename}"
+
+ # We could use a simple 'cp' here as even if we have a custom umask,
+ # makepkg is redefining his own umask value 0022.
+ # src.: https://git.archlinux.org/pacman.git/tree/scripts/makepkg.sh.in?id=4f2fea240d3039294f6614003206a3dd1f67cfc5#n1255
+ # Also, if we were using a simple 'cp', we would have relied upon upstream
+ # providing a tar archive with the rights we want (755 for folders and 644
+ # for files). While this is currently the case for now, if upstream does
+ # not respect these rights, here, we are making sure we have the rights we
+ # want.
+ # And use a 'while' loop with 'read' and process substitution to harden
+ # this script when special chars are used.
+ # src.: http://mywiki.wooledge.org/BashPitfalls#line-92
+ while IFS= read -r -d '' d; do
+ install -dm755 "${installDir}/$d"
+ done < <(find . -type d -print0)
- # Copy sources (including Makefile)
- cp -r "${_filename}"/* "$installDir/"
+ while IFS= read -r -d '' f; do
+ install -m644 "${srcdir}/${_filename}/$f" "${installDir}/$f"
+ done < <(find . -type f -print0)
}
diff --git a/dkms.conf b/asix-dkms.conf
index 7ca298abef03..c458c1a60728 100644
--- a/dkms.conf
+++ b/asix-dkms.conf
@@ -1,6 +1,7 @@
-PACKAGE_NAME="@_PKGBASE@"
+PACKAGE_NAME="asix-dkms"
PACKAGE_VERSION="@PKGVER@"
MAKE[0]="make"
BUILT_MODULE_NAME[0]="asix"
+DEST_MODULE_NAME[0]="asix-dkms"
DEST_MODULE_LOCATION[0]="/kernel/drivers/net/usb"
AUTOINSTALL="yes"
diff --git a/asix-dkms.install b/asix-dkms.install
deleted file mode 100644
index 968df3a1dc1c..000000000000
--- a/asix-dkms.install
+++ /dev/null
@@ -1,21 +0,0 @@
-# arg 1: the new package version
-post_install() {
- dkms install asix/${1%%-*}
-}
-
-# arg 1: the new package version
-# arg 2: the old package version
-pre_upgrade() {
- pre_remove ${2%%-*}
-}
-
-# arg 1: the new package version
-# arg 2: the old package version
-post_upgrade() {
- post_install ${1%%-*}
-}
-
-# arg 1: the old package version
-pre_remove() {
- dkms remove asix/${1%%-*} --all
-}