[solved]Bullseye how can I keep my custom kernel

If none of the more specific forums is the right place to ask

[solved]Bullseye how can I keep my custom kernel

Postby LateToTheGame » 2020-02-26 01:38

I am running Bullseye. I had to modify the kernel module psmouse.ko to work with my touchpad. Being new at this, I couldn't figure out how to get the module to load automatically, so I recompiled the entire kernel. Everything works well, however I'm not sure when my next update/upgrade is going to replace the kernel. I'd like to "hold" my current kernel. After some searching, I think the following will work, but I want to check with some people that actually know what they are doing.

My compiled kernel
Code: Select all
john@pink:~$ uname -r
5.4.8


A list of installed packages starting with "linux-"
Code: Select all
john@pink:~$ dpkg -l | grep linux-
ii  binutils-x86-64-linux-gnu             2.33.1-6                             amd64        GNU binary utilities, for x86-64-linux-gnu target
ii  firmware-linux-free                   20200122-1                           all          Binary firmware for various drivers in the Linux kernel
ii  linux-base                            4.6                                  all          Linux image base package
ii  linux-compiler-gcc-9-x86              5.4.19-1                             amd64        Compiler for Linux on x86 (meta-package)
ii  linux-config-5.4:amd64                5.4.19-1                             amd64        Debian kernel configurations for Linux 5.4
ii  linux-headers-5.4.0-2-all-amd64       5.4.8-1                              amd64        All header files for Linux 5.4 (meta-package)
ii  linux-headers-5.4.0-2-amd64           5.4.8-1                              amd64        Header files for Linux 5.4.0-2-amd64
ii  linux-headers-5.4.0-2-cloud-amd64     5.4.8-1                              amd64        Header files for Linux 5.4.0-2-cloud-amd64
ii  linux-headers-5.4.0-2-common          5.4.8-1                              all          Common header files for Linux 5.4.0-2
ii  linux-headers-5.4.0-2-common-rt       5.4.8-1                              all          Common header files for Linux 5.4.0-2-rt
ii  linux-headers-5.4.0-2-rt-amd64        5.4.8-1                              amd64        Header files for Linux 5.4.0-2-rt-amd64
ii  linux-image-5.4.0-2-amd64             5.4.8-1                              amd64        Linux 5.4 for 64-bit PCs (signed)
ii  linux-image-5.4.8                     5.4.8-1                              amd64        Linux kernel, version 5.4.8
ii  linux-image-amd64                     5.4.8-1                              amd64        Linux for 64-bit PCs (meta-package)
ii  linux-kbuild-5.4                      5.4.19-1                             amd64        Kbuild infrastructure for Linux 5.4
ii  linux-libc-dev:amd64                  5.4.19-1                             amd64        Linux support headers for userspace development
ii  linux-source                          5.4.19-1                             all          Linux kernel source (meta-package)
ii  linux-source-5.4                      5.4.19-1                             all          Linux kernel source for version 5.4 with Debian patches
ii  util-linux-locales                    2.34-0.1                             all          locales files for util-linux


And this is what I think may work:
Code: Select all
sudo apt-mark hold linux-image-amd64


Any advice, corrections or help will be greatly appreciated! Thanks!!
Last edited by LateToTheGame on 2020-03-04 22:31, edited 2 times in total.
LateToTheGame
 
Posts: 7
Joined: 2019-03-03 23:16

Re: Bullseye Kernel Hold, how can I keep my custom kernel

Postby Deb-fan » 2020-02-26 03:23

Can set modules you want to auto-load in the /etc/modules file. Just add 1 per line and you don't need the .ko part. Just a FYI, someone can also black list modules they want to prevent from loading in /etc/modprobe.d files. Should/could already be some example .conf files there which make how to use this self explanatory. :)

Oops, just to anal, which installed kernel that boots can be choisen in /etc/default/grub file. Rather than trying to type it out on this phone keyboard just Google it. Be sure to always run the "sudo update-grub" command in terminal after editing that file. It says that prominently in the file itself though too.
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Re: Bullseye Kernel Hold, how can I keep my custom kernel

