Buildroot - Clone with Git

Introduction

In this topic you will download Buildroot so you can create binary image files ready to flash onto a SD Memory card using a default or custom configuration for the target: ATSAMA5D27 SOM1 EK1 Evaluation Kit.

The process of getting the Buildroot source code involves copying (git clone) of a remote repository onto a local directory on your computer. This is the official repository of the Buildroot project.

You will also copy a Microchip Technology maintained external files that contain additional software packages.


Prerequisites

Git

If you are new to git there are many online resources. One such resource is the online book Pro Git by Scott Chacon and Ben Straub. It is available in several languages and you can also download the book in eBook formats (EPUB and MOBI) and PDF.

Another excellent resource is the Learn Git tutorial by Atlassian®.


Download - Getting Buildroot

1

Create a Project Directory

It is a good practice to create a project directory to place the source code for a given project. This way, you can archive the contents of the project directory for others and/or for archival purposes.

For the purposes of this how-to tutorial, we’ll name our project directory project_1:

$ mkdir project_1

2

Get Buildroot

You will get Buildroot by copying (git clone) the Buildroot source code from a remote repository
to your project directory:

Change directory to the project directory:

$ cd ~/project_1

Copy (git clone) the Buildroot source code to your project directory:

When you git clone the Buildroot remote repository git.buildroot.net/buildroot you are creating a copy to your computer’s project directory (also known to git as the working directory or local directory).

When git is finished copying the Buildroot source code to your project directory, you will see a number of files and directories. The contents of each are explained in the Buildroot user manual: How Buildroot Works.

3

Checkout the LTS Branch (Version)

At this point, the copy of Buildroot in your project directory contains several branches (versions) of Buildroot. Since you just cloned the remote repository, the HEAD pointer is pointing to the “master” branch. You can see this by changing directory into the buildroot directory and issuing a git status command:

$ cd ~/project_1/buildroot
$ git status
On branch master
Your branch is up-to-date with ‘origin/master’.
nothing to commit, working tree clean

The “master” branch is the latest (as of the time you cloned the repository) branch the Buildroot team is developing with. The development branch can be unstable. Instead, we want to use the latest-and-greatest stable version, known as the Long Term Support (LTS) version. To do this issue the get checkout command with the version number (also known as checking out the branch):

$ git checkout 2019.02.3

We determine which LTS version we will checkout by referring to the Buildroot download page. The Buildroot project publishes one long term support release per year and it is maintained for one year – security, bug, and build fixes.

Now issue a git status command:

$ git status
HEAD detached at 2019.02.3
nothing to commit, working tree clean

The HEAD pointer has been detached from the master and is now pointing at version 2019.02.3. It is important that you do not commit any changes to your local Buildroot directory in this state. If you do, they will be lost. If you want to make changes, create a new branch.

By the way, if you would like to see a list of the branches (versions) available you can issue the git tag command.

$ git tag
0_0
2009.02
2009.02_rc1
2009.02_rc2

4

Get the Microchip Buildroot External Tree

The Microchip maintained external Buildroot tree contains additional packages and default configuration (defconfig) files for demonstrations running on SAMA5 and SAM9x60 series evaluation kits.

First, change directory into the project directory:

$ cd ~/project_1

Copy (git clone) the Microchip Buildroot external source code to your project directory:

5

Checkout the Latest Linux4SAM® demo

The latest version of Linux4SAM demonstration software is located on the Linux4SAM website. Checkout the latest Linux4SAM demonstration branch:

$ cd ~/project_1/buildroot-external-microchip
$ git checkout linux4sam_6.0

Recall that you can list the available branches (versions) by issuing the git tag command.


Alternate Download Method

You may also download Buildroot in a compressed tar file (also known as a tarball) from the official Buildroot project website download page. There are two compressed formats you can choose from gzip, which have a *.tgz or *.tar.gz and bzip2 which have a *.tar.bz2 suffix.

If you are new to the tar utility, there are many resources online. Try searching: “linux tar tutorial”.

gzip - The command to decompress ( -z ) and extract ( -x ) a file ( -f ) is:

$ cd ~/project_1
$ tar -zxf buildroot-2019.02.3.tar.gz

bzip2 - The command to decompress ( -j ) and extract ( -x ) a file is ( -f ) is:

$ cd ~/project_1
$ tar -jxf buildroot-2019.02.3.tar.gz

You may want to add the verbose option ( -v ) to watch the progress of the decompress and extract command.

To download the buildroot-external-microchip file, using your favorite web browser go to: Microchip SAMA5 Buildroot External

Click on the green button Clone or download and select Download ZIP.

The command to decompress the file:

$ unzip buildroot-external-microchip


Summary

In this topic we explained the process of getting the official Buildroot source code using the git clone command. Next, we explained how to “checkout” the long term support branch (version).

We also explained the process of getting the Microchip vendor maintained external files, buildroot-external-microchip. These contain additional packages and default configuration (defconfig) files for demonstration programs running on SAMA5 and SAM9x60 series evaluation kits.


What’s Next?

Before you can build the entire embedded system (cross-compilation toolchain, bootloaders, kernel, device tree, and target software packages) Buildroot must first be configured.

There are two methods in which you can perform the configuration:

  1. From a default configuration (defconfig) file, or
  2. Manually, creating a custom project.

If you are new to Buildroot, you may want to try a default configuration first to familiarize yourself with the process and ensure everything works. With the knowledge you gain from configuring with a default configuration, you can customize your own Buildroot configuration for a custom project.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.