* Re: [PR PATCH] [Updated] bbswitch: fix build with kernel 5.6+
2020-07-21 4:28 [PR PATCH] bbswitch: fix build with kernel 5.6+ mvf
@ 2020-07-21 6:26 ` mvf
2020-07-21 6:31 ` mvf
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mvf @ 2020-07-21 6:26 UTC (permalink / raw)
To: ml
[-- 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: 3305 bytes --]
From fac6c168dd1d161d7f7362eb954a7d8706d90ce1 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+
---
srcpkgs/bbswitch/patches/kernel-5.6.0.patch | 55 +++++++++++++++++++++
srcpkgs/bbswitch/template | 8 +--
2 files changed, 59 insertions(+), 4 deletions(-)
create mode 100644 srcpkgs/bbswitch/patches/kernel-5.6.0.patch
diff --git a/srcpkgs/bbswitch/patches/kernel-5.6.0.patch b/srcpkgs/bbswitch/patches/kernel-5.6.0.patch
new file mode 100644
index 00000000000..e88f1cad634
--- /dev/null
+++ b/srcpkgs/bbswitch/patches/kernel-5.6.0.patch
@@ -0,0 +1,55 @@
+From 4dbde5385f9c77155cc1ca57ce83bf64f9af2c4a 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] Use proc_ops structure for kernel version >= 5.6.0
+
+Since 5.6.0, proc_create requires a proc_ops* argument
+instead of file_operations*.
+Commit with the migrationin the kernel source can be found at
+https://github.com/torvalds/linux/commit/d56c0d45f0e27f814e87a1676b6bdccccbc252e9
+---
+ bbswitch.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git bbswitch.c bbswitch.c
+index 228d722..bbe50d0 100644
+--- bbswitch.c
++++ bbswitch.c
+@@ -35,6 +35,10 @@
+ #include <linux/suspend.h>
+ #include <linux/seq_file.h>
+ #include <linux/pm_runtime.h>
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++#include <linux/proc_fs.h>
++#endif
+
+ #define BBSWITCH_VERSION "0.8"
+
+@@ -375,6 +379,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 +395,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.26.1
+
diff --git a/srcpkgs/bbswitch/template b/srcpkgs/bbswitch/template
index 41e627f7406..56d003aaeaa 100644
--- a/srcpkgs/bbswitch/template
+++ b/srcpkgs/bbswitch/template
@@ -1,18 +1,18 @@
# Template file for 'bbswitch'
pkgname=bbswitch
version=0.8
-revision=2
+revision=3
+archs="i686 x86_64"
hostmakedepends="git"
makedepends="dkms"
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"
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}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PR PATCH] [Updated] bbswitch: fix build with kernel 5.6+
2020-07-21 4:28 [PR PATCH] bbswitch: fix build with kernel 5.6+ mvf
2020-07-21 6:26 ` [PR PATCH] [Updated] " mvf
@ 2020-07-21 6:31 ` mvf
2020-08-16 13:03 ` [PR REVIEW] " Piraty
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mvf @ 2020-07-21 6:31 UTC (permalink / raw)
To: ml
[-- 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: 3334 bytes --]
From 3aa9c5c5cd496950d2536483655853db76bf9c9d 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+
---
srcpkgs/bbswitch/patches/kernel-5.6.0.patch | 55 +++++++++++++++++++++
srcpkgs/bbswitch/template | 10 ++--
2 files changed, 60 insertions(+), 5 deletions(-)
create mode 100644 srcpkgs/bbswitch/patches/kernel-5.6.0.patch
diff --git a/srcpkgs/bbswitch/patches/kernel-5.6.0.patch b/srcpkgs/bbswitch/patches/kernel-5.6.0.patch
new file mode 100644
index 00000000000..e88f1cad634
--- /dev/null
+++ b/srcpkgs/bbswitch/patches/kernel-5.6.0.patch
@@ -0,0 +1,55 @@
+From 4dbde5385f9c77155cc1ca57ce83bf64f9af2c4a 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] Use proc_ops structure for kernel version >= 5.6.0
+
+Since 5.6.0, proc_create requires a proc_ops* argument
+instead of file_operations*.
+Commit with the migrationin the kernel source can be found at
+https://github.com/torvalds/linux/commit/d56c0d45f0e27f814e87a1676b6bdccccbc252e9
+---
+ bbswitch.c | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git bbswitch.c bbswitch.c
+index 228d722..bbe50d0 100644
+--- bbswitch.c
++++ bbswitch.c
+@@ -35,6 +35,10 @@
+ #include <linux/suspend.h>
+ #include <linux/seq_file.h>
+ #include <linux/pm_runtime.h>
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
++#include <linux/proc_fs.h>
++#endif
+
+ #define BBSWITCH_VERSION "0.8"
+
+@@ -375,6 +379,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 +395,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.26.1
+
diff --git a/srcpkgs/bbswitch/template b/srcpkgs/bbswitch/template
index 41e627f7406..d1446c2a0aa 100644
--- a/srcpkgs/bbswitch/template
+++ b/srcpkgs/bbswitch/template
@@ -1,18 +1,18 @@
# Template file for 'bbswitch'
pkgname=bbswitch
version=0.8
-revision=2
+revision=3
+archs="i686 x86_64"
hostmakedepends="git"
makedepends="dkms"
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}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PR REVIEW] bbswitch: fix build with kernel 5.6+
2020-07-21 4:28 [PR PATCH] bbswitch: fix build with kernel 5.6+ mvf
2020-07-21 6:26 ` [PR PATCH] [Updated] " mvf
2020-07-21 6:31 ` mvf
@ 2020-08-16 13:03 ` Piraty
2020-08-17 18:25 ` [PR PATCH] [Updated] " mvf
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Piraty @ 2020-08-16 13:03 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
New review comment by Piraty on void-packages repository
https://github.com/void-linux/void-packages/pull/23681#discussion_r471110565
Comment:
source?? (see for example: https://github.com/void-linux/void-packages/blob/18f61641a0d7fa0c07c1ecdd33fe918908adf7a6/srcpkgs/open-vm-tools/patches/0007-Use-configure-test-for-sys-stat.h-include.patch#L1 )
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PR PATCH] [Updated] bbswitch: fix build with kernel 5.6+
2020-07-21 4:28 [PR PATCH] bbswitch: fix build with kernel 5.6+ mvf
` (2 preceding siblings ...)
2020-08-16 13:03 ` [PR REVIEW] " Piraty
@ 2020-08-17 18:25 ` mvf
2020-08-17 18:34 ` [PR REVIEW] " mvf
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mvf @ 2020-08-17 18:25 UTC (permalink / raw)
To: ml
[-- 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}
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PR REVIEW] bbswitch: fix build with kernel 5.6+
2020-07-21 4:28 [PR PATCH] bbswitch: fix build with kernel 5.6+ mvf
` (3 preceding siblings ...)
2020-08-17 18:25 ` [PR PATCH] [Updated] " mvf
@ 2020-08-17 18:34 ` mvf
2020-08-19 16:12 ` Piraty
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: mvf @ 2020-08-17 18:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 442 bytes --]
New review comment by mvf on void-packages repository
https://github.com/void-linux/void-packages/pull/23681#discussion_r471691790
Comment:
Switched from the original upstream PR patch to the individual patches from [develop](https://github.com/Bumblebee-Project/bbswitch/tree/develop) and added `# upstream: yes`.
Is this patch metadata now a thing? It kinda makes sense, but so far you seem to be the only one doing this... :thinking:
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PR REVIEW] bbswitch: fix build with kernel 5.6+
2020-07-21 4:28 [PR PATCH] bbswitch: fix build with kernel 5.6+ mvf
` (4 preceding siblings ...)
2020-08-17 18:34 ` [PR REVIEW] " mvf
@ 2020-08-19 16:12 ` Piraty
2020-09-29 2:16 ` ericonr
2020-09-30 19:24 ` [PR PATCH] [Closed]: " Piraty
7 siblings, 0 replies; 9+ messages in thread
From: Piraty @ 2020-08-19 16:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 522 bytes --]
New review comment by Piraty on void-packages repository
https://github.com/void-linux/void-packages/pull/23681#discussion_r473146566
Comment:
> Is this patch metadata now a thing? <...> but so far you seem to be the only one doing this... thinking
Good point, not that i know of. If the source of a patch cannot be found/guessed trivially, i consider it bad practice to omit that reference (either in the commit message or the patch file)
Maybe it was just me not taking a look at develop branch to find that patch
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: bbswitch: fix build with kernel 5.6+
2020-07-21 4:28 [PR PATCH] bbswitch: fix build with kernel 5.6+ mvf
` (5 preceding siblings ...)
2020-08-19 16:12 ` Piraty
@ 2020-09-29 2:16 ` ericonr
2020-09-30 19:24 ` [PR PATCH] [Closed]: " Piraty
7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2020-09-29 2:16 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 166 bytes --]
New comment by ericonr on void-packages repository
https://github.com/void-linux/void-packages/pull/23681#issuecomment-700385068
Comment:
@Piraty ok to merge this?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PR PATCH] [Closed]: bbswitch: fix build with kernel 5.6+
2020-07-21 4:28 [PR PATCH] bbswitch: fix build with kernel 5.6+ mvf
` (6 preceding siblings ...)
2020-09-29 2:16 ` ericonr
@ 2020-09-30 19:24 ` Piraty
7 siblings, 0 replies; 9+ messages in thread
From: Piraty @ 2020-09-30 19:24 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 247 bytes --]
There's a closed pull request on the void-packages repository
bbswitch: fix build with kernel 5.6+
https://github.com/void-linux/void-packages/pull/23681
Description:
Been running this for a few months on 5.6.8. Also build-tested against 5.7.9.
^ permalink raw reply [flat|nested] 9+ messages in thread