How to Collaborate on Linux Kernel Development
Total Page:16
File Type:pdf, Size:1020Kb
How to Collaborate on Linux Kernel Development Mauro Carvalho Chehab Linux Kernel Expert Samsung Research Brazil Samsung Open Source Group Oct 17, 2014 Not to be used for commercial purpose without getting permission Open Source Group – Silicon Valley All information, opinions and ideas herein are exclusively the author's own opinion © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Contributing to the Linux Kernel Copyright 2 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Copyright ● Authors have rights on the contents they produce: – Moral rights: the rights to claim its authorship on a work and to be against modified copies that would cause moral harm to the author; – Property rights: the ones that could generate profits (sell, distribute, publish, rent, copy, use). – Applies to intellectual work, like books, paintings, music, software ● Public domain – Something that was not copyrighted – No restrictions are imposed to its usage: anyone can copy, modify, use, etc 3 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Copyright x Public Domain ● A Copyright traditional model that doesn't help collaboration, as the holder of a copyright is typically the only one that benefits for its work. ● On the other hand, putting some work in public domain makes collaboration possible, but it would mean to loose all rights on such work. ● So, the Open Source movement came with a new concept, called Copyleft, where the author keep holding the rights on his work, while creating a hole community of developers helping to improve and to create new ways of using his work. The real gain with Open Source is to build an eco system that will keep the products well maintained, well supported and allowing new ways of usage. It is a trully win to win model. 4 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Copyleft ● It is a variant of the Copyright: the rights belong to the authors ● The author gives the right (via a software license) that allows copy, distribute, modify and usage ● Modified copies should also be licensed under the same copyleft license ● A violation to a copyleft license is a copyright violation Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Contributing to the Linux Kernel Licensing 6 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil GPL - version 2 (1) http://www.gnu.org/licenses/gpl-2.0.html ● The GNU General Public License is intended to guarantee your freedom to share and change free software – to make sure the software is free for all its users – Free software: freedom (not price) ● Freedom to distribute copies of free software – and charge for this service if you wish ● Receive source code or can get it if you want it ● Can change the software or use pieces of it in new free programs ● Rights remain the same after copied/modified: – If copies are distributed (whether gratis or for a fee): the recipients has all the rights that the distributor have; – The same license applies to distributed copies; 7 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil GPL - version 2 (2) http://www.gnu.org/licenses/gpl-2.0.html ● Rights protected by GPLv2: – Software is copyrighted; – It gives legal permission to copy, distribute and/or modify the software. – Moral rights protection: ● If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. – Patents: there are clauses stating that any patent must be licensed for everyone's free use or not licensed at all. 8 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil GPL License used on Kernel ● Kernel is licensed under GPL version 2 only ● There's an extra clause at Kernel that explicitly allows running userspace using other licenses: NOTE! This copyright does *not* cover user programs that use kernel services by normal system calls - this is merely considered normal use of the kernel, and does *not* fall under the heading of "derived work". Also note that the GPL below is copyrighted by the Free Software Foundation, but the instance of code that it refers to (the Linux kernel) is copyrighted by me and others who actually wrote it. 9 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Contributing to the Linux Kernel Interacting with an upstream development Community Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Netettiquete: email ● Most of the Open Source discussions happen via email; ● RTFM: Read The F#$& Fine Manual – Before sending something to a public ML, you should check first if your questions/patches/etc weren't already sent to it; ● Be polite; ● Be prepared for critics: – That's part of the game; ● Don't be offended by emails; ● Don't feed the Mailing List trolls. Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Warning: Don't mangle emails ● There are several important rules when sending emails to a public ML: – Always send emails in plain text: ● There are security issues on using html – most lists block it; – Never do top-posting: answers should be below questions ● Just the opposite way that Outlook does – Use an email client that won't mangle whitespaces ● Whitespace insert/removal would break patches ● Best option nowadays: use git send-email Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil The Development Model (1) ● Upstream development is dictated by the community, not by someone or some company – If someone (and/or their company) wants a feature, submit a patch ● The community reviews the patch; ● If community is happy, it gets merged, otherwise, it is rejected ● The development communities are huge, informal and open – All discussions are via mailing lists ● On Kernel, most lists are hosted at vger.kernel.org; – IRC and physical meetings (Summits and/or BoF – Birds of Feather) help to get agreements on more polemic items ● BoFs are informal and often formed in an ad hoc manner. ● IRC channels are generally hosted at freenode.net (or oftc.net) – Examples at Freenode: #tizen, #v4l, #linuxtv, #gstreamer 13 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil The Development Model (2) ● Contributions are open to everyone, and patches are publicly reviewed – Reviewing a patch internally inside a company is generally considered a bad habit, as the community won't give a single penny for such reviews made under black walls; ● On most packages, the version number indicates if the version is a review or a major change with API breakages, as specified at http://semver.org : – Given a version number MAJOR.MINOR.PATCH, increment the: ● MAJOR version when you make incompatible API changes, ● MINOR version when you add functionality in a backwards- compatible manner, ● PATCH version when you make backwards-compatible bug fixes. – NOTE: Not all projects follow it, including the Linux Kernel! Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Contributing to the Linux Kernel Interacting with the Kernel community Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil The Kernel Development Model (1) ● The Linux Kernel version number is, currently: – 3.x – For released Kernels; – 3.x.y – For stable fixes for a released Kernel; – 3.x-rcy – For Release Candidate Kernels (one per week); ● A new Linux Kernel version is released on every ~2 months – After a new release, 2 weeks are used to merge the features for the next one. This period of time is called: “merge window”; – A variable period (typically 6-8 weeks) is used to review the code. After each week, a new release candidate is released ● So, there are 3.16-rc1 to 3.16-rc7, plus 3.16 (the final version). ● Subsystem maintainers are responsible to collect the accepted patches, do a final review and submit them to Linus Torvards (the creator of Linux) and main maintainer. Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil The Kernel Development Model (2) 17 Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Interacting with the community Maintainers are like editors in the Publishing industry. - David Miller Linux Kernel Networking Maintainer TIP: please listen Greg K. H. presentation: I don't want your code: http://www.cnx-software.com/2013/03/07/linaro-connect-hk-greg-kroah-hartman-keynote-i-dont-want-your-code/ Open Source Group – Silicon Valley © 2014 SAMSUNG Electronics Co. Samsung Research Brazil Do I need a tough skin to be a kernel devel? ● The Linux kernel community is very technically brutal when it comes to code review. – a particular format that need the patches to fit, and newbies often get it wrong; – You should look at the patch format of several different commits in the git history; – Very high standard for coding style and the patch submission process. ● Subsystem maintainers can also be particularly picky when patches come in from a newbie – Since they've never seen code from you before, they don't know what the newbie's skill level; – Often, new contributors are held to higher standards than the long- term ones. (cont.) http://kernelnewbies.org/KernelDevViewpoint