Difference between revisions of "Linuxinternals/training-setup"

From eLinux.org
Jump to: navigation, search
(OpenEmbedded configuration and setup)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
This page helps you get your embedded system up and running with the hardware and software necessary to run the examples covered in the training.
+
This page helps you get your embedded Linux system up and running with the hardware and software necessary to run the examples covered in the training.
 +
 
 +
=== Software environment setup ===
 +
 
 +
==== Setting up the build environment ====
 +
 
 +
In this training program, we currently use the [http://www.openembedded.org/wiki/OpenEmbedded-Core OpenEmbedded Core] build system. The build system makes it super easy to compiler or cross-compiler any and everything under the sun including the kernel and the compiler itself. These instructions were developed on a Ubuntu Linux 14.04 but should work on other distributions.
 +
 
 +
Inorder to build the software image for your beagle bone, please obtain a build machine (virtual or real) with atleast 4GB of RAM, 150GB of hard disk space and a decent CPU. Install Ubuntu 14.04 for a smooth ride through the instructions.
 +
 
 +
==== Download OpenEmbedded code from github ====
 +
# Create a suitable directory such as ~/data/repo/ to store source code
 +
# Run the following commands
 +
Checkout the code for Open Embedded from my poky repository on github (poky is a distribution based on OpenEmbedded)
 +
  cd ~/data/repo/
 +
  git clone https://github.com/joelagnel/poky-beaglebone.git
 +
  cd poky-beaglebone
 +
  git checkout intro_linux_v1
 +
Checkout the code for the meta-ti layer into poky:
 +
  git clone https://github.com/joelagnel/meta-ti.git
 +
  cd meta-ti
 +
  git checkout intro_linux_v1
 +
  cd ..
 +
Checkout the code for the meta-openembedded layer into poky:
 +
  git clone https://github.com/joelagnel/meta-openembedded.git
 +
  cd meta-openembedded
 +
  git checkout intro_linux_v1
 +
  cd ..
 +
 
 +
==== OpenEmbedded configuration and setup ====
 +
* Goto your poky directory:
 +
  cd ~/data/repo/poky-beaglebone
 +
* Setup the environment for the build, this will create config files in build/conf/
 +
  source oe-init-build-env
 +
* Edit the local.conf file in the build directory
 +
* Uncomment the line #MACHINE ?= "beaglebone" and comment out any other MACHINE variable assignments. It should finally look like
 +
  #MACHINE ?= "am180x-evm"
 +
  #MACHINE ?= "beaglebone"
 +
  #MACHINE ?= "genericx86"
 +
  #MACHINE ?= "genericx86-64"
 +
  #MACHINE ?= "mpc8315e-rdb"
 +
  #MACHINE ?= "edgerouter"
 +
* Goto the end of the file and set BB_NUMBER_THREADS to 8 or other value. This is the number of tasks that will run in parallel during the build (parallel means faster!)
 +
* Next Setup your Open Embedded layers with the repositories we downloaded, edit your build/conf/bblayer.conf file to look like the following:
 +
  LCONF_VERSION = "6"
 +
  BBPATH = "${TOPDIR}"
 +
  BBFILES ?= ""
 +
  # meta-openembedded and meta-ti added by Joel for vim
 +
  # Remember to check out a recent version of these into poky
 +
  BBLAYERS ?= " \
 +
    /home/<your-username>/data/repo/poky-beaglebone/meta \
 +
    /home/<your-username>/data/repo/poky-beaglebone/meta-yocto \
 +
    /home/<your-username>/data/repo/poky-beaglebone/meta-ti \
 +
    /home/<your-username>/data/repo/poky-beaglebone/meta-openembedded/meta-oe \
 +
  "
 +
  BBLAYERS_NON_REMOVABLE ?= " \
 +
    /home/<your-username>/data/repo/poky-beaglebone/meta \
 +
    /home/<your-username>/data/repo/poky-beaglebone/meta-yocto \
 +
  "
 +
 
 +
==== Build Beaglebone Image ====
 +
* Goto the poky directory
 +
  cd ~/data/repo/poky
 +
* Setup the environment for the build
 +
  source oe-init-build-env
 +
* Run bitbake to build the beaglebone-image
 +
  bitbake beaglebone-image
 +
In a few hours your build should be ready to deploy. We will discuss how to install the image onto an SD card and boot up your beaglebone next.
 +
 
 +
 
  
 
--[[User:Joelagnel|Joelagnel]] ([[User talk:Joelagnel|talk]]) 13:03, 3 February 2016 (PST)
 
--[[User:Joelagnel|Joelagnel]] ([[User talk:Joelagnel|talk]]) 13:03, 3 February 2016 (PST)

Latest revision as of 00:33, 4 February 2016

This page helps you get your embedded Linux system up and running with the hardware and software necessary to run the examples covered in the training.

Software environment setup

Setting up the build environment

In this training program, we currently use the OpenEmbedded Core build system. The build system makes it super easy to compiler or cross-compiler any and everything under the sun including the kernel and the compiler itself. These instructions were developed on a Ubuntu Linux 14.04 but should work on other distributions.

Inorder to build the software image for your beagle bone, please obtain a build machine (virtual or real) with atleast 4GB of RAM, 150GB of hard disk space and a decent CPU. Install Ubuntu 14.04 for a smooth ride through the instructions.

Download OpenEmbedded code from github

  1. Create a suitable directory such as ~/data/repo/ to store source code
  2. Run the following commands

Checkout the code for Open Embedded from my poky repository on github (poky is a distribution based on OpenEmbedded)

 cd ~/data/repo/
 git clone https://github.com/joelagnel/poky-beaglebone.git
 cd poky-beaglebone
 git checkout intro_linux_v1

Checkout the code for the meta-ti layer into poky:

 git clone https://github.com/joelagnel/meta-ti.git
 cd meta-ti
 git checkout intro_linux_v1
 cd ..

Checkout the code for the meta-openembedded layer into poky:

 git clone https://github.com/joelagnel/meta-openembedded.git
 cd meta-openembedded
 git checkout intro_linux_v1
 cd ..

OpenEmbedded configuration and setup

  • Goto your poky directory:
 cd ~/data/repo/poky-beaglebone
  • Setup the environment for the build, this will create config files in build/conf/
 source oe-init-build-env
  • Edit the local.conf file in the build directory
  • Uncomment the line #MACHINE ?= "beaglebone" and comment out any other MACHINE variable assignments. It should finally look like
 #MACHINE ?= "am180x-evm"
 #MACHINE ?= "beaglebone"
 #MACHINE ?= "genericx86"
 #MACHINE ?= "genericx86-64"
 #MACHINE ?= "mpc8315e-rdb"
 #MACHINE ?= "edgerouter"
  • Goto the end of the file and set BB_NUMBER_THREADS to 8 or other value. This is the number of tasks that will run in parallel during the build (parallel means faster!)
  • Next Setup your Open Embedded layers with the repositories we downloaded, edit your build/conf/bblayer.conf file to look like the following:
 LCONF_VERSION = "6"
 BBPATH = "${TOPDIR}"
 BBFILES ?= ""
 # meta-openembedded and meta-ti added by Joel for vim
 # Remember to check out a recent version of these into poky
 BBLAYERS ?= " \
   /home/<your-username>/data/repo/poky-beaglebone/meta \
   /home/<your-username>/data/repo/poky-beaglebone/meta-yocto \
   /home/<your-username>/data/repo/poky-beaglebone/meta-ti \
   /home/<your-username>/data/repo/poky-beaglebone/meta-openembedded/meta-oe \
 "
 BBLAYERS_NON_REMOVABLE ?= " \
   /home/<your-username>/data/repo/poky-beaglebone/meta \
   /home/<your-username>/data/repo/poky-beaglebone/meta-yocto \
 "

Build Beaglebone Image

  • Goto the poky directory
 cd ~/data/repo/poky
  • Setup the environment for the build
 source oe-init-build-env
  • Run bitbake to build the beaglebone-image
 bitbake beaglebone-image

In a few hours your build should be ready to deploy. We will discuss how to install the image onto an SD card and boot up your beaglebone next.


--Joelagnel (talk) 13:03, 3 February 2016 (PST)