From: mvf <mvf@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] bbswitch: fix build with kernel 5.6+
Date: Mon, 17 Aug 2020 20:25:39 +0200 [thread overview]
Message-ID: <20200817182539.QBwjjY6ozrBODxvyoEgagZXXWBOgyD3wvOEHzvOFOgg@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23681@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
There is an updated pull request by mvf against master on the void-packages repository
https://github.com/mvf/void-packages pr/bbswitch
https://github.com/void-linux/void-packages/pull/23681
bbswitch: fix build with kernel 5.6+
Been running this for a few months on 5.6.8. Also build-tested against 5.7.9.
A patch file from https://github.com/void-linux/void-packages/pull/23681.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pr/bbswitch-23681.patch --]
[-- Type: text/x-diff, Size: 4597 bytes --]
From 24e565cf6cbe12b09fcb16ffbf1c1f03bb1f9f78 Mon Sep 17 00:00:00 2001
From: Matthias von Faber <mvf@gmx.eu>
Date: Mon, 20 Apr 2020 18:09:01 +0200
Subject: [PATCH] bbswitch: fix build with kernel 5.6+
---
...s-structure-for-kernel-version-5.6.0.patch | 54 +++++++++++++++++++
| 28 ++++++++++
srcpkgs/bbswitch/template | 12 ++---
3 files changed, 87 insertions(+), 7 deletions(-)
create mode 100644 srcpkgs/bbswitch/patches/0001-Use-proc_ops-structure-for-kernel-version-5.6.0.patch
create mode 100644 srcpkgs/bbswitch/patches/0002-Add-missing-proc_fs.h-header.patch
diff --git a/srcpkgs/bbswitch/patches/0001-Use-proc_ops-structure-for-kernel-version-5.6.0.patch b/srcpkgs/bbswitch/patches/0001-Use-proc_ops-structure-for-kernel-version-5.6.0.patch
new file mode 100644
index 00000000000..6c758c00aa9
--- /dev/null
+++ b/srcpkgs/bbswitch/patches/0001-Use-proc_ops-structure-for-kernel-version-5.6.0.patch
@@ -0,0 +1,54 @@
+# upstream: yes
+
+From b0fdcfd847ecf5cbe6754b50f0db78600380b9f0 Mon Sep 17 00:00:00 2001
+From: Mateusz Mandera <mateusz.mandera@protonmail.com>
+Date: Tue, 31 Mar 2020 15:11:30 +0200
+Subject: [PATCH 1/2] Use proc_ops structure for kernel version >= 5.6.0
+
+Since 5.6.0, proc_create requires a `struct proc_ops *` argument instead
+of `struct file_operations *`.
+Commit with the migration in the kernel source can be found at
+https://github.com/torvalds/linux/commit/d56c0d45f0e27f814e87a1676b6bdccccbc252e9
+---
+ bbswitch.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git bbswitch.c bbswitch.c
+index 228d722..4ce9aae 100644
+--- bbswitch.c
++++ bbswitch.c
+@@ -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,6 +376,15 @@ static int bbswitch_pm_handler(struct notifier_block *nbp,
+ 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,
+@@ -382,6 +392,7 @@ static struct file_operations bbswitch_fops = {
+ .llseek = seq_lseek,
+ .release= single_release
+ };
++#endif
+
+ static struct notifier_block nb = {
+ .notifier_call = &bbswitch_pm_handler
+--
+2.28.0
+
--git a/srcpkgs/bbswitch/patches/0002-Add-missing-proc_fs.h-header.patch b/srcpkgs/bbswitch/patches/0002-Add-missing-proc_fs.h-header.patch
new file mode 100644
index 00000000000..4a51358ec06
--- /dev/null
+++ b/srcpkgs/bbswitch/patches/0002-Add-missing-proc_fs.h-header.patch
@@ -0,0 +1,28 @@
+# upstream: yes
+
+From ddbd243638c7bc2baecf43a78aff46cdc12e9b2e Mon Sep 17 00:00:00 2001
+From: Peter Wu <peter@lekensteyn.nl>
+Date: Tue, 26 May 2020 21:43:35 +0200
+Subject: [PATCH 2/2] Add missing proc_fs.h header
+
+Required for 'struct proc_ops' since v5.7-rc1 with commit df23e2be3d24
+("acpi: Remove header dependency").
+---
+ bbswitch.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git bbswitch.c bbswitch.c
+index 4ce9aae..c0c6713 100644
+--- bbswitch.c
++++ bbswitch.c
+@@ -35,6 +35,7 @@
+ #include <linux/suspend.h>
+ #include <linux/seq_file.h>
+ #include <linux/pm_runtime.h>
++#include <linux/proc_fs.h>
+ #include <linux/version.h>
+
+ #define BBSWITCH_VERSION "0.8"
+--
+2.28.0
+
diff --git a/srcpkgs/bbswitch/template b/srcpkgs/bbswitch/template
index 41e627f7406..6537447ec5a 100644
--- a/srcpkgs/bbswitch/template
+++ b/srcpkgs/bbswitch/template
@@ -1,18 +1,16 @@
# Template file for 'bbswitch'
pkgname=bbswitch
version=0.8
-revision=2
-hostmakedepends="git"
-makedepends="dkms"
+revision=3
+archs=noarch
depends="dkms"
-dkms_modules="${pkgname} ${version}"
-short_desc="kernel module allowing to switch dedicated graphics card on Optimus laptops"
+short_desc="Kernel module for disabling the nVidia GPU on Optimus laptops"
maintainer="Orphaned <orphan@voidlinux.org>"
-license="GPL-2"
+license="GPL-2.0-or-later"
homepage="http://github.com/Bumblebee-Project/bbswitch"
-archs="i686 x86_64"
distfiles="https://github.com/Bumblebee-Project/bbswitch/archive/v$version.tar.gz"
checksum=76cabd3f734fb4fe6ebfe3ec9814138d0d6f47d47238521ecbd6a986b60d1477
+dkms_modules="${pkgname} ${version}"
do_install() {
vinstall Makefile 644 usr/src/${pkgname}-${version}
next prev parent reply other threads:[~2020-08-17 18:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 4:28 [PR PATCH] " mvf
2020-07-21 6:26 ` [PR PATCH] [Updated] " mvf
2020-07-21 6:31 ` mvf
2020-08-16 13:03 ` [PR REVIEW] " Piraty
2020-08-17 18:25 ` mvf [this message]
2020-08-17 18:34 ` mvf
2020-08-19 16:12 ` Piraty
2020-09-29 2:16 ` ericonr
2020-09-30 19:24 ` [PR PATCH] [Closed]: " Piraty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200817182539.QBwjjY6ozrBODxvyoEgagZXXWBOgyD3wvOEHzvOFOgg@z \
--to=mvf@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).