Building kernel and filesystem using 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.

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 pyro
 $ cd workspace
 $ git clone git://git.yoctoproject.org/meta-raspberrypi
 $ cd meta-raspberrypi
 $ git checkout pyro

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
Android Android Commands Android Java Applications Application Libraries Bash / Shell Scripts Bluetooth driver Build Frameworks Commands and Packages Core Kernel C Programs Development Environment Setup Documents / Books Errors & Failures File Systems Framebuffer / Display Driver git Go Language Programs Hardware Platforms Home Kernel & Device Drivers Kernel Booting and Porting Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL NDK / Middleware / HAL Network Driver OS Concepts PHP Procfs Filesystem Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Userspace Utilities Web design and development Wordpress Yocto / Bitbake / Openembedded
Tags:

Leave a Reply