Postby LateToTheGame » 2020-02-29 11:34

Okay, I guess if I can't figure out how to get APT how to leave the kernel alone, I'll just build that module and insert it as you suggest. When I build the module without building the kernel I see a message that it is tainted and the original module loads instead. If what you suggests works like modprobe I should be okay. Thanks.
LateToTheGame
 
Posts: 7
Joined: 2019-03-03 23:16

Re: Bullseye Kernel Hold, how can I keep my custom kernel

Postby Deb-fan » 2020-02-29 11:46

Apt-mark can do it, dpkg can too. Kind of misunderstood your situation, thought the module you were needing to load was already available in stock kernels. The tainted thing yeah, see that all the time w compiled kernels. Never taken it as cause for real concern though. Welcome dude ... that other stuff is good to know anyway. :)

PS, if enabled, don't know if is or not in stock kernels etc. Someone can force load modules, though when see that word, force, seems something often better explored fully, likely avoided unless called for, blah blah. Still stuck on mobile and ya'll are lucky. I can type wall after wall and wave upon wave of text, while droning on about gnu/nix. Rumor has it I once made an anonymous nixer poke out they own eyeballs, just so they wouldn't have to see another of my forum posts!
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Re: Bullseye Kernel Hold, how can I keep my custom kernel

Postby LateToTheGame » 2020-02-29 16:28

Thanks again for your reply. I'm going to try the apt-mark command. Worst case is it doesn't work and my trackpad goes back to being broken. If so, I'll learn how to get that in tree module to load without recompiling the entire kernel.
LateToTheGame
 
Posts: 7
Joined: 2019-03-03 23:16

Re: Bullseye Kernel Hold, how can I keep my custom kernel

Postby stevepusser » 2020-03-01 01:47

Remove the linux-image-amd64 and linux-headers-amd64 metapackages, and your kernel and headers will stop being updated. Those metapackages always depend on the latest kernel and header packages in the repo.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Kodi 18.6, Blender 2.8.2, 5.5 kernels, Chromium with va-api, Telegram-desktop 1.9.21, Foliate 2.0.0
User avatar
stevepusser
 
Posts: 11573
Joined: 2009-10-06 05:53

Re: Bullseye Kernel Hold, how can I keep my custom kernel

Postby Deb-fan » 2020-03-01 02:07

Yeppers removing packages are a sure fired way to ensure they never get updated too o course. Keeping a stock kernel around is just good juju imo anyway. Am sure there's plenty of other relevant stuff or other approaches which could be pertinent here, comes to gnu/nix when isn't that the case, lol. Still +1 Stevep. :)

Much signal to noise goodness was maintained in this puppy. Now watch it sink into the cyberspace abyss, where only 29 people will ever see it again. :p

DAMMIT Edit: Apt-pinning also works for this kind of thing. Hesitate even bringing it up now with the don't break Debian crowd constantly harping about it. Even if it works great. Also trying some newer kernels/firmware from backports (or wherever) could help in particular if it's newerish hardware.
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Re: Bullseye Kernel Hold, how can I keep my custom kernel

Postby LateToTheGame » 2020-03-04 22:29

That's a clever solution. I'll try that!
LateToTheGame
 
Posts: 7
Joined: 2019-03-03 23:16

Re: [solved]Bullseye how can I keep my custom kernel

Postby stevepusser » 2020-03-05 04:01

My preferences would be to make that source code change into a Debian patch and just keep adding it to rebuilds of the newer Debian kernels. Staying on one kernel will inevitably lead to security vulnerabilities. If the rebuilds are tough on your hardware, they can be done on the OBS: https://build.opensuse.org/package/show ... source-5.4

Debian has a built-in system to convert changes in source code into a patch, with "dpkg-source --commit" in the debianize source code root directory.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Kodi 18.6, Blender 2.8.2, 5.5 kernels, Chromium with va-api, Telegram-desktop 1.9.21, Foliate 2.0.0
User avatar
stevepusser
 
Posts: 11573
Joined: 2009-10-06 05:53


Return to General Questions

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable