📜 ⬆️ ⬇️

Review of build systems for Raspberry Pi

In the past, my choice fell on OpenEmbedded (OE) and deservedly; it is one of the best build systems. I did not consciously approach the choice at that time and wanted to correct it, so I decided to look at the current decisions.

The thought would not have occurred to me if the Raspberry Pi (RPi) board was not at hand, the popularity of which goes off-scale - this means one thing: trying new assembly systems should be easier than ever.

Looking ahead, I want to say that I wanted to choose an assembly system for any board, whether it’s RPi or not - it’s not important and I was pleasantly surprised by the number of solutions that have already been made for this board.
')


Motive


About two or three years ago, my main and only build system was OpenEmbedded , so it turned out that there was no need to try something else. I just decided that it is better to study one system well and the fact that it is popular is only a plus, rather than go the other way and try as many build systems as possible.

My opinion now is that at that time I didn’t have a debugging board for which there were solutions for other build systems. But there were no such solutions as RPi , but I’m cunning - there was a BeagleBoard board, but if you choose now, RPi is much cheaper.

Therefore, starting all over again, I wanted to try to approach the choice of assembly systems more consciously and at the same time to see if something had changed. (and really changed)

The goal of this article is to introduce very briefly the assembly systems and give the most working instructions to avoid a bad impression.

I gave a brief excerpt about all the impressions in the section “Conclusion”, so you can safely go there if you do not want to waste your time on assembling images.

Why do you need it

Suppose you want to build your image for RPi and are faced with the choice of how to do it (the image is GNU / Linux based firmware for the debugging board) and you do not know where to start.

Here you will find a way to do it, but not one, but 6 at once, because I managed to try so many assembly systems.

Who is this article useful for?

This article is intended for a person who understands the Linux-a command line, since All examples considered in it were checked under Arch Linux x84_64, which means that they most likely will work for you too.

He will also have to install the missing packages and programs needed for the build system that he chooses through the application manager of his system. This step is very simple, because almost every build system itself indicates which program is not installed.

The rest of the article provides simple instructions for assembling, gives a list of solutions to the problems that have appeared.

And of course, do not forget that the article is designed for RPi.

Criteria

I have several criteria for the build system:
  1. I have to like her
  2. It should work under GNU / Linux.
  3. It should be comfortable


I will explain them:

Like, the system that I want to use and a year and two and 5 +. And if there is no support for my debug board, then I’ll add it with pleasure.

My main system is Arch Linux x86_64.

Convenience is the availability of documentation, performance, i.e. it is convenient to work with her.

List of build systems


I already knew several build systems, such as OpenEmbedded and PTXdist, the search gave me a few more, but later I took the list here :



The list is compiled from the least to the most liked system.

Observations in difference assemblies



Assembly systems


Highlights

Before proceeding to the assemblies themselves, here I will describe the main points that were used in the preparation of the description.



Openbricks

About the system

This is the build system used by the GeeXBox project - a Linux distribution with a media center.

For me, it turned out to be the most difficult to use, because there are no instructions for assembling as such, there is a very simple description and it does not work, but I managed to figure out and build the image and it started, but ... gave an error.

But, you can try already collected images on the project page (see links)

Instructions

I tried to collect the image under the main (host) machine, errors appeared (see errors), I got tired.
I downloaded the image of Ubuntu under VirtualBox, I launched it under it, it did not get together, it turned out there was a problem in understanding.

I tried to build an image using the OpenBricks repository, but it turned out to be more test, i.e. On the GeeXBox website, it is written that if there is not going there, then this is normal. The working one turned out to be the GeeXBox repository, but the build via make menuconfig was not successful, so it was decided to use make * defconfig.

Using these instructions, an image was obtained:

export OB=$SANDBOX/ob mkdir $OB && cd $OB hg clone http://hg.geexbox.org/geexbox cd geexbox make geexbox-xbmc-bcm2708-raspberrypi_defconfig make # #   # wget http://download.geexbox.org/snapshots/geexbox-xbmc-bcm2708-raspberrypi/latest/binaries.raspberrypi/make-sdcard chmod +x make-sdcard ./make-sdcard /dev/mmcblk0 geexbox-3.0.raspberrypi.tar.bz2 raspberrypi 


Errors



Links



Screenshot



LTIB

About the system

The build system that Freescale uses for its BSPs.

It uses perl to build packages, and the packages themselves are stored in rpm, which in itself is unusual.

Another feature - LTIB does not compile Toolchain, but downloads or uses ready-made, which is a minus for me.

Instructions

 export LTIB=$SANDBOX/ltib mkdir $LTIB && cd $LTIB cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/ltib co -P ltib cd ltib ./ltib # # : # # -   rpm,  rpm-org # -   sudo,     sudo # -     # # #   # cd $LTIB git clone https://github.com/midnightyell/RPi-LTIB.git cp RPi-LTIB/ltib/opt/ltib/pkgs/*.rpm /opt/ltib/pkgs/ ./ltib # #   # sudo config/platform/rpi/rpi_mksdimage.sh -B rootfs/boot/ -R rootfs.ext2.gz sudo dd if=rpi_sdcard.img of=/dev/mmcblk0 


It was okay, but in the end the output did not show up at the terminal (uart or com port), it turned out that it was just turned off. It was possible to connect to the device via ssh and get into the console. (it turned out not obvious)

Errors



Links



Screenshot



PTXdist

About the system

The system that Pengutronix uses.

This build system is divided into 2 stages, the compiler assembly (toolchain) and the very image of the system. Those. it turns out that the image is going for two actions, and not for one. Perhaps this is a minus.

In the past, this system seemed to me quite interesting. It was convenient to use, and the code inside it is structured and readable.

Instructions

At the first search I found on github-e a variant of this build system for RPi, but I could not build it (the compiler was assembled, there was no image). The problem, as it seems to me, is that according to probability it was compiled under debian Linux, which is most likely ubunta, but I don’t have it.

But I did not want to stop and believe that no one used this build system for RPi. And I found an option that is on the main Pengutronix repository.

Instructions that allowed me to build an image (and pay attention to the section with errors below):

 export PTX=$SANDBOX/ptx mkdir $PTX && cd $PTX # #  ptxdist # git clone git://git.pengutronix.de/git/ptxdist.git cd ptxdist/ ./autogen.sh mkdir out ./configure --prefix=`pwd`/out make && make install export PATH=`pwd`/out/bin:$PATH cd .. # #  toolchain # wget http://www.ptxdist.de/oselas/toolchain/download/OSELAS.Toolchain-2011.11.3.tar.bz2 tar -xjf OSELAS.Toolchain-2011.11.3.tar.bz2 cd OSELAS.Toolchain-2011.11.3/ ptxdist select ptxconfigs/arm-1136jfs-linux-gnueabi_gcc-4.6.2_glibc-2.14.1_binutils-2.21.1a_kernel-2.6.39-sanitized.ptxconfig ptxdist --force menuconfig ptxdist --force go cd .. # #   # git clone http://git-public.pengutronix.de/git-public/OSELAS.BSP-Pengutronix-Generic.git cd OSELAS.BSP-Pengutronix-Generic git clone git://git.pengutronix.de/git/platform-pengutronix-raspberrypi.git ptxdist select configs/ptxconfig ptxdist platform platform-pengutronix-raspberrypi/platformconfig ptxdist toolchain /opt/OSELAS.Toolchain-2011.11.3/arm-1136jfs-linux-gnueabi/gcc-4.6.2-glibc-2.14.1-binutils-2.21.1a-kernel-2.6.39-sanitized/bin ptxdist --force go ptxdist --force images # #    SD  # sudo dd if=./platform-pengutronix-raspberrypi/images/hd.img of=/dev/mmcblk0 


Errors



Links


Screenshot



Yocto Project / OpenEmbedded

About the system

OpenEmbedded is an assembly system that is used by anyone, it contains a lot of packages and is very popular in itself and the main thing is that it all works.

