[Seek Help] How to compile kernel modules in Deepin?
poster avatar
2023-02-17 16:40

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
2023-02-20 18:14

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
    For me that meant 'wget' 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:
  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'
Reply View the author
2023-03-08 08:11

Thanks for your response

Enjoy your time with dino game

Reply View the author
2023-03-21 10:30

Get Linux kernel headers source code. You need running kernel source code; if you don't have a source code, download it from ... Candy Crush

Reply View the author
Use Markdown Editor