summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSukanka2020-05-16 11:27:46 +0800
committerSukanka2020-05-16 11:27:46 +0800
commit0253e74d0547ac67c542d5e435d4e11ed714583e (patch)
tree30d5786690f1c8b1981452e680cd2a7d1c191912
parent87196c9407a0bbc0015ba416b1f2898a5bbba07f (diff)
downloadaur-0253e74d0547ac67c542d5e435d4e11ed714583e.tar.gz
bug fix
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD20
-rw-r--r--bbswitch-ati.install13
-rw-r--r--bbswitch-v0.8-proc_ops-struct.patch37
4 files changed, 48 insertions, 27 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8835d513e06..e957f8fba4c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,8 @@
pkgbase = bbswitch-ati-git
pkgdesc = kernel module allowing to switch also AMD integrated and Nvidia dedicated graphics card on Optimus laptops (Git version)
pkgver = 0.8.2.g9dd2270
- pkgrel = 1
+ pkgrel = 2
url = http://github.com/Bumblebee-Project/bbswitch
- install = bbswitch-ati.install
arch = i686
arch = x86_64
license = GPL
@@ -14,7 +13,7 @@ pkgbase = bbswitch-ati-git
conflicts = bbswitch-dkms
conflicts = bbswitch-git-dkms
source = bbswitch-ati-git::git+https://github.com/Bumblebee-Project/bbswitch.git#branch=develop
- source = https://www.qua-it.org/XFCE/shots/share-with-pclos/pclos/bbswitch-v0.8-proc_ops-struct.patch
+ source = bbswitch-v0.8-proc_ops-struct.patch
sha256sums = SKIP
sha256sums = 3ebaf305628587fce64f64648f8ee6c1bc51e0eab855e1725538be995649a73c
diff --git a/PKGBUILD b/PKGBUILD
index 97c45e4e9a8..f063b7e9fb3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=bbswitch-ati-git
pkgver=0.8.2.g9dd2270
-pkgrel=1
+pkgrel=2
pkgdesc='kernel module allowing to switch also AMD integrated and Nvidia dedicated graphics card on Optimus laptops (Git version)'
arch=('i686' 'x86_64')
license=('GPL')
@@ -12,10 +12,9 @@ provides=('bbswitch')
conflicts=('bbswitch' 'bbswitch-dkms' 'bbswitch-git-dkms')
makedepends=('linux-headers' 'git')
source=("${pkgname}::git+https://github.com/Bumblebee-Project/bbswitch.git#branch=develop"
-'https://www.qua-it.org/XFCE/shots/share-with-pclos/pclos/bbswitch-v0.8-proc_ops-struct.patch'
+'bbswitch-v0.8-proc_ops-struct.patch'
)
sha256sums=('SKIP' '3ebaf305628587fce64f64648f8ee6c1bc51e0eab855e1725538be995649a73c')
-install=bbswitch-ati.install
pkgver () {
cd "${srcdir}/${pkgname}"
@@ -23,8 +22,8 @@ pkgver () {
}
build() {
- kernel_ver=$(uname -r |cut -f1 -d'-')
- cpu=$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq | cut -f2 -d' ')
+ kernel_ver=$(cut -f1 -d'-' /usr/src/linux/version)
+ cpu=$( grep name /proc/cpuinfo | uniq | cut -f2 -d: | cut -f2 -d' ')
cd "${srcdir}/${pkgname}"
if [ $kernel_ver > "5.6" ]; then
git apply "${srcdir}"/bbswitch-v0.8-proc_ops-struct.patch
@@ -32,14 +31,13 @@ build() {
if [ "$cpu" = "AMD" ]; then
sed -i 's/PCI_VENDOR_ID_INTEL/PCI_VENDOR_ID_ATI/g' "${srcdir}/${pkgname}"/bbswitch.c
fi
- make
+ make KDIR=/usr/src/linux
}
package() {
- cd ${srcdir}/${pkgname}
- _KERNELS=`uname -r`
- mkdir -p "${pkgdir}/usr/lib/modules/${_KERNELS}/extramodules"
- install -m644 bbswitch.ko "${pkgdir}/usr/lib/modules/${_KERNELS}/extramodules"
- gzip "${pkgdir}/usr/lib/modules/${_KERNELS}/extramodules/bbswitch.ko"
+ cd ${srcdir}/${pkgname}
+ _extradir="/usr/lib/modules/$(</usr/src/linux/version)/extramodules"
+ install -Dt "${pkgdir}${_extradir}" -m644 *.ko
+ find "${pkgdir}" -name '*.ko' -exec xz {} +
}
diff --git a/bbswitch-ati.install b/bbswitch-ati.install
deleted file mode 100644
index d1300b696ba..00000000000
--- a/bbswitch-ati.install
+++ /dev/null
@@ -1,13 +0,0 @@
-post_install() {
- EXTRAMODULES='$(uname -r)'
- depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
-}
-
-post_upgrade() {
- post_install
-}
-
-post_remove() {
- post_install
-}
-
diff --git a/bbswitch-v0.8-proc_ops-struct.patch b/bbswitch-v0.8-proc_ops-struct.patch
new file mode 100644
index 00000000000..f894ad571b6
--- /dev/null
+++ b/bbswitch-v0.8-proc_ops-struct.patch
@@ -0,0 +1,37 @@
+diff a/bbswitch.c b/bbswitch.c
+--- a/bbswitch.c 2013-12-04 21:22:06.000000000 -0200
++++ b/bbswitch.c 2020-04-01 12:02:35.518754892 -0300
+@@ -35,6 +35,7 @@
+ #include <linux/suspend.h>
+ #include <linux/seq_file.h>
+ #include <linux/pm_runtime.h>
++#include <linux/version.h>
+
+ #define BBSWITCH_VERSION "0.8"
+
+@@ -375,13 +376,23 @@
+ return 0;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++static struct proc_ops bbswitch_fops = {
++ .proc_open = bbswitch_proc_open,
++ .proc_read = seq_read,
++ .proc_write = bbswitch_proc_write,
++ .proc_lseek = seq_lseek,
++ .proc_release= single_release
++};
++#else
+ static struct file_operations bbswitch_fops = {
+ .open = bbswitch_proc_open,
+ .read = seq_read,
+ .write = bbswitch_proc_write,
+ .llseek = seq_lseek,
+ .release= single_release
+-};
++ };
++#endif
+
+ static struct notifier_block nb = {
+ .notifier_call = &bbswitch_pm_handler
+