Thursday, April 14, 2022

[SOLVED] Debian: how to install a patched kernel?

Issue

I need to apply a tiny patch to my kernel (I am running Debian 10).
Then, I'd like to test that kernel, to make sure the change worked.

I do not want to uninstall my current, stable, working kernel, in case things fail and I need to return to it.

Towards that end, I am following this Debian guide. I successfully ran the test-patches script, which applied my patch and compiled the kernel.

This created some .deb files. But installing it fails — see below.

$ sudo dpkg -i linux-image-4.19.0-5-amd64-unsigned_4.19.37-5+deb10u2a~test_amd64.deb 
[sudo] password for jrw: 
Selecting previously unselected package linux-image-4.19.0-5-amd64-unsigned.
dpkg: considering removing linux-image-4.19.0-5-amd64 in favour of linux-image-4.19.0-5-amd64-unsigned ...
dpkg: no, cannot proceed with removal of linux-image-4.19.0-5-amd64 (--auto-deconfigure will help):
 linux-image-amd64 depends on linux-image-4.19.0-5-amd64
  linux-image-4.19.0-5-amd64 is to be removed.

dpkg: regarding linux-image-4.19.0-5-amd64-unsigned_4.19.37-5+deb10u2a~test_amd64.deb containing linux-image-4.19.0-5-amd64-unsigned:
 linux-image-4.19.0-5-amd64-unsigned conflicts with linux-image-4.19.0-5-amd64
  linux-image-4.19.0-5-amd64 (version 4.19.37-5+deb10u1) is present and installed.

dpkg: error processing archive linux-image-4.19.0-5-amd64-unsigned_4.19.37-5+deb10u2a~test_amd64.deb (--install):
 conflicting packages - not installing linux-image-4.19.0-5-amd64-unsigned
Errors were encountered while processing:
 linux-image-4.19.0-5-amd64-unsigned_4.19.37-5+deb10u2a~test_amd64.deb

Now, I suppose this makes some sense. I already have the 4.19 kernel installed, and so it conflicts with my new, slightly-patched 4.19 package?

But what's the standard procedure, here? How do I get the two kernels installed alongside each other?


Solution

Ultimately, I fixed this by tweaking the "abiname" setting in debian/config/defines. This causes it to create a package with a (slightly) different name from my installed one, so they can coexist side-by-side.

I got this advice from the Debian Kernel Mailing List



Answered By - jwd
Answer Checked By - Willingham (WPSolving Volunteer)