bbswitch: added patch for >=5.18 kernel versions

This commit is contained in:
Matt Housh 2023-03-15 18:14:22 -05:00
parent 6ceea97830
commit db3a495411
3 changed files with 24 additions and 3 deletions

View File

@ -1,6 +1,7 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF3zYGAiVq30QZf30MYKBSIoXE0Ungkz0oIB1iETvK+9LSASdbiXh3OYISpMuoL5UI/s3zF+DjY8UpOyy4wtde+AQ=
SHA256 (Pkgfile) = 1a37df0336abd78e096b5eafbef3df0c515d7a4ae4e070ff1bd1a42327b1e721
RWSagIOpLGJF30dRVYn1U17vYs0kHbT3mE7M/lVu2k709qq5ZXYqiQeQYnPHol73GSFlqkq0JeUurrkfvu46Rxj9x3aKXwUwXwA=
SHA256 (Pkgfile) = 36dc4921576341d4705b3ba1fddc3ecd449a34f3eb1a7bbea49f31805974e825
SHA256 (.footprint) = 7440253c3fd2b9481f105ccb7585cab877c98be6b285c733695bdd6b51cbd459
SHA256 (bbswitch-0.8.tar.gz) = 76cabd3f734fb4fe6ebfe3ec9814138d0d6f47d47238521ecbd6a986b60d1477
SHA256 (bbswitch-kernel56.patch) = 29e3cc5b4f11c6760c99e385d04e3065414eaab36a7661cb3af8f093643498b4
SHA256 (acpi.patch) = 04061ecbee433de137d8e68cd42271a30c172bb87829cf350d50df1b24414139

View File

@ -6,11 +6,12 @@ name=bbswitch
version=0.8
release=1
source=(https://github.com/Bumblebee-Project/$name/archive/v$version/$name-$version.tar.gz \
$name-kernel56.patch)
$name-kernel56.patch acpi.patch)
build() {
cd $name-$version
patch -p1 -i $SRC/$name-kernel56.patch
patch -p1 -i $SRC/acpi.patch
make
install -D -m 0644 $name.ko $PKG/lib/modules/$(uname -r)/misc/$name.ko
}

19
bbswitch/acpi.patch Normal file
View File

@ -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;
}