SlideShare ist ein Scribd-Unternehmen logo
1 von 24
U-boot Source Code Clean
        Up Project
          and
         How-to

  Recruiting Volunteers!
        Macpaul Lin
        (2012/08/18)
Outline
• Why do we do clean up?
• Who should join the clean up project?
  And How will you be benefited with it?
• How to do the clean up work?
• Summary.
Why do we do clean up?
• U-boot is old.
  – It is an old boot loader project and widely be
    used in various embedded systems.
  – There are many dirty historical codes. Linux
    has them, too.
• Coding style are mixed.
  – It supports booting OS from various different
    devices which leverage codes from various
    open source projects. Such as dlmalloc, Linux,
    and etc.
Why do we do clean up?
• Developers usually get confused.
  – Some coding style really introduce problem
    when doing debugging.
  – New contributor usually get confused between
    old and new coding style.
    • This usually lead unnecessary time cost when
      developers reviewing and fixing their patches.
Why do we do clean up?
• It follows Linux coding style.
• However, since u-boot has long history just
  like Linux kernel, source codes some were
  dirty and need to be clean up.
• New comers and new contributors usually
  reference the old coding style. Hence the
  patch is usually need to be reworked and
  viewers spent lots of effort on replying mail.
Who should join the clean up project
  and how will you be benefits with it?
• U-boot uses git and mailing list to
  management the source code developing.
  – Student who wants to be familiar with git
    source version control.
  – Student who wants to join a open source
    project and practice with patch commitment
    mailing discussion.
  – People who is interested in boot loader with
    embedded device development environments.
How to do the clean up work?
• U-boot project uses the checkpatch.pl in
  Linux kernel to check the patches.
• Clean up patches must obey both Linux
  coding style and u-boot coding style.
• Coding style
  – http://www.denx.de/wiki/U-Boot/CodingStyle

• Patch rules
  – http://www.denx.de/wiki/U-Boot/Patches
Steps to join u-boot project
1. Sign-up the mailing list
2. Clone the source code
3. Use checkpatch.pl to check the old
codes.
4. Fix warnings reported by checkpatch.pl
5. Use git send-email to commit the
cleanup back to mailing list.
6. Fix your patch if maintainer give you
suggestion to fix.
1. Sign-up the mailing list
• Subscribe
  http://lists.denx.de/mailman/listinfo/u-boot




                                      Don't choose "yes"
                                    because maintainers
                                will reply your patch by mail.
2. Clone the source code
• Clone the source code
  – git clone git://git.denx.de/u-boot.git u-boot.git
• Setting git users and email
  – git config --global user.name "yourname";
  – git config --global user.email "you@youremail";
• Make a working branch
  – cd u-boot.git
  – git branch cleanup
• Checkout the working branch and getting start
  – git checkout cleanup
3. Use checkpatch.pl to check
         the old codes.
• Once you finish a patch, use
  tools/checkpatch.pl to verify the patch is
  clean before send it out.
• So we can use this checkpatch.pl to check
  if the current files are clean.
• Most of the old code is inside “common
  folder".
3. Use checkpatch.pl to check
         the old codes.
• 3.0 Export the path of checkpatch.pl into
  $PATH
  – export PATH=$PATH:~/u-boot.git/tools
3. Use checkpatch.pl to check
         the old codes.
• 3.1 find a unclean file in folder “common”
  – For example: "bedbug.c"
  – cd common
• 3.2 copy it as a backup
  – cp bedbug.c bedbug.c.bak
3. Use checkpatch.pl to check
         the old codes.
• 3.3 remove “bedbug.c” as commit 'A'
  because we will check the whole file later
  – git rm bedbug.c
  – git commit -s
     • Input some reason because this is just a temporary
       work.
3. Use checkpatch.pl to check
         the old codes.
• 3.4 now we recover the unclean file and
  make this as a commit 'B'.
  – mv bedbug.c.bak bedbug.c
  – git add bedbug.c
  – git commit -s
    • Input the real commit log.
4. Fix warnings reported by
           checkpatch.pl
• 4.1 Create a folder for this commit 'B'
  – mkdir patch
  – cd patch
