On Sun, 8 Sep 2019 03:01:04 +0300 Damian Ivanov <damianatorrpm@xxxxxxxxx> wrote: > What is the correct way to build the fedora kernel with a custom > patch added? >From an old post, modified for your use case: I use the older rpmbuild method, so I'm not sure how that agrees with the currently recommended method. Here goes. This is long, and a lot of the details are missing. Install the rpmbuild packages. Run rpmbuild-setuptree to build the rpmbuild directory tree in your home directory. Go to koji and get the kernel src.rpm Run rpm -ivh to install it to the rpmbuild directory. I then use screen to have a bunch of terms available, so I'm not constantly having to switch directories, but you could just switch between a bunch of virtual consoles. Go into the ~/rpmbuild/SPECS directory. You'll see kernel.spec in there. Run rpmbuild -bp kernel.spec to expand the source. When it is done, go into the ~/rpmbuild/BUILD/kernel[]/linux[]/ directory. Since fedora now builds all kernels from a git repository, it is necessary to build patches for them from that git repository. It's a PITA, but necessary. Run git add . Run git commit -a Just add a throwaway comment and save. Run git status. Everything should be up to date. Run git config user.name "blah" Run git config user.email "blah@xxxxxxxx" Run git branch muqss to create a new branch for the muqss linux kernel. Run git checkout muqss to set that as the working branch. Patch the working branch, muqss with the muqss patch. Run git add . Run git commit -a. Put in a comment and save. Run git status to be sure the branch is clean. Run git format-patch master Put the resulting patch in ~/rpmbuild/SOURCES with a unique numerical prefix. Make it look like the other patches in terms of directories at the top of the patch, give it a descriptive name, and change the subject to the descriptive name. Put the patch name in ~/rpmbuild/SPECS/kernel.spec just before END OF PATCHES. Run rpmbuild -bb kernel.spec You will have the kernel rpm files in ~/rpmbuild/RPMS/x86_64 Some details might be missing, but this should get you very close. _______________________________________________ kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx