summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsukanka2020-04-14 00:37:30 +0800
committersukanka2020-04-14 00:37:30 +0800
commit8546581fe52e186f37b4061e559bf5f170552f8f (patch)
tree3d10dc04fb2ed42dc534fbe455bd5d299354616e
downloadaur-8546581fe52e186f37b4061e559bf5f170552f8f.tar.gz
add support for AMD iGPU
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD48
-rw-r--r--bbswitch-ati.install13
3 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..0263960511b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = bbswitch-ati-git
+ pkgdesc = kernel module allowing to switch also AMD integrated and Nvidia dedicated graphics card on Optimus laptops (Git version)
+ pkgver = v0.8.2.g9dd2270
+ pkgrel = 1
+ url = http://github.com/Bumblebee-Project/bbswitch
+ install = bbswitch-ati.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = linux-headers
+ makedepends = git
+ provides = bbswitch
+ conflicts = bbswitch
+ 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
+ sha256sums = SKIP
+ sha256sums = SKIP
+
+pkgname = bbswitch-ati-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..56061e343b9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: sukanka <su975853527@gmail.com>
+
+
+pkgname=bbswitch-ati-git
+pkgver=v0.8.2.g9dd2270
+pkgrel=1
+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')
+url='http://github.com/Bumblebee-Project/bbswitch'
+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'
+)
+sha256sums=('SKIP' 'SKIP')
+install=bbswitch-ati.install
+
+pkgver () {
+ cd "${srcdir}/${pkgname}"
+ git describe --always | sed 's|-|.|g'
+}
+
+build() {
+ kernel_ver=$(uname -r |cut -f1 -d'-')
+ cpu=$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq | cut -f2 -d' ')
+ cd "${srcdir}/${pkgname}"
+ if [ $kernel_ver > "5.6" ]; then
+ git apply "${srcdir}"/bbswitch-v0.8-proc_ops-struct.patch
+ echo 12225555
+ fi
+ if [ "$cpu" = "AMD" ]; then
+ echo "AMD integrated card detected"
+ echo "${srcdir}/${pkgname}"/bbswitch.c
+ sed -i 's/PCI_VENDOR_ID_INTEL/PCI_VENDOR_ID_ATI/g' "${srcdir}/${pkgname}"/bbswitch.c
+ fi
+ make
+}
+
+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"
+}
+
diff --git a/bbswitch-ati.install b/bbswitch-ati.install
new file mode 100644
index 00000000000..d1300b696ba
--- /dev/null
+++ b/bbswitch-ati.install
@@ -0,0 +1,13 @@
+post_install() {
+ EXTRAMODULES='$(uname -r)'
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
+