To address the post you graciously found and posted here; I found the same documentation elsewhere and actually tried it.
Just today, after posting here, I went to chatGPT and got some of my answers and successfully managed to create a patch file with
git format-patch -1 (appending the hash from the commit's URL) after cloning the commit's git repository to my "/usr/src/" directory and
cd'ing to that new directory.
The command it suggested to run ended up being
git format-patch -1 286e937efbc7177c114e80aae9b402131e3886c1 - the hash embedded in the URL - while in that cloned directory.
Now I have my patch file which is meant to be run with the
patch -p1 < path/to/patch-x.y.z command, and that ended up being:
patch -p1 < /usr/src/platform-drivers-x86/0001-platform-x86-hp-wmi-support-omen-thermal-profile-pol.patch <--- the patch file.
But I didn't know where (which directory) to run that patch command in. Nowhere in the documentation you posted, nor anywhere in my searches and findings, have I seen any instruction on where to run this command. Or, if we are supposed to copy the patch file into another directory which contains the main kernel source. I was getting errors like: "can't find file to patch at input line 27
Perhaps you used the wrong -p or --strip option?"
So I tried running the same patch command while within the new cloned directory and while inside the kernel's source directory: No joy. When asked which directory do I need to be in when issuing the patch command and the answer was: "To patch the kernel you are currently running, you need to be in the root directory of the kernel source code. Typically, the source code for the kernel is located in
The only problem is, I don't have the "/linux" sub-directory that was indicated. So that's when I took a wild guess and just ran it in the currently used kernel's directory:
Once I did that (ran
patch -p1 < /usr/src/platform-drivers-x86/0001-platform-x86-hp-wmi-support-omen-thermal-profile-pol.patch in the "usr/src/linux-headers-6.2.1-060201-generic", all that seems to happen is the terminal hangs forever with a blinking cursor, never returning with a success or fail message, just an endless blinking cursor - same thing when I tried to run the command with the
-v flags. I opened up system monitor and
top and noticed high cpu usage, but all it seemed to be was the "tracker-store" and "tracker-extract" processes (system indexing). I was thinking these processes might have high CPU usage due to new files being moved to different directories which triggered indexing, but no matter how long I let the Terminal stay open, there was still no return message - just the lone, blinking cursor on a new line; it didn't even go back to the $USER@ beginner line (I don't know the correct terminology, sorry)
I just kinda gave up after a couple hours too, I'm sorry I don't have more for you on this. I hope sense can be gleaned from this posting
Oh, I also forgot to mention: I tried one other thing with the patch file (
0001-platform-x86-hp-wmi-support-omen-thermal-profile-pol.patch) that I created in the cloned repository's directory with
git format-patch -1 286e937efbc7177c114e80aae9b402131e3886c1 - I attempted to drag it into the
/usr/src/linux-headers-6.2.1-060201-generic directory and ran the same command to patch with
patch -p1 < /usr/src/platform-drivers-x86/0001-platform-x86-hp-wmi-support-omen-thermal-profile-pol.patch. What I got was more than just a blinking cursor on a new line:
GNU patch 2.7.6
Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc.
Copyright (C) 1988 Larry Wall
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Larry Wall and Paul Eggert
This is the header of the commit/patch file... but I can view that if I just go to the website or open up the file in my favorite text editor. There was no lines after that which indicated a success or failure to apply the patch.
I'm so at a loss right now, but it seems like I'm getting a little closer, if not a little more adept/knowledgeable with patching kernels...