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 0000000000..6c758c00aa --- /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 +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 + #include + #include ++#include + + #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 + diff --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 0000000000..4a51358ec0 --- /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 +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 + #include + #include ++#include + #include + + #define BBSWITCH_VERSION "0.8" +-- +2.28.0 + diff --git a/srcpkgs/bbswitch/template b/srcpkgs/bbswitch/template index 41e627f740..6537447ec5 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 " -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}