Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error with latest Mint Linux kernel 6.8.0-40-generic #24

Open
gnatbandanna opened this issue Aug 11, 2024 · 2 comments
Open

Compile error with latest Mint Linux kernel 6.8.0-40-generic #24

gnatbandanna opened this issue Aug 11, 2024 · 2 comments

Comments

@gnatbandanna
Copy link

gnatbandanna commented Aug 11, 2024

Has been compiling and working fine until this latest update. See also: https://lore.kernel.org/linux-cve-announce/2024062047-CVE-2024-38620-64ef@gregkh/ which would imply this is not just a Mint issue, but an issue with all new kernels moving forward.

CC [M] /var/lib/dkms/macbook12-bluetooth/0.1/build/build/bluetooth/hci_ldisc.o
/var/lib/dkms/macbook12-bluetooth/0.1/build/build/bluetooth/hci_ldisc.c: In function 'hci_uart_register_dev':
/var/lib/dkms/macbook12-bluetooth/0.1/build/build/bluetooth/hci_ldisc.c:671:21: error: 'struct hci_dev' has no member named 'dev_type'
671 | hdev->dev_type = HCI_AMP;
| ^~
/var/lib/dkms/macbook12-bluetooth/0.1/build/build/bluetooth/hci_ldisc.c:671:34: error: 'HCI_AMP' undeclared (first use in this function); did you mean 'HCI_UP'?
671 | hdev->dev_type = HCI_AMP;
| ^~~~~~~
| HCI_UP
/var/lib/dkms/macbook12-bluetooth/0.1/build/build/bluetooth/hci_ldisc.c:671:34: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/macbook12-bluetooth/0.1/build/build/bluetooth/hci_ldisc.c:673:21: error: 'struct hci_dev' has no member named 'dev_type'
673 | hdev->dev_type = HCI_PRIMARY;
| ^~
/var/lib/dkms/macbook12-bluetooth/0.1/build/build/bluetooth/hci_ldisc.c:673:34: error: 'HCI_PRIMARY' undeclared (first use in this function); did you mean 'HCI_PRIVACY'?
673 | hdev->dev_type = HCI_PRIMARY;
| ^~~~~~~~~~~
| HCI_PRIVACY
make[3]: *** [scripts/Makefile.build:243: /var/lib/dkms/macbook12-bluetooth/0.1/build/build/bluetooth/hci_ldisc.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.8.0-40-generic/Makefile:1926: /var/lib/dkms/macbook12-bluetooth/0.1/build/build/bluetooth] Error 2
make[1]: *** [Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.8.0-40-generic'
make: *** [Makefile:10: all] Error 2

@AurelienMarin
Copy link

Hello,
I've had the same problem, it is indeed related to the Linux kernel.
I managed to get through it by deleting the relevant lines and then running
make && make install && reboot

@gnatbandanna
Copy link
Author

gnatbandanna commented Aug 21, 2024

Hello, I've had the same problem, it is indeed related to the Linux kernel. I managed to get through it by deleting the relevant lines and then running make && make install && reboot

Confirming that editing the two affected source files works for me as well. Thanks for the comment!

Edit to make things easier for others who find this. Here are two patches which live in the same location as install-bluetooth.sh:

hci_ldisc.patch:

--- build/bluetooth/hci_ldisc.c-orig	2024-03-10 15:38:09.000000000 -0500
+++ build/bluetooth/hci_ldisc.c	2024-08-22 08:59:17.762809493 -0500
@@ -667,11 +667,6 @@
 	if (!test_bit(HCI_UART_RESET_ON_INIT, &hu->hdev_flags))
 		set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
 
-	if (test_bit(HCI_UART_CREATE_AMP, &hu->hdev_flags))
-		hdev->dev_type = HCI_AMP;
-	else
-		hdev->dev_type = HCI_PRIMARY;
-
 	/* Only call open() for the protocol after hdev is fully initialized as
 	 * open() (or a timer/workqueue it starts) may attempt to reference it.
 	 */

hci_serdev.patch:

--- build/bluetooth/hci_serdev.c-orig	2024-03-10 15:38:09.000000000 -0500
+++ build/bluetooth/hci_serdev.c	2024-08-22 08:59:17.762809493 -0500
@@ -365,11 +365,6 @@
 	if (test_bit(HCI_UART_EXT_CONFIG, &hu->hdev_flags))
 		set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks);
 
-	if (test_bit(HCI_UART_CREATE_AMP, &hu->hdev_flags))
-		hdev->dev_type = HCI_AMP;
-	else
-		hdev->dev_type = HCI_PRIMARY;
-
 	if (test_bit(HCI_UART_INIT_PENDING, &hu->hdev_flags))
 		return 0;

Then, edit install-bluetooth.sh to add above the make command (around line 83):

patch -p0 <hci_ldisc.patch
patch -p0 <hci_serdev.patch

These changes will allow the install-bluetooth.sh command to work and compile as per the repository original instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants