[Seek Help] How to compile kernel modules in Deepin?
Tofloor
poster avatar
k***n@blix-dahle.no
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***n@blix-dahle.no
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******ls@gmail.com
deepin
2023-03-09 00:11
#2
The user is banned, and the content is hidden.
la******32@gmail.com
deepin
2023-03-22 02:30
#3
The user is banned, and the content is hidden.
o***2@gmail.com
deepin
2023-04-03 18:56
#4
The user is banned, and the content is hidden.
b***6@outlook.com
deepin
2023-06-07 20:47
#5
The user is banned, and the content is hidden.
j***5@outlook.com
deepin
2023-06-27 00:10
#6
The user is banned, and the content is hidden.
z***i@gmail.com
deepin
2023-08-28 23:13
#7
The user is banned, and the content is hidden.
n***6@gmail.com
deepin
2023-09-26 19:07
#8
The user is banned, and the content is hidden.
f***2@gmail.com
deepin
2023-10-26 20:33
#9
The user is banned, and the content is hidden.
s***8@makobj.store
deepin
2024-04-16 15:20
#10
It has been deleted!