The Unix diff contains the path name to the file, that needs to be patched.
For kernel patches you usually need to stay on the toplevel directory of the kernel source tree.
And of course you need to have
- the kernel sources and the
- development system
installed on your system, which is not always the case.
And even if you stay in the correct directory the path names in the patch can still differ a little bit based on the directory structure and file organization of the developer.
See the discussion here: https://unix.stackexchange.com/question … hould-i-do
Should you see in the patch file, that original and modified files follow this directory pattern:
a/include/linux/pm_qos.h <--- the original file
b/include/linux/pm_qos.h <--- the modified file
then you need to execute the patch command with -p1 so that the 1st subdirectory "a/" and "b/" will be omitted for finding and patching the files, e.g.: patch -p1 < kernel.diff
Its no rocket science, you are only not used to work / think like a Unix power admin / developer ;-)
After patching the kernel sources, you need to recompile and install the kernel.
There are surely internet Wiki Pages available how to install kernel source and how to compile and install a new linux kernel.
On FreeBSD this was easy, something like: root# cd /usr/src/sys && make all install clean
Don't forget to become root on your system (might need sudo command) to have the "power" (needed rights on your system).
Some general information for recompiling kernels: https://unix.stackexchange.com/question … all-change
This seems to be the Debian way: https://kernel-team.pages.debian.net/ke … n-building
As the Debian documentation distinguishes a little bit whether to compile a new kernel either from Debian kernel source or from "pristine" kernel sources, see those chapters,
4.5. Building a custom kernel from Debian kernel source
4.6. Building a custom kernel from the "pristine" kernel source
it seems to be important to look whats the best way for "your Linux distribution".
Another good way to gather information is to look into the README file to this ALSA patch whether the author of this diff recommends a procedure how to compile and install the change.
Maybe a full recompile is not required maybe only a recompile of a kernel module ... check it out.
BR Ramses - UFX III, 12Mic, XTC, ADI-2 Pro FS R BE, RayDAT, X10SRi-F, E5-1680v4, Win11Pro22H2, Cub12