[Seek Help] How to compile kernel modules in Deepin?
Tofloor
poster avatar
k***[email protected]
deepin
2023-02-18 08:40
Author

To be able to fully use my Acer Aspire A514-55 with Deepin (20.8) I need to recompile 2 modules for the original running kernel after having modified uvc_driver.c and btusb.c. This is for the webcam (Quanta Computer, Inc. ACER HD User Facing) and bluetooth (Lite-On Technology Corp. Wireless_Device).

In Ubuntu I can run 'apt-get source linux-modules-extra-$(uname -r)' to get the source, but doing this on Deepin I get "E: Unable to find a source package for linux-modules-extra-5.18.17-amd64-desktop-community-hwe".

How can I do this in Deepin?

-Kolbjørn Blix

Reply Favorite View the author
All Replies
k***[email protected]
deepin
2023-02-21 10:14
#1

I've solved it myself, and I decided to share it here in case there are someone out there wanting to compile their own kernels for Deepin.

I started out with Deepin 20.8, running kernel 5.18.17-amd64-desktop-community-hwe. This kernel lacked support for both my bluetooth and webcam, so I needed to compile a new kernel after having modified those drivers.

  1. Download the appropriate kernel source from here https://kernel.org/
    For me that meant 'wget https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.18.17.tar.gz' into ~Downloads
  2. Next, I install the correct header files: 'sudo apt install linux-headers-5.18.17-amd64-desktop-community-hwe'
  3. Unpacking the source with 'tar zxvf inux-5.18.17.tar.gz'
  4. Then I modified the files in drivers/bluetooth and drivers/media/usb/uvc to enable the devices I was missing
  5. In linux-5.18.17, run 'make mrproper' to clean the source tree for old configs
  6. In linux-5.18.17, run 'yes '' | make localmodconfig' to take your current (running) .config and turn off any unused modules without asking all the questions
  7. To prevent the new kernel from getting the same name as the running (original) kernel, give it a dedicated local version by editing .config just created in item 6.
    Here's my part of the .config:
    CONFIG_LOCALVERSION="-amd64-desktop-community-hwe-blix"
  8. Next, start the compilation with 'make -j$(nproc)'
    This will use the amount od cores your PC has available to speed up the compilation
  9. After a successful compilation:
    'sudo make modules_install'
    'sudp make install'
    'reboot'
Reply View the author
ed******[email protected]
deepin
2023-03-09 00:11
#2
It has been deleted!
la******[email protected]
deepin
2023-03-22 02:30
#3
It has been deleted!
o***[email protected]
deepin
2023-04-03 18:56
#4
It has been deleted!
b***[email protected]
deepin
2023-06-07 20:47
#5
It has been deleted!
j***[email protected]
deepin
2023-06-27 00:10
#6
It has been deleted!
z***[email protected]
deepin
2023-08-28 23:13
#7
It has been deleted!
n***[email protected]
deepin
2023-09-26 19:07
#8
It has been deleted!
f***[email protected]
deepin
2023-10-26 20:33
#9
It has been deleted!
s***[email protected]
deepin
2024-04-16 15:20
#10
It has been deleted!
h***[email protected]
deepin
2024-10-28 11:13
#11
The user is banned, and the content is hidden.