• 4.2 Export this commit 'B' (the latest
  commit) and use checkpatch.pl to get the
  report.
  – git format-patch HEAD~1

  – checkpatch 0001-cosmetic-add-bedbug.c-
    back.patch
4. Fix warnings reported by
           checkpatch.pl
• 4.3 You will get the report from checkpatch.
4. Fix warnings reported by
           checkpatch.pl
• 4.4 Now you can fix all the error of
  bedbug.c with your favorite editor based on
  this report.
  – cd .. (back to “common" folder)
  – vim bedbug.c
  – (you can also use “git diff” to check your
    changes)
4. Fix warnings reported by
           checkpatch.pl
• 4.5 Create a clean commit "C" as the result
  of your work.
  – git add debug.c
  – git commit -s
4. Fix warnings reported by
           checkpatch.pl
• 4.6 Now you have 3 commits “A,B,C” in
  "cleanup" branch
4. Fix warnings reported by
           checkpatch.pl
• 4.7 We only need the last commit "C" to
  send back to mailing list.
  – Remove commit "B" in patch folder
    • rm patch/0001-cosmetic-add-bedbug.c-back.patch
  – Export the final patch commit "C"
    • cd patch
    • git format-patch HEAD~1

  – Use checkpatch.pl to check it again.
    • checkpatch 0001-cosmetic-clean-up-common-
      bedbug.c-by-checkpatch.pl.patch
5. Use git send-email to commit
 the cleanup back to mailing list.
• 5.1 Finally send the patch out.
  – git send-email 0001-cosmetic-clean-up-
    common-bedbug.c-by-checkpatch.pl.patch
  – Remember add maintainers to “To:” list to
    review the patch.
6. Fix your patch if maintainer
    give you suggestion to fix.
• After a maintainer reviewed your patch, he
  will reply your mail to inform you if the
  patch has been accepted or the patch is
  still need to be fixed.
Summary
• There are many old-style codes need to be
  cleaned up. We need your help.
• Please join u-boot project.
  – Just subscribe
    http://lists.denx.de/mailman/listinfo/u-boot

Weitere ähnliche Inhalte

Was ist angesagt?

Upgrading CentOS on the Facebook fleet
Upgrading CentOS on the Facebook fleetUpgrading CentOS on the Facebook fleet
Upgrading CentOS on the Facebook fleetDavide Cavalca
 
Introduce fuego
Introduce fuegoIntroduce fuego
Introduce fuegos60030
 
.NET on Linux: Entity Framework Core 1.0
.NET on Linux: Entity Framework Core 1.0.NET on Linux: Entity Framework Core 1.0
.NET on Linux: Entity Framework Core 1.0All Things Open
 
Distro Recipes 2013 : Upstream management and consequences on the distributi...
Distro Recipes 2013 : Upstream management and consequences on the  distributi...Distro Recipes 2013 : Upstream management and consequences on the  distributi...
Distro Recipes 2013 : Upstream management and consequences on the distributi...Anne Nicolas
 
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s goingKernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s goingAnne Nicolas
 
Kernel Recipes 2016 - The kernel report
Kernel Recipes 2016 - The kernel reportKernel Recipes 2016 - The kernel report
Kernel Recipes 2016 - The kernel reportAnne Nicolas
 
Brief introduction to kselftest
Brief introduction to kselftestBrief introduction to kselftest
Brief introduction to kselftestSeongJae Park
 
Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Levente Kurusa
 
Tutorial contributing to nf-core
Tutorial contributing to nf-coreTutorial contributing to nf-core
Tutorial contributing to nf-coreGisela Gabernet
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebSteffen Gebert
 
Kernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: DebianKernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: DebianAnne Nicolas
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introductionYi-Hsiu Hsu
 
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s goingKernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s goingAnne Nicolas
 
OPNFV Developer Tools and Release Process
OPNFV Developer Tools and Release ProcessOPNFV Developer Tools and Release Process
OPNFV Developer Tools and Release ProcessOPNFV
 
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...Yoshitake Kobayashi
 
BKK16-400A LuvOS and ACPI Compliance Testing
BKK16-400A LuvOS and ACPI Compliance TestingBKK16-400A LuvOS and ACPI Compliance Testing
BKK16-400A LuvOS and ACPI Compliance TestingLinaro
 
OpenNebula Conf 2014: CentOS, QA an OpenNebula - Christoph Galuschka
OpenNebula Conf 2014: CentOS, QA an OpenNebula - Christoph GaluschkaOpenNebula Conf 2014: CentOS, QA an OpenNebula - Christoph Galuschka
OpenNebula Conf 2014: CentOS, QA an OpenNebula - Christoph GaluschkaNETWAYS
 
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....? Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....? Puppet
 

Was ist angesagt? (20)

Upgrading CentOS on the Facebook fleet
Upgrading CentOS on the Facebook fleetUpgrading CentOS on the Facebook fleet
Upgrading CentOS on the Facebook fleet
 
Introduce fuego
Introduce fuegoIntroduce fuego
Introduce fuego
 
.NET on Linux: Entity Framework Core 1.0
.NET on Linux: Entity Framework Core 1.0.NET on Linux: Entity Framework Core 1.0
.NET on Linux: Entity Framework Core 1.0
 
Distro Recipes 2013 : Upstream management and consequences on the distributi...
Distro Recipes 2013 : Upstream management and consequences on the  distributi...Distro Recipes 2013 : Upstream management and consequences on the  distributi...
Distro Recipes 2013 : Upstream management and consequences on the distributi...
 
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s goingKernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
 
Kernel Recipes 2016 - The kernel report
Kernel Recipes 2016 - The kernel reportKernel Recipes 2016 - The kernel report
Kernel Recipes 2016 - The kernel report
 
Brief introduction to kselftest
Brief introduction to kselftestBrief introduction to kselftest
Brief introduction to kselftest
 
Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!Linux Kernel - Let's Contribute!
Linux Kernel - Let's Contribute!
 
Tutorial contributing to nf-core
Tutorial contributing to nf-coreTutorial contributing to nf-core
Tutorial contributing to nf-core
 
nf-core usage tutorial
nf-core usage tutorialnf-core usage tutorial
nf-core usage tutorial
 
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the WebCleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
Cleaning Up the Dirt of the Nineties - How New Protocols are Modernizing the Web
 
Kernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: DebianKernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: Debian
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introduction
 
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s goingKernel Recipes 2016 - Kernel documentation: what we have and where it’s going
Kernel Recipes 2016 - Kernel documentation: what we have and where it’s going
 
Docker 2014
Docker 2014Docker 2014
Docker 2014
 
OPNFV Developer Tools and Release Process
OPNFV Developer Tools and Release ProcessOPNFV Developer Tools and Release Process
OPNFV Developer Tools and Release Process
 
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
Poky meets Debian: Understanding how to make an embedded Linux by using an ex...
 
BKK16-400A LuvOS and ACPI Compliance Testing
BKK16-400A LuvOS and ACPI Compliance TestingBKK16-400A LuvOS and ACPI Compliance Testing
BKK16-400A LuvOS and ACPI Compliance Testing
 
OpenNebula Conf 2014: CentOS, QA an OpenNebula - Christoph Galuschka
OpenNebula Conf 2014: CentOS, QA an OpenNebula - Christoph GaluschkaOpenNebula Conf 2014: CentOS, QA an OpenNebula - Christoph Galuschka
OpenNebula Conf 2014: CentOS, QA an OpenNebula - Christoph Galuschka
 
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....? Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
Puppet Camp Sydney 2015: Puppet and AWS is easy right.....?
 

Andere mochten auch

U boot 程式碼打掃計畫
U boot 程式碼打掃計畫U boot 程式碼打掃計畫
U boot 程式碼打掃計畫Macpaul Lin
 
How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015Macpaul Lin
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Macpaul Lin
 
USB Specification 2.0 - Chapter 9 - Device Framework
USB Specification 2.0 - Chapter 9 - Device FrameworkUSB Specification 2.0 - Chapter 9 - Device Framework
USB Specification 2.0 - Chapter 9 - Device FrameworkMacpaul Lin
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
政黨票的故事
政黨票的故事政黨票的故事
政黨票的故事Macpaul Lin
 
Porting linux to a new architecture
Porting linux to a new architecturePorting linux to a new architecture
Porting linux to a new architectureKALRAY
 
Porting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt projectPorting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt projectMacpaul Lin
 
Linux Porting
Linux PortingLinux Porting
Linux PortingChamp Yen
 
Why sending patches back is so important
Why sending patches back is so importantWhy sending patches back is so important
Why sending patches back is so importantMacpaul Lin
 
Module 4 Embedded Linux
Module 4 Embedded LinuxModule 4 Embedded Linux
Module 4 Embedded LinuxTushar B Kute
 
OpenWRT, A value-add base solution for your product. (2nd, Macpual)
OpenWRT, A value-add base solution for your product. (2nd, Macpual)OpenWRT, A value-add base solution for your product. (2nd, Macpual)
OpenWRT, A value-add base solution for your product. (2nd, Macpual)Macpaul Lin
 
Constrained Power Management
Constrained Power ManagementConstrained Power Management
Constrained Power ManagementPatrick Bellasi
 
Evoluzione dei Sistemi Embedded: Verso architetture multi-core
Evoluzione dei Sistemi Embedded: Verso architetture multi-coreEvoluzione dei Sistemi Embedded: Verso architetture multi-core
Evoluzione dei Sistemi Embedded: Verso architetture multi-corePatrick Bellasi
 
高效能執行緒
高效能執行緒高效能執行緒
高效能執行緒Rick Wu
 
Cross-Layer Frameworks for Constrained Power and Resources Management of Embe...
Cross-Layer Frameworks for Constrained Power and Resources Management of Embe...Cross-Layer Frameworks for Constrained Power and Resources Management of Embe...
Cross-Layer Frameworks for Constrained Power and Resources Management of Embe...Patrick Bellasi
 
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗Macpaul Lin
 
Linux Power Management Slideshare
Linux Power Management SlideshareLinux Power Management Slideshare
Linux Power Management SlidesharePatrick Bellasi
 

Andere mochten auch (20)

U boot 程式碼打掃計畫
U boot 程式碼打掃計畫U boot 程式碼打掃計畫
U boot 程式碼打掃計畫
 
How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)
 
