I need to make some minor modifications to the kernel, but want to run PureOS. What's the easiest way to do that?

Basically, I have some unusual hardware that needs non-standard drivers + networking support in order to function, and they aren’t built into the PureOS kernel. I know what I need, and I know how to get it if I manually configure the kernel (which I had to do before when I installed Gentoo).

What I don’t know, is (practically speaking) how I can do that without partitioning + mounting a USB, compiling the kernel from scratch, installing the distro on top of that, installing grub, and then troubleshooting multiple disappointing failed boots until I finally get it right.

What is the easiest way to make a few, very minor changes to the kernel, but keep the rest of the OS exactly the same? Explicit terminal commands appreciated.

Good question, I too would like to know the answer.

For Librem 5 there is this thread:

For x86_64 I suppose it should work in the same way, except I don’t know where to get the source code in that case. (For the Librem 5 the kernel source code is here: https://source.puri.sm/Librem5/linux)

As far as I can tell, the PureOS repos at https://source.puri.sm/pureos do not include the kernel which I think means that PureOS uses some standard Debian kernel for which we should be able to get the source code from Debian somehow. But I don’t know how. Of course there is the mainline kernel source code from kernel.org but that does not tell us anything about the configuration used for PureOS and how to make it a deb package of a kind that would work for PureOS.

On my Librem 14, under /boot/ there are files called “config-” with different version numbers that contain kernel configuration options, so that’s something.