Welcome to the Linux Foundation Forum!

Question about the base repository for patch creation: Mainline vs. linux-next?

Hi everyone,

I am currently taking the LFD103 course, and I noticed that in the kernel configuration and compilation section, it is recommended to use the mainline repository (torvalds/linux.git) to follow along with the exercises and create the first patch.

However, reading the kernel documentation and learning about real-world workflows, I see it is very common to use linux-next (or the subsystem's development tree, such as usb-next) to ensure patches are built against the latest code and avoid conflicts with changes already queued by maintainers.

I would like to clarify the recommended best practice for both the course context and future contributions:

For LFD103 exercises and assignments: Should I standardize creating all patches against the master branch of the mainline tree?

For submitting real patches to maintainers: Is the official recommendation to always use linux-next (or the subsystem tree), or are there specific cases where patches should be created directly against mainline?

Thank you in advance!

Best Answer

  • herman34
    herman34 Posts: 3
    Answer ✓

    For the LFD103 exercises, stick with the repository and branch the course specifies. The point there is to have a known baseline so the exercises and patches are reproducible. For real kernel work, its a bit different. You normally base a patch on the subsystem maintainer’s tree or the branch they ask you to use, rather than automatically using 'linux-next'. linux-next is mainly useful for testing how your changes interact with other work that is being developed, but it isn’t generally the tree you submit patches against. So the safest rule is: follow the course for LFD103, and for upstream work follow the maintainer/subsystem current contribution instructions.

Categories

Upcoming Training