USB Specification 2.0 - Chapter 9 - Device Framework
USB Specification 2.0 - Chapter 9 - Device FrameworkUSB Specification 2.0 - Chapter 9 - Device Framework
USB Specification 2.0 - Chapter 9 - Device Framework
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
政黨票的故事
政黨票的故事政黨票的故事
政黨票的故事
 
Porting linux to a new architecture
Porting linux to a new architecturePorting linux to a new architecture
Porting linux to a new architecture
 
Porting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt projectPorting a new architecture (NDS32) to open wrt project
Porting a new architecture (NDS32) to open wrt project
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
Why sending patches back is so important
Why sending patches back is so importantWhy sending patches back is so important
Why sending patches back is so important
 
Module 4 Embedded Linux
Module 4 Embedded LinuxModule 4 Embedded Linux
Module 4 Embedded Linux
 
Qt5 embedded
Qt5 embeddedQt5 embedded
Qt5 embedded
 
OpenWRT, A value-add base solution for your product. (2nd, Macpual)
OpenWRT, A value-add base solution for your product. (2nd, Macpual)OpenWRT, A value-add base solution for your product. (2nd, Macpual)
OpenWRT, A value-add base solution for your product. (2nd, Macpual)
 
Constrained Power Management
Constrained Power ManagementConstrained Power Management
Constrained Power Management
 
