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
.
You're reading from Using Yocto Project with BeagleBone Black
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.
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.
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...
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
namedpackagegroup-yb-develop
undermeta-ybdevelop/recipes-example/
Add an appended image to include the preceding
packagegroup
instance
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.
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.