Hob is a graphical user interface for BitBake provided by the Yocto Project. It is one of the Yocto Project’s subprojects and is maintained by the Yocto Project development team.
Why is it called Hob? In the early days of Hob, the three letters stood for Human-Oriented Builder. However, that does not really sound too appealing and now the name of the tool is commonly associated with hob, the British English word for cooktop. And that fits well into the scheme of BitBake and recipes.
With Hob you can conveniently customize your root filesystem images using your mouse rather than editing text files. If that’s the case, why didn’t we introduce Hob first rather than explain how to build your custom Linux distribution the “hard” way? There are a couple of reasons:
You can do a lot with Hob, but not everything.
Hob is a frontend to BitBake and your build environment. It manipulates files in your build environment, launches BitBake, and collects build results. Understanding how this is done manually helps you understand what Hob does in particular if something goes wrong.
Although Hob may hide some of the complexity, you still need to know the terminology and how certain variable settings influence your build results.
Using Hob is rather simple. First, set up a build environment and then launch Hob from inside it:
$ source oe-init-build-env build
Hob launches and then verifies your build environment. After that check is completed, you see a screen similar to the one in Figure 7-1 (we already made choices for the machine and image recipe).
Figure 7-1 Hob
The Hob user interface is easy to understand:
Select a machine: From the drop-down menu, choose the machine you want to build for. The list shows all the machines that are defined by any layer included with the build environment. Selecting the machine changes the MACHINE variable setting in the con/local.conf file.
Layers: Click this button to open a graphical editor that lets you include layers with and remove them from your build environment. Doing so modifies the conf/bblayers.conf file in your build environment.
Select an image recipe: From this drop-down menu, you can choose the image that you want to build. This provides the image target to BitBake similar to running bitbake <image-target>. The menu contains image targets from all layers included with your build environment.
Advanced configuration: Clicking on this button opens a menu that lets you select root filesystem types, packaging format, distribution policy, image size, and more, as outlined in Sections 7.3 and 7.4. Hob adds these options to the conf/local.conf file of the build environment.
Edit image recipe: This button at the bottom of the screen lets you modify the image recipe by adding and/or removing packages and/or package groups. Doing so effectively modifies the IMAGE_INSTALL variable of the image target. You cannot, however, define new package groups from the Hob user interface. For that task, you have to write your package group recipe as explained in Section 7.1.6. But, of course, if you wrote your package recipe and included the layer it resides in with Hob, then you are able to select it from the package groups list.
Settings: This button in the upper right corner of the user interface allows you to modify general settings contained in conf/local.conf such as parallelism, download directory, shared state cache, mirrors, and network proxies. Using the Others tab, you can add any variable to conf/local.conf and assign a value to it.
Images: This button next to the Settings button in the upper right corner of the Hob user interface displays a list of previously built images. The list is created by parsing the tmp/deploy/images/<machine> subdirectories of the build environment. You can select an image from the list, run it if it is a QEMU image, or rebuild it.
Build image: This button launches BitBake with the selected configuration and image target. The user interface switches to the Log tab of the build view from which you can follow the build process. This view has a major advantage over the BitBake output when started from the command line: not only do you see the tasks that are currently run but also the pending tasks and the ones that already have completed. If there are any build issues, warnings, or errors, they are logged underneath the Issues tab. There you can examine build issues and directly view the entire log file of a task without navigating through the build environment directory structure.
After the build finishes, Hob presents you with a summary page where you can view the created files in the file browser of your build system. You can also examine a summary log showing the run results for each task as well as any notes, warnings, or error messages. If you used Hob to build a root filesystem image and Linux kernel for the QEMU emulator, you can launch QEMU directly from Hob to verify your image by clicking on the Run image button in the lower right corner of the user interface. From the summary page, you can also make changes to your configuration and run a new build.
Whether you prefer Hob over configuring your build environment, customizing your target images, and launching BitBake manually is entirely up to you. Hob is great for rapid prototyping and to quickly enable somebody who is not all that familiar with BitBake and the Yocto Project to build predefined root filesystem image targets. Hob does not allow you to create your own image recipes, nor can you create your own distribution policy files with it (or even edit them). For these tasks, you need to set up your own layer and create the necessary files and recipes manually.
From Yocto Project version 2.1 on, Hob is being deprecated in favor of the web-based Toaster, which we explore in detail in Chapter 13.