Evoluzione dei Sistemi Embedded: Verso architetture multi-core
Evoluzione dei Sistemi Embedded: Verso architetture multi-coreEvoluzione dei Sistemi Embedded: Verso architetture multi-core
Evoluzione dei Sistemi Embedded: Verso architetture multi-core
 
高效能執行緒
高效能執行緒高效能執行緒
高效能執行緒
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
Cross-Layer Frameworks for Constrained Power and Resources Management of Embe...
Cross-Layer Frameworks for Constrained Power and Resources Management of Embe...Cross-Layer Frameworks for Constrained Power and Resources Management of Embe...
Cross-Layer Frameworks for Constrained Power and Resources Management of Embe...
 
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
從u-boot 移植 NDS32 談 嵌入式系統開放原始碼開發的 一些經驗
 
Linux Power Management Slideshare
Linux Power Management SlideshareLinux Power Management Slideshare
Linux Power Management Slideshare
 

Ähnlich wie U boot source clean up project how-to

PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python courseEran Shlomo
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution processSyed Armani
 
OpenStack Contribution Process
OpenStack Contribution ProcessOpenStack Contribution Process
OpenStack Contribution Processopenstackindia
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)p3castro
 
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)Aaron Meurer
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jiralenamattt
 
Mercurial training
 Mercurial training Mercurial training
