yocto-project-qs: Added MinnowBoard MAX example to "Super User"

(From yocto-docs rev: b7ef42f44757a81ca1084351e2866c8f0894083c)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Rifenbark 2015-04-14 14:31:01 -07:00 committed by Richard Purdie
parent d654160eb2
commit 65167a872d
1 changed files with 321 additions and 100 deletions

View File

@ -871,131 +871,352 @@
</title> </title>
<para> <para>
This section This section provides minimal instruction for using the Yocto Project
<footnote> to build an image for Beaglebone hardware and for building and
<para> booting an image for the third-party
Kudos and thanks to Robert P. J. Day of <ulink url='http://www.minnowboard.org/meet-minnowboard-max/'>MinnowBoard MAX</ulink>.
<ulink url='http://www.crashcourse.ca'>CrashCourse</ulink> for providing the basis <note>
for this "expert" section with information from one of his The steps used in this section were performed on a 64-bit
<ulink url='http://www.crashcourse.ca/wiki/index.php/Yocto_Project_Quick_Start'>wiki</ulink> Ubuntu 14.10 system that has four cores.
pages. </note>
</para>
</footnote>
gives you a minimal description of how to use the Yocto Project to build
images for Beaglebone hardware starting from scratch.
The steps were performed on a 64-bit Ubuntu 12.04 system that
has four cores.
</para> </para>
<section id='getting-yocto'> <section id='building-beaglebone-from-scratch'>
<title>Getting the Yocto Project</title> <title>Building Beaglebone from Scratch</title>
<para> <para>
Set up your This section
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink> <footnote>
by using Git to clone the <filename>poky</filename> <para>
repository and then check out the release branch: Kudos and thanks to Robert P. J. Day of
<literallayout class='monospaced'> <ulink url='http://www.crashcourse.ca'>CrashCourse</ulink>
for providing the basis for this "expert" section with
information from one of his
<ulink url='http://www.crashcourse.ca/wiki/index.php/Yocto_Project_Quick_Start'>wiki</ulink>
pages.
</para>
</footnote>
gives you a minimal description of how to use the Yocto Project to
build images for Beaglebone hardware starting from scratch.
</para>
<section id='getting-yocto'>
<title>Getting the Yocto Project</title>
<para>
Set up your
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
by using Git to clone the <filename>poky</filename>
repository and then check out the release branch:
<literallayout class='monospaced'>
$ cd ~ $ cd ~
$ git clone git://git.yoctoproject.org/poky $ git clone git://git.yoctoproject.org/poky
$ cd poky $ cd poky
$ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME; $ git checkout -b &DISTRO_NAME; origin/&DISTRO_NAME;
</literallayout> </literallayout>
</para> </para>
</section> </section>
<section id='setting-up-your-host'> <section id='setting-up-your-host'>
<title>Setting Up Your Host</title> <title>Setting Up Your Host</title>
<para> <para>
You need some packages for everything to work. You need some packages for everything to work.
Rather than duplicate them here, look at the Rather than duplicate them here, look at the
"<link linkend='packages'>The Packages</link>" "<link linkend='packages'>The Packages</link>"
section earlier in this quick start. section earlier in this quick start.
</para> </para>
</section> </section>
<section id='initializing-the-build-environment'> <section id='initializing-the-build-environment'>
<title>Initializing the Build Environment</title> <title>Initializing the Build Environment</title>
<para> <para>
From the root directory of your From the root directory of your
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>, <ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
initialize your environment and provide a meaningful initialize your environment and provide a meaningful
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink> <ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build Directory</ulink>
name: name:
<literallayout class='monospaced'> <literallayout class='monospaced'>
$ source &OE_INIT_FILE; mybuilds $ source &OE_INIT_FILE; mybuilds
</literallayout> </literallayout>
At this point, the <filename>mybuilds</filename> directory has At this point, the <filename>mybuilds</filename> directory has
been created for you and it is now your current working directory. been created for you and it is now your current working directory.
If you do not provide your own directory name, If you do not provide your own directory name,
it defaults to <filename>build</filename>, it defaults to <filename>build</filename>,
which is inside the Source Directory. which is inside the Source Directory.
</para> </para>
</section> </section>
<section id='configuring-the-local.conf-file'> <section id='configuring-the-local.conf-file'>
<title>Configuring the local.conf File</title> <title>Configuring the local.conf File</title>
<para> <para>
Initializing the build environment creates a Initializing the build environment creates a
<filename>conf/local.conf</filename> configuration file <filename>conf/local.conf</filename> configuration file
in the Build Directory. in the Build Directory.
You need to manually edit this file to specify the machine you You need to manually edit this file to specify the machine you
are building: are building:
<literallayout class='monospaced'> <literallayout class='monospaced'>
MACHINE ?= "beaglebone" MACHINE ?= "beaglebone"
</literallayout> </literallayout>
</para> </para>
<para> <para>
A good deal that goes into a Yocto Project build is simply A good deal that goes into a Yocto Project build is simply
downloading all of the source tarballs. downloading all of the source tarballs.
Steps exist that can help you be more efficient with gathering Steps exist that can help you be more efficient with gathering
source files. source files.
For example, you can set up local mirrors that hold your For example, you can set up local mirrors that hold your
source tarballs or you can pre-fetch all your source without source tarballs or you can pre-fetch all your source without
initiating a build until later. initiating a build until later.
For more information, see the For more information, see the
"<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-source-files'>Working with Source Files</ulink>" "<ulink url='&YOCTO_DOCS_DEV_URL;#working-with-source-files'>Working with Source Files</ulink>"
section in the Yocto Project Development Manual. section in the Yocto Project Development Manual.
</para> </para>
</section>
<section id='building-the-image'>
<title>Building the Image</title>
<para>
At this point, you need to select an image to build for the
Beaglebone hardware.
If this is your first build using the Yocto Project, you should
try the smallest and simplest image:
<literallayout class='monospaced'>
$ bitbake core-image-minimal
</literallayout>
Now you just wait for the build to finish.
</para>
<para>
You might encounter various warning messages during the
build.
For example, if a source file fetch initially fails,
the OpenEmbedded build system notes that and attempts to
find the files using mirrors.
Another example could be values requested for but not
found in the final kernel <filename>.config</filename>
file.
For information on configuration warnings, see the
"<ulink url='&YOCTO_DOCS_KERNEL_DEV_URL;#generating-configuration-files'>Generating Configuration Files</ulink>"
section in the Yocto Project Linux Kernel Development Manual.
</para>
<para>
By default, BitBake aborts when it encounters an error during
the build.
If you want to make sure the build continues even when BitBake
encounters an error, use this variation:
<literallayout class='monospaced'>
$ bitbake -k core-image-minimal
</literallayout>
</para>
<para>
Once you have your image, you can take steps to load and boot
it on the target hardware.
</para>
<para>
You can learn about BitBake in general by reading the
<ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
</para>
</section>
</section> </section>
<section id='building-the-image'> <section id='building-and-booting-minnowboard-max'>
<title>Building the Image</title> <title>Building and Booting MinnowBoard MAX</title>
<para> <para>
At this point, you need to select an image to build for the As of the Yocto Project 1.6 release, the MinnowBoard MAX is
Beaglebone hardware. supported by the Yocto Project and the
If this is your first build using the Yocto Project, you should try <filename>meta-intel</filename>
the smallest and simplest image: <filename>intel-corei7-64</filename> and
<literallayout class='monospaced'> <filename>intel-core2-32</filename> Board Support Packages (BSPs).
<note>
The MinnowBoard MAX ships with 64-bit firmware.
If you want to use the board in 32-bit mode, you must
download the
<ulink url='http://firmware.intel.com/projects/minnowboard-max'>32-bit firmware</ulink>.
</note>
</para>
<section id='mm-getting-yocto-and-meta-intel'>
<title>Getting the Yocto Project and <filename>meta-intel</filename></title>
<para>
Set up your
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
and the <filename>meta-intel</filename> layer
by using Git to clone the <filename>poky</filename>
and <filename>meta-intel</filename> repositories.
These commands use the "&DISTRO_NAME;" branch:
<literallayout class='monospaced'>
$ cd ~
$ mkdir source
$ cd source
$ git clone -b &DISTRO_NAME; git://git.yoctoproject.org/poky
$ cd poky
$ git clone -b &DISTRO_NAME; git://git.yoctoproject.org/meta-intel
</literallayout>
</para>
</section>
<section id='mm-setting-up-your-host'>
<title>Setting Up Your Host</title>
<para>
You need some packages for everything to work.
Rather than duplicate them here, look at the
"<link linkend='packages'>The Packages</link>"
section earlier in this quick start.
</para>
</section>
<section id='mm-initializing-the-build-environment'>
<title>Initializing the Build Environment</title>
<para>
From the root directory of your
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
initialize your environment by running the build environment
initialization script:
<literallayout class='monospaced'>
$ source &OE_INIT_FILE;
</literallayout>
At this point, the <filename>build</filename> directory has
been created for you and it is now your current working
directory.
</para>
</section>
<section id='mm-configure-the-build'>
<title>Configure the Build</title>
<para>
To configure the build, you edit the
<filename>bblayers.conf</filename> and
<filename>local.conf</filename> files, both of which are
located in the <filename>build/conf</filename> directory.
</para>
<para>
Here is a quick way to make the edits.
The first command adds the <filename>meta-intel</filename>
branch, which contains the <filename>intel-core*</filename>
BSPs to the build.
The second command selects the BSP by setting the
<ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
variable.
<literallayout class='monospaced'>
$ echo 'BBLAYERS += "~/source/poky/meta-intel"' >> conf/bblayers.conf
$ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
</literallayout>
<note><title>Notes</title>
<para>
If you want a 64-bit build, use the following:
<literallayout class='monospaced'>
$ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
</literallayout>
</para>
<para>
If you want 32-bit images, use the following:
<literallayout class='monospaced'>
$ echo 'MACHINE = "intel-core2-32"' >> conf/local.conf
</literallayout>
</para>
</note>
</para>
</section>
<section id='mm-build-the-image'>
<title>Build the Image</title>
<para>
Use this command to build the minimal image for
MinnowBoard MAX:
<literallayout class='monospaced'>
$ bitbake core-image-minimal $ bitbake core-image-minimal
</literallayout> </literallayout>
Now you just wait for the build to finish. Once the build completes, the resulting basic console image
</para> is located in the Build Directory here:
<literallayout class='monospaced'>
tmp/deploy/images/intel-corei7-64/core-image-minimal-intel-corei7-64.hddimg
</literallayout>
</para>
</section>
<para> <section id='mm-write-the-image'>
By default, BitBake aborts when it encounters an error during <title>Write the Image</title>
the build.
If you want to make sure the build continues even when BitBake
encounters an error, use this variation:
<literallayout class='monospaced'>
$ bitbake -k core-image-minimal
</literallayout>
</para>
<para> <para>
Once you have your image, you can take steps to load and boot it on You can write the image to a USB key, SATA drive, or SD card
the target hardware. by using the <filename>mkefidisk.sh</filename> script,
</para> which is included in the <filename>poky</filename>
repository at <filename>scripts/contrib/mkefidisk.sh</filename>:
<literallayout class='monospaced'>
$ sudo $HOME/source/poky/scripts/contrib/mkefidisk.sh <replaceable>HOST_DEVICE</replaceable> \
tmp/deploy/images/intel-corei7-64/core-image-minimal-intel-corei7-64.hddimg <replaceable>TARGET_DEVICE</replaceable>
</literallayout>
In the previous command, <replaceable>HOST_DEVICE</replaceable>
is the device node on the build system (e.g.
<filename>/dev/sdc</filename> or
<filename>/dev/mmcblk0</filename>).
<replaceable>TARGET_DEVICE</replaceable> is the name of the
device as the MinnowBoard MAX sees it (e.g.
<filename>/dev/sda</filename> or
<filename>/dev/mmcblk0</filename>).
</para>
</section>
<para> <section id='mm-boot-the-image'>
You can learn about BitBake in general by reading the <title>Boot the Image</title>
<ulink url='&YOCTO_DOCS_BB_URL;'>BitBake User Manual</ulink>.
</para> <para>
With the boot device provisioned, you can insert the media into
the MinnowBoard MAX and boot the hardware.
The board should automatically detect the media and boot to
the bootloader and subsequently the operating system.
</para>
<para>
If the board does not boot automatically, you can boot it
manually from the EFI shell as follows:
<literallayout class='monospaced'>
Shell> connect -r
Shell> map -r
Shell> fs0:
Shell> bootx64
</literallayout>
<note>
For a 32-bit image use the following:
<literallayout class='monospaced'>
Shell> bootia32
</literallayout>
</note>
</para>
</section>
<section id='mm-next-steps'>
<title>Next Steps</title>
<para>
Now that you can build a basic image, you could experiment
by building some other example images:
<literallayout class='monospaced'>
$ bitbake core-image-sato
$ bitbake core-image-sato-sdk
</literallayout>
Another possibility is to experiment creating your own image
recipes that add packages to suit your needs.
For information on how to create recipes, see the
"<ulink url='&YOCTO_DOCS_DEV_URL;#new-recipe-writing-a-new-recipe'>Writing a New Recipe</ulink>"
section in the Yocto Project Development Manual.
</para>
</section>
</section> </section>
</section> </section>