Reader small image

You're reading from  Using Yocto Project with BeagleBone Black

Product typeBook
Published inJun 2015
Reading LevelIntermediate
Publisher
ISBN-139781785289736
Edition1st Edition
Languages
Right arrow
Authors (2):
Irfan Sadiq
Irfan Sadiq
author image
Irfan Sadiq

H M Irfan Sadiq was a Linux enthusiast as a graduate student. He started his career as an embedded system development engineer and has been working as an H.264 Decoder developer and optimizer for the VLIW architecture. He got an opportunity to work on multiple multimedia frameworks that are open source as well as proprietary. He tried to work in a start-up in the entirely different domain of web development. He has been working on OpenEmbedded and Yocto Project technologies since he joined Mentor Graphics as the technical lead back in 2010. He has been working on derivative technologies of Yocto Project and OpenEmbedded for quite some time now, spanning more than 4 years. He has also been working on various hardware platforms based on the ARM, PPC, and x86 architecture. The diverse nature of subsequent BSPs has challenges in the context of QA. One of the challenges was to keep the QA packages in one place in such a way that they could be applied to all different product/platform combinations. He addressed this by creating a Yocto Project-based layer for which he is a maintainer as well as a gatekeeper.
Read more about Irfan Sadiq

View More author details
Right arrow

Chapter 6. Your First Console Game

In the previous chapter, we talked about layers. So far, we have formulated the basis of Yocto Project. Now, we need to move toward practical development. Going forward with this goal in mind, we will add a console-based game to our board. For this purpose, we have selected PAC-MAN. We will create a recipe for this game and enable it so that it can be added to our rootfs.

Hardware requirements


The following is a list of the hardware required to run this game:

  • BeagleBone Black

  • HDMI display (in my case, a Samsung LED TV)

  • An HDMI cable for the display connection

  • A USB keyboard

For testing purposes, we can use the following simple hardware:

  • BeagleBone Black

  • SSH using USB or an Ethernet cable.

Pacman4Console


PAC-MAN is a popular computer game of legacy times. It is hard to consider someone not knowing or not even having played it. We can find the code for GUI-based versions, but our major concern is not the game; we want to learn to code it using something practical. We will be using PAC-MAN for console by Mike Billars from https://sites.google.com/site/doctormike/pacman.html. We are choosing this for its simplicity. From this location, we got the link to the source Git as well as the source tar balls. We will use the Git link.

Let's develop our recipe


We need to collect different pieces for our recipe. As our prime purpose is learning, we won't list a final working recipe for our package. Rather, we will keep on experimenting and modifying our recipe and explain what we have been doing wrong or what we have been missing in the previous version or step. We already have a recipe in our meta-ybdevelop layer named helloworld. We can copy the basic elements from it and start modifying it to make our task easy.

Tip

Copying from the existing recipe is not only required for ease, but also to avoid unnecessary mistakes.

Basic elements

The following are the basic elements that are very easy to set, and they are shown as follows in the helloworld recipe:

DESCRIPTION = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

This will be changed to the following in the case of PAC-MAN:

DESCRIPTION = "Pacman for console is a console...

Adding a package to the root filesystem


To add this package to our root filesystem, we will use the following approach, and we will follow the same approach for subsequent packages throughout the book:

  • Create a packagegroup named packagegroup-yb-develop under meta-ybdevelop/recipes-example/

  • Add an appended image to include the preceding packagegroup instance

packagegroup

We will name this packagegroup-yb-develop.bb. It will be created under a subdirectory named packagegroups, and it will contain the following content by the end of this chapter:

SUMMARY = "Packagegroup For our layer YB-Develop"
LICENSE = "MIT"
PR = "r1"
inherit packagegroup
RDEPENDS_${PN} = "pacman4console \
      helloworld\
"

We will use this packagegroup instance for any further package addition throughout the book.

Image bbappend

We will add this file to the images subdirectory under our meta-ybdevelop/recipes-example/ directory. It will be named images/core-image-sato.bbappend. This will contain only this single line for now...

Summary


In this chapter, we created a recipe for the popular game PAC-MAN's console-based version. We went through the development of different tasks gradually, discussing successful as well as failed steps and explaining them.

In the next chapter, we will learn how to use BeagleBone for a simple surveillance system.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Using Yocto Project with BeagleBone Black
Published in: Jun 2015Publisher: ISBN-13: 9781785289736
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (2)

author image
Irfan Sadiq

H M Irfan Sadiq was a Linux enthusiast as a graduate student. He started his career as an embedded system development engineer and has been working as an H.264 Decoder developer and optimizer for the VLIW architecture. He got an opportunity to work on multiple multimedia frameworks that are open source as well as proprietary. He tried to work in a start-up in the entirely different domain of web development. He has been working on OpenEmbedded and Yocto Project technologies since he joined Mentor Graphics as the technical lead back in 2010. He has been working on derivative technologies of Yocto Project and OpenEmbedded for quite some time now, spanning more than 4 years. He has also been working on various hardware platforms based on the ARM, PPC, and x86 architecture. The diverse nature of subsequent BSPs has challenges in the context of QA. One of the challenges was to keep the QA packages in one place in such a way that they could be applied to all different product/platform combinations. He addressed this by creating a Yocto Project-based layer for which he is a maintainer as well as a gatekeeper.
Read more about Irfan Sadiq