Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Linux Kernel - Let's contribute

Linux Kernel - Let's contribute

Slides of the talk I did at LinuxWochen Wien 2014.
This talk will give you a quick introduction to Linux kernel development. During the talk we will explore some options of contribution, including random configurations, stable-testing, RC-testing and actual coding! By the end of the talk we will post a basic patch to the developers as well.

Fb4425e0f0a4c14c5a79653b861f6cfc?s=128

Levente Kurusa

May 10, 2014
Tweet

Transcript

  1. Let's contribute! Levente Kurusa Presented by Fedora Project Hungary <levex@linux.com>

    Licensed under CC-BY-SA Linux Kernel
  2. Topics 1. Quick introduction 2. Random configurations 3. Kernel testing

    a. Stable kernels b. RC kernels 4. Checkpatch patches
  3. Quick introduction

  4. Linux powers the world! Servers! The cloud! Desktop? Maybe this

    year? Open source contribution is always a big plus when it comes to job search! Linux is cool! Why not? Why?
  5. 86% say Linux advanced their career 93% of HR will

    recruit a Linux pro next year 75% already received a call this year! Interesting projects! Greater pay check! (+10% this year) Some statistics
  6. First steps Fetch the Linux kernel source code For random

    configurations: linux-next http://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git For stable testing: linux-stable http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git For Rcs, simply clone down Linus' tree http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  7. Eudyptula Challenge http://eudyptula-challenge.org/ Series of programming tasks Hard, but fun!

  8. Linux-next The current state of the kernel Merged together by

    Stephen Rothwell An excellent opportunity to start Default configurations are tested
  9. Linux-stable Collection of important patches to old kernel release Backports

    needed! Maintained by Greg KH and others Documentation/stable_kernel_rules.txt
  10. Random configurations

  11. Randomized configurations of the kernel Often have a lot of

    problems GCC warnings GCC errors kconfig errors/warnings They sometimes don't even boot Extremely useful! What are randconfigs?
  12. $ make randconfig Completely nonsense config! Try to build it:

    $ make -j`nproc` Your first randconfig
  13. Possible errors Undeclared functions Kconfig circular dependencies Boot failure Test

    in emulator!
  14. Kernel testing

  15. Run the latest kernel Quite easy! $ make defconfig $

    make localmodconfig $ make -j`nproc` # make headers_install # make install # reboot
  16. Actual testing If you test linux-stable ... and things break:

    Report it! ... if nothing breaks: Break it! (repeat) If you test linux-next ... it's risky to try on your computer
  17. Actual testing I use my own tiny project. LATTE –

    Linux Automatic Testing Tool for Expert (https://github.com/levex/latte) Emulators are great. Benchmarks are also fun. perf
  18. perf # perf list # perf record <command> # perf

    report # perf stat -e <event>
  19. Sending your first patch • Also known as: Checkpatch patches

  20. Checkpatch? scripts/checkpatch.pl Checks for common errors in the patch ...

    and files with the --file switch Not just coding style, but bugs as well!
  21. Getting maintainers scripts/get_maintainer.pl Gives you a list of maintainers for

    that particular patch or file ... or you can manually browse through the MAINTAINERS file
  22. Creating the patch $ git reset --hard HEAD [work...] $

    git diff [review work...] $ git commit -as $ git format-patch -1 … and then the hardest part
  23. Sending it 9 out of 10 will fail this step

    git send-email Thunderbird and such can do it as well, but it's hard to configure them properly.
  24. People on LKML are grumpy! Don't be afraid to ask

    RTFM Summary
  25. Any questions? Licensed under CC-BY-SA <levex@linux.com> @ilevex Contact: