Recently a customer asked about creating a small GNU Radio image to test some hardware with. The normal GNU Radio images built with the manifest are quite large. They include all the development and debug packages installed in the file system. Also, GNU radio is built with X11 support, which adds additional size to images. This is a great environment for people figuring out what they can do with GNU Radio on small computers, but is burdensome when you go to create a product.
Fourtunately, OpenEmbedded allows a lot of customization, this article will explain how to modify the build process to create a smaller GNU Radio image for embedded systems.
The basic process is:
- Check IMAGE_FEATURES in local.conf for features that inflate image size.
- Turn off graphic related DISTRO_FEATURES
- Set the PACKAGE_CONFIG options for GNU Radio to stop building GUI options.
- Create a minimal GNURadio image recipe.
Find the local.conf file in ./build/conf/local.conf. The path is relative to the top directory of your OpenEmbedded installation. Open it with your favorite editor and look for this line:
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-profile tools-sdk dev-pkgs dbg-pkgs"
and change it to:
EXTRA_IMAGE_FEATURES = "debug-tweaks"
This drops packages from the image such as perf, gcc, the include files for doing on device compilation, and the packages with debug symbols. The "Mega Manual" describes the possible values for Image features.
Next we need to disable X11 support during the build. Find this line in local.conf:
DISTRO_FEATURES_append = " opengl x11"
and comment it out like this:
# DISTRO_FEATURES_append = " opengl x11"
Distro features are also described in the manual.
Now, we need to tell the gnuradio recipe to only build essential components. The default PACKAGECONFIG options for gnuradio are in the the recipe:
#Available PACKAGECONFIG options are qtgui grc uhd logging orc ctrlport zeromq staticlibs PACKAGECONFIG ??= "qtgui grc uhd zeromq"
Assuming we still want uhd and zeromq support, we could edit the line in the recipe, but that would be poor form, so we override it from local.conf. Add this line to your local.conf file:
PACKAGECONFIG_pn-gnuradio = "uhd zeromq"
Finally, the recipe that builds gnuradio-dev-image includes a bunch of stuff to make the device easier to use for people coming from a desktop Linux environment, so lets create a file in the images directory called gnuradio-minimal-image:
SUMMARY = "A console-only image with a development/debug \ environment suitable for building UHD installed." LICENSE = "MIT" CORE_IMAGE_EXTRA_INSTALL = "\ gnuradio \ " EXTRA_IMAGE_FEATURES = "" IMAGE_FSTYPES = "tar.gz" inherit core-image
This should build a file system with enough gnuradio installed that you can copy a non-gui flowgraph onto the device and run it.
Be warned, I did this process for a similar but different build, so I am not 100% sure this works without errors. Let me know if I need to clean anything in this post. Along the way I found a problem with the gnuradio packaging that led to the development packages always ending up in the image. I've pushed a fix to the recipe, but it isn't in the versions built by the jethro or fido versions of the mmanifest. This article is to help people think about how they can change their builds to suit their specific needs.