Mercurial trainingTrung Huynh
 
Reflections on Trusting Trust
Reflections on Trusting TrustReflections on Trusting Trust
Reflections on Trusting Trustyeokm1
 
RedisConf18 - Implementing a New Data Structure for Redis
RedisConf18 - Implementing a New Data Structure for Redis  RedisConf18 - Implementing a New Data Structure for Redis
RedisConf18 - Implementing a New Data Structure for Redis Redis Labs
 
Porting a legacy app to python 3
Porting a legacy app to python 3Porting a legacy app to python 3
Porting a legacy app to python 3Mark Rees
 
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 coreTYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 coretimohund
 
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Chocolatey Software
 
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Michel Buczynski
 
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...OpenCity Community
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 

Ähnlich wie U boot source clean up project how-to (20)

PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
Source control
Source controlSource control
Source control
 
Openstack contribution process
Openstack contribution processOpenstack contribution process
Openstack contribution process
 
OpenStack Contribution Process
OpenStack Contribution ProcessOpenStack Contribution Process
OpenStack Contribution Process
 
Effective C++
Effective C++Effective C++
Effective C++
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)
 
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
Conda: A Cross-Platform Package Manager for Any Binary Distribution (SciPy 2014)
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jira
 
Mercurial training
 Mercurial training Mercurial training
Mercurial training
 
Automatic codefixes
Automatic codefixesAutomatic codefixes
Automatic codefixes
 
Reflections on Trusting Trust
Reflections on Trusting TrustReflections on Trusting Trust
Reflections on Trusting Trust
 
RedisConf18 - Implementing a New Data Structure for Redis
RedisConf18 - Implementing a New Data Structure for Redis  RedisConf18 - Implementing a New Data Structure for Redis
RedisConf18 - Implementing a New Data Structure for Redis
 
Porting a legacy app to python 3
Porting a legacy app to python 3Porting a legacy app to python 3
Porting a legacy app to python 3
 
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 coreTYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
TYPO3 8 is here - how we keep EXT:solr uptodate with the TYPO3 core
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
 
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
Facilitating continuous delivery in a FinTech world with Salt, Jenkins, Nexus...
 
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 

Kürzlich hochgeladen

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Kürzlich hochgeladen (20)

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

