$30 off During Our Annual Pro Sale. View Details »

Contributing to the Linux Kernel

Contributing to the Linux Kernel

Umegbewe

March 24, 2022
Tweet

More Decks by Umegbewe

Other Decks in Programming

Transcript

  1. View Slide

  2. Contributing to
    the Linux Kernel
    Umegbewe Nwebedu
    TCI Technologies
    @nwebedu_junior

    View Slide

  3. Meet Great
    - Site Reliability Engineer @TCI
    - Linux & DevOps Aficionado
    - Started writing code & using Linux at 9
    - Wannabe Zuckerberg
    - Follow me on twitter @nwebedu_junior
    Umegbewe Nwebedu
    TCI Technologies
    @nwebedu_junior

    View Slide

  4. What to expect from this talk
    - Quick Introduction
    - Understanding how the Linux Kernel is developed (release
    cycles, active kernel releases, kernel trees
    - Configuring our development system
    - Explore Kernel Sources
    - Compiling and Installing a Kernel
    - Writing a Kernel Patch
    - Aftermath

    View Slide

  5. Why contribute to the Linux Kernel?
    - Linux is cool
    - Linux powers the world (Servers, The Cloud,
    Desktop? maybe this year.
    - By contributing your code you can add new
    functionality to the kernel
    - Why not?

    View Slide

  6. Linux != OS
    Linux is a kernel

    View Slide

  7. Open Source
    Festival 2022
    What is a Kernel?
    The Kernel is the most important part of an operating system
    The Kernel is responsible for low-level tasks such as disk management,
    memory management, task management, etc. It provides an interface
    between the user and the hardware components of the system. When a
    process makes a request to the Kernel, then it is called System Call.

    View Slide

  8. Open Source
    Festival 2022
    About the Linux Kernel
    - Monolithic
    - Modular
    - Free Software
    - Things happen, so panic type

    View Slide

  9. Open Source
    The term open source refers to something people can
    modify and share because its design is publicly accessible.

    View Slide

  10. Development
    Process
    It is a 24-hour, seven days a week, and 365 days of continuous open source development.
    the kernel uses a rolling development model which is continually integrating major
    changes that results in a new release once every 2+ months, and several stable and
    extended stable releases once a week.

    View Slide

  11. View Slide

  12. Open Source
    Festival 2022
    Developer
    Developer
    Developer
    Developer
    Developer
    Developer
    Maintainer
    Maintainer
    Maintainer
    Linus Torvalds

    View Slide

  13. September 15 5.3 stable release
    September 30 5.4-rc1, merge window closes
    October 6 5.4-rc2
    October 13 5.4-rc3
    October 20 5.4-rc4
    October 27 5.4-rc5
    November 3 5.4-rc6
    November 10 5.4-rc7
    November 17 5.4-rc8
    November 24 5.4 stable release

    View Slide

  14. Open Source
    Festival 2022
    Prepatch or RC (Release Candidate)
    Prepatch or "RC" kernels are mainline kernel pre-releases that are
    mostly aimed at other kernel developers and Linux enthusiasts. They
    must be compiled from source and usually contain new features that
    must be tested before they can be put into a stable release. Prepatch
    kernels are maintained and released by Linus Torvalds
    Active Releases

    View Slide

  15. Open Source
    Festival 2022
    Stable
    After a mainline kernel is released it is considered “stable”, and are bug
    fix-only release. Any bug fixes for a stable kernel are backported from the
    mainline kernel and applied to stable git by a designated stable kernel
    release maintainer. Stable kernel updates are released on average, once a
    week, or on an as needed basis.
    Active Releases

    View Slide

  16. Open Source
    Festival 2022
    Long Term
    Long-term releases are stable releases selected for long-term
    maintenance to provide critical bug fixes for older kernel trees.
    Only important bug fixes are applied to this long term releases and
    they don’t come frequently. E.g 5.10
    Active Releases

    View Slide

  17. Open Source
    Festival 2022
    Linux Kernel Versioning
    4: Kernel Version
    15: Major Revision
    0: Minor Revision
    39: Patch Level or number
    Generic:Linux distro/kernel specific additional info
    So my Linux kernel version is 4.15.0-39, where:

    View Slide

  18. Now let’s get to
    work

    View Slide

  19. Configuring our
    development system
    First things first right?

    View Slide

  20. - Check system requirements
    - Get needed tools
    - Configure tools
    - Configure mail client used to send patches (mutt,
    git-mail etc)

    View Slide

  21. Exploring Kernel
    Sources
    Repositories the Linux Kernel source code lives

    View Slide

  22. - Cregit
    - Check history of source files
    - Get Linux Mainline
    - Explore directories

    View Slide

  23. Compiling and
    Installing a Kernel
    Yes!!!

    View Slide

  24. - Get stable kernel
    - Configure kernel
    - Compile and Install kernel
    - Boot kernel

    View Slide

  25. Writing a Kernel Patch
    Yes!!!

    View Slide

  26. View Slide

  27. - Create a new branch to host our changes
    - Commit changes
    - Generate Patch
    - Run checkpatch.pl
    - Run get_maintainers.pl
    - Send patch

    View Slide

  28. View Slide

  29. Open Source
    Festival 2022
    Contribute your quota
    today 🚀🚀🚀

    View Slide

  30. Any Questions?
    Contact: [email protected]

    View Slide

  31. Beginners guide to Linux Kernel Development
    Linux Kernel Documentation
    Configuring Email Client for Kernel Development
    Check and Install required tools for Kernel Development
    Linux From Scratch Book
    Linux Kernel Development by Robert Love [BOOK]
    Appendix

    View Slide

  32. Thank
    you!
    Umegbewe Nwebedu
    TCI Technologies
    @nwebedu_junior

    View Slide