But when I began searching for build systems for RPi, I came across a Yocto project that I knew nothing about and it turned out that he was using OpenEmbedded within himself.

It appeared in 2010-2011 and it turned out that the goal is quite good - to improve the developer’s tools for working with embedded systems and to take OpenEmbedded as the basis.

As a result, more stable builds, more tests and better documentation, I managed to run a little through these facts, but there were very few problems compiling the image.

Therefore, boldly united, the OpenEmbedded and Yocto project in one section.

Instructions

 export YOCTO=$SANDBOX/yocto mkdir $YOCTO && cd $YOCTO # #  # git clone git://git.yoctoproject.org/poky cd poky git clone https://github.com/djwillis/meta-raspberrypi.git source oe-init-build-env build # #  # emacs conf/local.conf #          #  # # BB_NUMBER_THREADS = "4" # # PARALLEL_MAKE = "-j 4" # # MACHINE ?= "raspberrypi" # emacs conf/bblayers.conf #      meta-raspberrypi    # : # # BBLAYERS ?= " \ # /home/m039/Trash/sandbox/yocto/poky/meta \ # /home/m039/Trash/sandbox/yocto/poky/meta-raspberrypi \ # /home/m039/Trash/sandbox/yocto/poky/meta-yocto \ # /home/m039/Trash/sandbox/yocto/poky/meta-yocto-bsp \ # " # #     - , , #       . # # #   # bitbake rpi-basic-image # #    SD  # sudo dd if=./tmp/deploy/images/rpi-basic-image-raspberrypi.rpi-sdimg of=/dev/mmcblk0 

Errors


Links


Screenshot



Buildroot

About the system

This build system uses OpenWrt .

I have not used this system before, so I can’t add anything about it, but I liked it. It was very easy to use and earned almost immediately.

But the installation of the image was not beautiful.

Instructions

 export BR=$SANDBOX/br mkdir $BR && cd $BR git clone --depth 1 git://github.com/gamaral/rpi-buildroot.git cd rpi-buildroot make raspberrypi_defconfig make # #   # sudo mkfs.vfat -F 16 -n boot /dev/mmcblk0p1 sudo mkdir -p mnt/boot sudo mount /dev/mmcblk0p1 mnt/boot sudo cp output/images/boot/* mnt/boot sudo umount mnt/boot sudo mkfs.ext3 -L rootfs /dev/mmcblk0p2 sudo mkdir -p mnt/rootfs sudo mount /dev/mmcblk0p2 mnt/rootfs sudo tar -xvpsf output/images/rootfs.tar -C mnt/rootfs sudo umount mnt/rootfs 


Errors



Links



Screenshot



Openwrt

About the system

Same as BuildRoot, but compiled without errors.

Instructions

 export OW=$SANDBOX/ow mkdir $OW && cd $OW git clone https://code.google.com/p/raspberrypi-openwrt/ make menuconfig #  bcm2835 make # #   # sudo dd if=./bin/brcm2708/openwrt-brcm2708-sdcard-vfat-ext4.img of=/dev/mmcblk0 


Links



Screenshot



Conclusion


Impression

If you follow the news and understand builds, then of course, there is nothing new for you, but if you are stuck in one place, then RPi is a very good chance to try something new, because old projects are updated and start to support something then new and RPi in the lists they have one of the first.

I was extremely surprised and glad that I learned about projects like the Yocto project and the OpenWRT that once bypassed me. The first is an excellent development of OpenEmbedded, but technically nothing new, the second project I just wanted to try.

For myself, I chose to try the BuildRoot and, if something does not suit me, I will switch to the Yocto project (instead of the OpenEmbedded).

And of course, you do not need to collect your distributions (or images), if you can try it already ready, it will be much easier. On each site from the assembly systems there are already ready images.

My little research came to an end and, as a result, decided to include it in this article.

What missed


Material for further research


The last word

If you find a mistake, please let me know - I will correct it.
If you wish, I will add links to the images I got.
If you have comments, comments, some text seems too simple and not necessary, please write in person.
Added screenshots.

Source: https://habr.com/ru/post/172349/


All Articles