U boot source clean up project how-to

  • 1. U-boot Source Code Clean Up Project and How-to Recruiting Volunteers! Macpaul Lin (2012/08/18)
  • 2. Outline • Why do we do clean up? • Who should join the clean up project? And How will you be benefited with it? • How to do the clean up work? • Summary.
  • 3. Why do we do clean up? • U-boot is old. – It is an old boot loader project and widely be used in various embedded systems. – There are many dirty historical codes. Linux has them, too. • Coding style are mixed. – It supports booting OS from various different devices which leverage codes from various open source projects. Such as dlmalloc, Linux, and etc.
  • 4. Why do we do clean up? • Developers usually get confused. – Some coding style really introduce problem when doing debugging. – New contributor usually get confused between old and new coding style. • This usually lead unnecessary time cost when developers reviewing and fixing their patches.
  • 5. Why do we do clean up? • It follows Linux coding style. • However, since u-boot has long history just like Linux kernel, source codes some were dirty and need to be clean up. • New comers and new contributors usually reference the old coding style. Hence the patch is usually need to be reworked and viewers spent lots of effort on replying mail.
  • 6. Who should join the clean up project and how will you be benefits with it? • U-boot uses git and mailing list to management the source code developing. – Student who wants to be familiar with git source version control. – Student who wants to join a open source project and practice with patch commitment mailing discussion. – People who is interested in boot loader with embedded device development environments.
  • 7. How to do the clean up work? • U-boot project uses the checkpatch.pl in Linux kernel to check the patches. • Clean up patches must obey both Linux coding style and u-boot coding style. • Coding style – http://www.denx.de/wiki/U-Boot/CodingStyle • Patch rules – http://www.denx.de/wiki/U-Boot/Patches
  • 8. Steps to join u-boot project 1. Sign-up the mailing list 2. Clone the source code 3. Use checkpatch.pl to check the old codes. 4. Fix warnings reported by checkpatch.pl 5. Use git send-email to commit the cleanup back to mailing list. 6. Fix your patch if maintainer give you suggestion to fix.
  • 9. 1. Sign-up the mailing list • Subscribe http://lists.denx.de/mailman/listinfo/u-boot Don't choose "yes" because maintainers will reply your patch by mail.
  • 10. 2. Clone the source code • Clone the source code – git clone git://git.denx.de/u-boot.git u-boot.git • Setting git users and email – git config --global user.name "yourname"; – git config --global user.email "you@youremail"; • Make a working branch – cd u-boot.git – git branch cleanup • Checkout the working branch and getting start – git checkout cleanup
  • 11. 3. Use checkpatch.pl to check the old codes. • Once you finish a patch, use tools/checkpatch.pl to verify the patch is clean before send it out. • So we can use this checkpatch.pl to check if the current files are clean. • Most of the old code is inside “common folder".
  • 12. 3. Use checkpatch.pl to check the old codes. • 3.0 Export the path of checkpatch.pl into $PATH – export PATH=$PATH:~/u-boot.git/tools
  • 13. 3. Use checkpatch.pl to check the old codes. • 3.1 find a unclean file in folder “common” – For example: "bedbug.c" – cd common • 3.2 copy it as a backup – cp bedbug.c bedbug.c.bak
  • 14. 3. Use checkpatch.pl to check the old codes. • 3.3 remove “bedbug.c” as commit 'A' because we will check the whole file later – git rm bedbug.c – git commit -s • Input some reason because this is just a temporary work.
  • 15. 3. Use checkpatch.pl to check the old codes. • 3.4 now we recover the unclean file and make this as a commit 'B'. – mv bedbug.c.bak bedbug.c – git add bedbug.c – git commit -s • Input the real commit log.
  • 16. 4. Fix warnings reported by checkpatch.pl • 4.1 Create a folder for this commit 'B' – mkdir patch – cd patch • 4.2 Export this commit 'B' (the latest commit) and use checkpatch.pl to get the report. – git format-patch HEAD~1 – checkpatch 0001-cosmetic-add-bedbug.c- back.patch
  • 17. 4. Fix warnings reported by checkpatch.pl • 4.3 You will get the report from checkpatch.
  • 18. 4. Fix warnings reported by checkpatch.pl • 4.4 Now you can fix all the error of bedbug.c with your favorite editor based on this report. – cd .. (back to “common" folder) – vim bedbug.c – (you can also use “git diff” to check your changes)
  • 19. 4. Fix warnings reported by checkpatch.pl • 4.5 Create a clean commit "C" as the result of your work. – git add debug.c – git commit -s
  • 20. 4. Fix warnings reported by checkpatch.pl • 4.6 Now you have 3 commits “A,B,C” in "cleanup" branch
  • 21. 4. Fix warnings reported by checkpatch.pl • 4.7 We only need the last commit "C" to send back to mailing list. – Remove commit "B" in patch folder • rm patch/0001-cosmetic-add-bedbug.c-back.patch – Export the final patch commit "C" • cd patch • git format-patch HEAD~1 – Use checkpatch.pl to check it again. • checkpatch 0001-cosmetic-clean-up-common- bedbug.c-by-checkpatch.pl.patch
  • 22. 5. Use git send-email to commit the cleanup back to mailing list. • 5.1 Finally send the patch out. – git send-email 0001-cosmetic-clean-up- common-bedbug.c-by-checkpatch.pl.patch – Remember add maintainers to “To:” list to review the patch.
  • 23. 6. Fix your patch if maintainer give you suggestion to fix. • After a maintainer reviewed your patch, he will reply your mail to inform you if the patch has been accepted or the patch is still need to be fixed.
  • 24. Summary • There are many old-style codes need to be cleaned up. We need your help. • Please join u-boot project. – Just subscribe http://lists.denx.de/mailman/listinfo/u-boot