SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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.....?
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
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
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
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
 
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
 
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
 

Dernier (20)

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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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!
 
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
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
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
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
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
 
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
 
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
 

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