From db3a495411de3193acd37d65c4afc50f460c5b5b Mon Sep 17 00:00:00 2001 From: Matt Housh Date: Wed, 15 Mar 2023 18:14:22 -0500 Subject: [PATCH] bbswitch: added patch for >=5.18 kernel versions --- bbswitch/.signature | 5 +++-- bbswitch/Pkgfile | 3 ++- bbswitch/acpi.patch | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 bbswitch/acpi.patch diff --git a/bbswitch/.signature b/bbswitch/.signature index 16158fbc3..bbeed2a47 100644 --- a/bbswitch/.signature +++ b/bbswitch/.signature @@ -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 diff --git a/bbswitch/Pkgfile b/bbswitch/Pkgfile index 986dde14f..ff35386da 100644 --- a/bbswitch/Pkgfile +++ b/bbswitch/Pkgfile @@ -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 } diff --git a/bbswitch/acpi.patch b/bbswitch/acpi.patch new file mode 100644 index 000000000..07cecd4cd --- /dev/null +++ b/bbswitch/acpi.patch @@ -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; + }