[arch-commits] Commit in bbswitch/repos (5 files)

Frederik Schwan freswa at gemini.archlinux.org
Sat Aug 20 19:41:10 UTC 2022


    Date: Saturday, August 20, 2022 @ 19:41:09
  Author: freswa
Revision: 1271141

archrelease: copy trunk to community-staging-x86_64

Added:
  bbswitch/repos/community-staging-x86_64/
  bbswitch/repos/community-staging-x86_64/0001-proc_ops-struct.patch
    (from rev 1271140, bbswitch/trunk/0001-proc_ops-struct.patch)
  bbswitch/repos/community-staging-x86_64/0002-kernel-5.7.patch
    (from rev 1271140, bbswitch/trunk/0002-kernel-5.7.patch)
  bbswitch/repos/community-staging-x86_64/0003-kernel-5.18.patch
    (from rev 1271140, bbswitch/trunk/0003-kernel-5.18.patch)
  bbswitch/repos/community-staging-x86_64/PKGBUILD
    (from rev 1271140, bbswitch/trunk/PKGBUILD)

----------------------------+
 0001-proc_ops-struct.patch |   36 +++++++++++++++++++++++++++++
 0002-kernel-5.7.patch      |   11 +++++++++
 0003-kernel-5.18.patch     |   19 +++++++++++++++
 PKGBUILD                   |   52 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 118 insertions(+)

Copied: bbswitch/repos/community-staging-x86_64/0001-proc_ops-struct.patch (from rev 1271140, bbswitch/trunk/0001-proc_ops-struct.patch)
===================================================================
--- community-staging-x86_64/0001-proc_ops-struct.patch	                        (rev 0)
+++ community-staging-x86_64/0001-proc_ops-struct.patch	2022-08-20 19:41:09 UTC (rev 1271141)
@@ -0,0 +1,36 @@
+diff --unified --recursive --text bbswitch-0.8.orig/bbswitch.c bbswitch-0.8.new/bbswitch.c
+--- bbswitch-0.8.orig/bbswitch.c	2013-12-04 21:22:06.000000000 -0200
++++ bbswitch-0.8.new/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

Copied: bbswitch/repos/community-staging-x86_64/0002-kernel-5.7.patch (from rev 1271140, bbswitch/trunk/0002-kernel-5.7.patch)
===================================================================
--- community-staging-x86_64/0002-kernel-5.7.patch	                        (rev 0)
+++ community-staging-x86_64/0002-kernel-5.7.patch	2022-08-20 19:41:09 UTC (rev 1271141)
@@ -0,0 +1,11 @@
+diff -u -r bbswitch-0.8/bbswitch.c bbswitch-0.8-5.7/bbswitch.c
+--- bbswitch-0.8/bbswitch.c	2020-06-02 00:34:20.370571802 +0000
++++ bbswitch-0.8-5.7/bbswitch.c	2020-06-02 00:35:18.161403639 +0000
+@@ -29,6 +29,7 @@
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+ 
+ #include <linux/pci.h>
++#include <linux/proc_fs.h>
+ #include <linux/acpi.h>
+ #include <linux/module.h>
+ #include <asm/uaccess.h>

Copied: bbswitch/repos/community-staging-x86_64/0003-kernel-5.18.patch (from rev 1271140, bbswitch/trunk/0003-kernel-5.18.patch)
===================================================================
--- community-staging-x86_64/0003-kernel-5.18.patch	                        (rev 0)
+++ community-staging-x86_64/0003-kernel-5.18.patch	2022-08-20 19:41:09 UTC (rev 1271141)
@@ -0,0 +1,19 @@
+diff -u -r bbswitch-0.8/bbswitch.c bbswitch-0.8-5.18/bbswitch.c
+--- bbswitch-0.8/bbswitch.c	2022-05-24 20:26:22.184553495 +0000
++++ bbswitch-0.8-5.18/bbswitch.c	2022-05-24 20:29:00.797008130 +0000
+@@ -264,10 +264,15 @@
+     pci_disable_device(dis_dev);
+     do {
+         struct acpi_device *ad = NULL;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
++        ad = acpi_fetch_acpi_dev(dis_handle);
++        if (!ad) {
++#else
+         int r;
+ 
+         r = acpi_bus_get_device(dis_handle, &ad);
+         if (r || !ad) {
++#endif
+             pr_warn("Cannot get ACPI device for PCI device\n");
+             break;
+         }

Copied: bbswitch/repos/community-staging-x86_64/PKGBUILD (from rev 1271140, bbswitch/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2022-08-20 19:41:09 UTC (rev 1271141)
@@ -0,0 +1,52 @@
+# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
+# Contributor: M0Rf30
+# Contributor: Samsagax <samsagax at gmail.com>
+
+pkgbase=bbswitch
+pkgname=(bbswitch bbswitch-dkms)
+pkgver=0.8
+pkgrel=531
+pkgdesc="Kernel module allowing to switch dedicated graphics card on Optimus laptops"
+arch=('x86_64')
+url="http://github.com/Bumblebee-Project/bbswitch"
+license=('GPL')
+makedepends=('linux-headers')
+source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/Bumblebee-Project/bbswitch/archive/v${pkgver}.tar.gz"
+        0001-proc_ops-struct.patch 0002-kernel-5.7.patch 0003-kernel-5.18.patch)
+sha512sums=('11ab163931feb6c0e202d04c4552b848e999fedea9990390c26b28abdb4a69081ccfb5a22d1e390cc274f1c0cfc9adedc719c5fece14738b17aaa93e28865b7c'
+            '993a2895c37ea213c105be668f794af54838d8015d6f561ee6bc7ce65583425515931c83c2487ab97c14454105f233f089e8bdc90ea5ed9576be767335f57ad1'
+            '2eeae463b2f83e7744ff1a769cb6186389e026fc78668e836525dfd16a56abfae01cfb150c9bb46af74ec42e87ebea91636118fe0c773e7eaa7ea671b25d2e04'
+            'c658e0e8de95c678d1a3ea5659344fff9fce14a93e0f8da3f21f79dc9c820feb3c540e1892ffc10a444c96a768d6d3fecd684315988da5f401f5c6ef6f37be79')
+
+prepare() {
+  cd ${pkgbase}-${pkgver}
+  patch -Np1 < ../0001-proc_ops-struct.patch
+  patch -Np1 < ../0002-kernel-5.7.patch
+  patch -Np1 < ../0003-kernel-5.18.patch
+}
+
+build() {
+  cd ${pkgbase}-${pkgver}
+  make KDIR=/usr/src/linux
+}
+
+package_bbswitch() {
+  depends=('linux')
+
+  cd ${pkgbase}-${pkgver}
+  _extradir="/usr/lib/modules/$(</usr/src/linux/version)/extramodules"
+  install -Dt "${pkgdir}${_extradir}" -m644 *.ko
+  find "${pkgdir}" -name '*.ko' -exec strip --strip-debug {} +
+  find "${pkgdir}" -name '*.ko' -exec xz {} +
+}
+
+package_bbswitch-dkms() {
+  depends=('dkms')
+  conflicts=('bbswitch')
+  provides=('bbswitch')
+
+  cd ${pkgbase}-${pkgver}
+  install -Dt "${pkgdir}/usr/src/${pkgbase}-${pkgver}" -m644 Makefile bbswitch.c dkms/dkms.conf
+}
+
+# vim:set sw=2 noet:



More information about the arch-commits mailing list