The process was a little different for me due to patching and already having the source downloaded at compile time. So for patching a kernel from Gitlab I did the following:
-
Clone the desired kernel from the Manjaro Gitlab as described in realmain’s link above. Do not run compile yet.
-
Instead of
makepkg -s
, runmakepkg --nobuild
to retrieve sources -
Create patch file as described in the Arch Wiki page ‘Patching Packages’. Be sure to make copies of directories, etc. as described so paths are correct. Edit the .patch file you create and double check the paths!
-
Now skip step 7 of the first section, we don’t want to apply the patch manually, we want to use the compile-time patch system so proceed to the next section and add your .patch to the PKGBUILD file. All I had to do was add my motuavb.patch to the ‘sources’ section.
-
Run
updpkgsums
to generate new checksums -
Run
makepkg -Csf
to clean the directory and compile with patches -
Run
sudo pacman -U
on the .tar.xz packages that makepkg created. -
Reboot and enjoy your new patched kernel