Building Yocto for Raspberry Pi / Creating Embedded Linux for RPi using Yocto

For proceeding to this post: Setting up ubuntu development machine for Yocto is a prerequisite and make sure you have all those packages installed in ubuntu.

Note: This compilation is done for Yocto 2.6 i.e codenamed “thud” which is last known stable version available for RaspberryPi. Although currently Yocto 2.7 (codename – warrior) is available with Poky but meta-raspberrypi with “warrior” branch is not available.

Now, lets clone the poky and raspberry Pi metadata as,

 $ mkdir workspace
 $ cd workspace
 $ git clone git://git.yoctoproject.org/poky
 $ cd poky
 $ git checkout -b thud origin/thud
 $ cd workspace
 $ git clone git://git.yoctoproject.org/meta-raspberrypi
 $ cd meta-raspberrypi
 $ git checkout -b thud origin/thud

Now, we will have to initialize the environment variables to start compilation for kernel and filesystem as,

 $ cd workspace/poky
 $ source oe-init-build-env

Above command will initialize environment variables and create build directory and will go inside this build directory. The tree structure of the newly created “build” directory is like,

$ tree build/
build/
└── conf
    ├── bblayers.conf
    ├── local.conf
    └── templateconf.cfg

1 directory, 3 files

Now, we need to change bblayers.conf to add the path of meta-raspberrypi layer, hence open this file and append the path of meta-raspberrypi layer like below,

 $ vim conf/bblayers.conf
BBLAYERS ?= " \
  /home/myuser/workspace/poky/meta \
  /home/myuser/workspace/poky \
  /home/myuser/workspace/poky/meta-yocto-bsp \
  /home/myuser/workspace/meta-raspberrypi \
  "

Next, we need to edit “conf/local.conf” to add Raspberry Pi as machine,

$ vim conf/local.conf

and append following string,

 MACHINE = "raspberrypi3"

Now, lets start the compilation which will create the complete binary images required to boot Raspberry Pi,

 $ bitbake core-image-minimal

lynxbee_ezoic

Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )

   


Leave a Comment

Android Android Applications Android Build system Android Commands Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded