Weekly Progress Report: Building Bela Images

Hello, this is a weekly report for my GSoC’22 project Building Bela Images. My mentors are Giulio Moro, Vedant Paranjape,Vaishnav Achath and from now this thread will be updated weekly.

Youtube Video: Introductory Video of the project
Blog Link: https://krvprashanth.in/gsoc2022

Summary of Week 1 & 2

These two week I couldn’t progress much, spent most hours on resolving build errors and downloading source to my build machine and understand the workflows of both bela-image-builder and BeagleBoard Image builder repos to reproduce Bela and BeagleBoard Images and I was not much clear about my project timeline, and struggled a bit to get started and things were not excepted as thought.

After going through both Bela and Beagleboard Image builders workflows. I came to know how useful is to use package management while building these GNU/Linux distributions.

Most of the bela software was distributed this way, as git clone and that required compiling, Installing in build process. In bela image development installing some software manually requires a very conscious effort to and one need to know when changes are made and obtain them in a useful form and be careful during the updates/upgrades in order to not loose custom configuration information or to break the existing configuration and also need to make sure that files that are no longer needed are removed in a timely fashion and the new version does not conflict with other software on the system and also when software is removed, all traces are gone except configuration files that would be hard to replace if the software is later re-installed.

Further more, many libraries and header files may be needed on the system to compile from source. Besides the difficulty in obtaining them, and wasting of disk space, version clashes are quite common and cause one to pull one’s hair out. As in beagleboard Image development debian packaging system taking care of all these issues and packaging system present a far better alternative and it is one of the main roles a linux distribution performs.

bela-image-builder has no package management like beagleboard-image-builder and anyhow, most of the embedded linux distributions were collection of tarballs, of either binaries or sources which required compilation. Embedded distributions ( like bela ) still work this way. However, this method has many disadvantages and updates and upgrades can be very difficult, for a number of reasons files which are no longer needed may remain on the system and in place upgrades done while the system is running may cause difficulties and even system crashes and the software that require simultaneous updating may conflict with each other.

Sophisticated modern package management systems like the one which beagleboard-image-builder and debian has tremendous improvements. Packaging system makes easy for repeatable builds as in my case in first week I’m able to reproduce beagleboard images with ease while it took me so much time on resolving in build errors to reproduce bela image and also packaging system preserve customized and modified configuration files while updates and upgrades. Simple installation and removal methods. That’s were in week 2 I started packaging bela required dependencies to include in the apt package manager that used in beagleboard-image-builder.

Accomplishments

Blockers

  • I have not been able to work on makefiles while packaging Bela

Week 3 & 4

Final Exams - No Code

Accomplishments

Blockers

  • No Blockers

Upcoming Targets

1 Like

Week 5

In weekly meet mentor suggested to work on building sample bela image with omap-image-builder scripts first in order to verify, test and does it possible to build bela Images and later focus on packaging Bela required dependencies.

Accomplishments

Blockers

  • Unable to boot the built bela-stretch Image
  • Not able to Install bela base packages with debootstrap by using omap-Imap-builder scripts.

Upcoming Targets

  • Build latest bela-bullseye Image with omap-image-builder
    • flash and boot the image
    • copy on the board the Bela repo cd into it and do ‘makelib’
    • enable the BB-BELA-00A0.dtbo device tree overlay
    • create a root user, make it the default user, with no password and also delete the debian user that would be there as default
    • make EXAMPLE=Fundamentals/sinetone in the Bela folder and it should work

Week 6

Accomplishments

  • Built bela-bullseye Image with omap-image-builder scripts

  • Tested the built bela-bullseye Image

    • Flash and booted the Image
    • Installed Xenomai Kernel and Libraries, am335x PRU package, seasocks

Blockers

  • No Blockers

Upcoming Targets

  • Add these files to Bela Image build scripts in omap-image-builder

    • bela-image-builder/misc/rootfs/lib/systemd/system
    • bela-image-builder/misc/rootfs/opt/Bela
    • more in general all the files that are in bela-image-builder/misc/rootfs have a reason to be there.
  • And also those in

    • /lib/system : copy them over and enable bela_button, bela_ide (systemctl enable bela_button bela_ide)
    • /opt/Bela: copy them over
    • /root : copy them over
    • /etc: need to be checked one by one to see what special settings have been applied
  • bela_gadget files

    • check what differences there are with the omap-image-builder version (They have a service called bb-usb-gadgets.service . See what that does and what file it uses)
    • see whether it can “inject” some of these changes in the upstream version or whether we should be maintaining a “forked” version
  • /lib/systemd/system/bela_flash_emmc.service and /opt/Bela/bela_flash_emmc.sh has similar problems.

Week 7

July 25 - July 31


  • Had weekly meeting with Giulio Moro on Monday, 25 July, 4:00 pm CEST ( 7:30 pm IST ) and for minutes of meet check here
  • Currently, bela-image-builder ships hvcc (heavy hvcc compiler) that has python2 dependencies of pip2, enum, jinja2 and Debian 11 (bullseye) has removed the " python package and the /usr/bin/python symlink due to the deprecation of Python 2… though it has minimal support for python 2.7 adjusted everything for python3-<package name> ( updated python3 version of hvcc and added dependency package tox in bela-bullseye conf ) and also removed enum package that no more it required.
  • Looked at how bela-gadget is different with compared to bb-usb-gadget (what that does and what file it uses) and whether it can be ‘inject’ some of bela changes init.
  • bb-usb-gadget, takes over anything to do with usb gadget loading… and it has a systemd script which didn’t exist in prior then bullseye (https://github.com/rcn-ee/repos/blob/master/bb-usb-gadgets/suite/bullseye/debian/bb-usb-gadgets.bb-usb-gadgets.service)
  • Started working on to create a bela-customizations debian package.
  • Initialized a repo for bela-customizations and copied the /misc/rootfs of bela-image-builder repo ( https://github.com/BelaPlatform/bela-image-builder/tree/master/misc/rootfs ) into it and used this repo as source for debian packaging.
  • Studied about systemd System and Service Manager and Lennart Poettering’s blog which has lots of information about systemd
  • Debian packaged bela customizations.
  • Used this dh_installsystemd to package the bela systemd files.
  • While packaging systemd files learnt a lot about systemd and service manager spent some good time on this and systemd files are fun to deal with… bela had a tone of them!!! :wink:

Accomplishments

  • update to python3 version of hvcc compiler [PR #205]
  • Add debian package configuration of bela customizations [PR #61]

Blockers

  • No Blockers

Upcoming Targets

  • Debian package updated/packaged.
    • hvcc
    • prudebug

2 package/week (taking a comfortable room, if some package needs more work).

  • Build a bela-bullseye Image with all the changes made in upstream repo (omap-image-builder) by Aug 5 and after build test the Image and debug if it needs.
  • Make some more Bela specific changes in omap-image-builder scripts and also to make sure Bela Image Development follows the workflow of omap-image builder build process.
    • bela_gadget files
    • systemd configuration
    • Installing Bela, bela kernel, Building kernel module (rtdm_pruss_irq), Setting-up clang
    • boot/drivers (BELABOOT)

Week 8

August 1 - August 7


  • Had weekly meeting with Giulio Moro on Monday, 1 August, 4 pm CEST ( 7:30 pm IST ) and for minutes of meet check here
  • Started working debian packaging of heavy hvcc compiler.
  • Used dh-virtualenv to package the heavy hvcc compiler source.
  • Debian packaged hvcc.

Accomplishments

Blockers

  • No Blockers

Upcoming Targets

  • Work on last week pending targets

  • Debian package updated/packaged.

    • prudebug
  • Build a bela-bullseye Image with all the changes made in upstream repo (omap-image-builder) by Aug 5 and after build test the Image and debug if it needs.

  • Make some more Bela specific changes in omap-image-builder scripts and also to make sure Bela Image Development follows the workflow of omap-image builder build process.

    • bela_gadget files
    • systemd configuration
    • Installing Bela, bela kernel, Building kernel module (rtdm_pruss_irq), Setting-up clang
    • boot/drivers (BELABOOT)

Week 9

August 8 - August 14


  • Had weekly meeting with Giulio Moro on Monday, 1 August, 4 pm CEST ( 7:30 pm IST ) and updated last week progress.
  • Build a bela-bullseye Image with all the changes made in upstream repo (omap-image-builder)
  • Started working bela boot.

Accomplishments

  • No Accomplishments, this week i was not feeling well had to take rest.

Blockers

  • No Blockers

Upcoming Targets

  • Work on last week pending targets
  • Debian package updated/packaged.
    • prudebug
      -rtdm_pruss_irq
  • Make some more Bela specific changes in omap-image-builder scripts and also to make sure Bela Image Development follows the workflow of omap-image builder build process.
    • bela_gadget files
    • systemd configuration
    • Installing Bela, bela kernel, Building kernel module (rtdm_pruss_irq), Setting-up clang

*Typo Monday, 8 August, 4 pm CEST ( 7:30 pm IST )

Week 10

August 15 - August 21


  • Worked on bela boot.
  • Built a bela-bullseye Image with all the changes made till date in omap-image-builder (upstream repo)
  • And, asked Giulio Moro, Dhruva Gole to test the bela-bullseye-image on board to get feedback and make changes upon it.
  • Bela Images - http://gfnd.rcn-ee.org:33044/workspace/bela-images/
  • Added /etc/ssh/sshd_config.d/allow-unsecure.conf file in bela customizations
  • Enabled Bela systemctl services
  • Debugging the built image as boot partition is missing.
  • Started working on rtdm_pruss_irq.

Accomplishments

  • bela boot [PR #208]
  • Built bela-bullseye image and also flash and booted the Image

Blockers

  • Unable to install rtdm_pruss_irq need to understand clearly about the linux kernel headers that it required.

Upcoming Targets

need both built the bela_defconfig from bela-image-builder

  • Xenomai repo (which contains libcobalt and the rtdm headers) can be built as a Debian package: it contains a debian/ folder.
    TASK: build this as a package and make it available the usual way
  • Build a Bela Image with all these changes made in and after build test the Image and debug if it needs.

Week 11

August 22 - August 28


  • Had weekly meeting with Giulio Moro, Dhruva Gole on Monday, 22 August, 4:30 pm CEST ( 8:00 IST ) and for minutes of meet check here
  • Started working on debian packaging ti-linux-xenomai-4.14.y kernel branch with bela configured config from https://github.com/RobertCNelson/ti-linux-kernel-dev builds
  • ti-linux-xenomai-bela-4.14.y branch was forked from ti-linux-xenomai-4.14.y to build the ti-linux-xenomai-4.14.y kernel debian package for bela images with bela’s config and initialized bela_deconfig from bela-image-builder/kernel and overwritten patches/deconfig.

The build results in the following packages:

| linux-image-4.14.108-ti-xenomai-bela-r2 | linux-imagedeb |
| linux-headers-4.14.108-ti-xenomai-bela-r2 | linux-headers
deb |

  • Debian packaged Xenomai repo (which contains libcobalt and the rtdm headers) and also it contains a debian packages configuration and rebuilt it v3.0.13 and made it available the usual way as it was.

The build results in the following packages:

| xenomai-v3.0-runtime | Xenomai runtime utilities |
| libxenomai1-v3.0 | Shared libraries for Xenomai |
| libxenomai-v3.0-dev | Headers and static libraries for Xenomai |
| xenomai-v3.0-kernel-source | Sources of the Xenomai 2.x kernel |

target/chroot/bela.io-bullseye.sh

  • Added bela install script along with install required deb packages and also change source installation path to /root
  • Installed seasocks, am335x_pru_package before building bela so the later does not fail
  • Cleaned up checkinstall and also xenomai installation script in chroot in order to install with deb packages

configs/bela.io-debian-bullseye-v4.14-ti-xenomai-armhf.conf

  • Added clang,tree, xenomai-v3.0.13 (libxenomai-v3.0-dev, xenomai-v3.0-kernel-source, xenomai-v3.0-runtime, libxenomai1-v3.0) and removed libstdc++6-10-dbg,clang-3.9
  • Updated naming and description to bela specific

Built a Bela Image with all these changes made and also flash and booted the Image on board.


Accomplishments

  • source to build the ti-linux-xenomai-4.14.y kernel debian package with bela configured config [PR #53]
  • Add xenomai (stable/v3.0.x) debian packages configuration PR #63
  • some more bela specific changes [PR #209]
  • Built a Bela Image with all these changes made and also flash and booted the Image on board.

Blockers

  • Unable to install rtdm_pruss_irq

Upcoming Targets

  • Work on rtdm_pruss_irq installation and demo running sinetone example
  • Create detailed Documentation about the changes made in Bela Image development process and also a guide about contributing to Bela Image development and how to make use of code base.
  • Write the overall project summary and outcomes.

Update: Extended my GSoC contribution period to september 26 and the current state of the project is that we can able to build bela image and which shows that it can work with omap-image-builder scripts and in order to release/out it needs some more minor changes to do and work on and i think those can be acheived by coming two weeks as my college term is starting again and so i’ll be contributing less during the coming weeks, it feels like this way with these new dates i will be in a much better position to properly finish things off including all the final steps.

Week 12

August 29 - September 4


  • Had weekly meeting with Giulio Moro, Dhruva Gole on Monday, 29 August, 4:00 pm CEST ( 7:30 pm IST ) and for minutes of meet check here
  • Worked on rtdm_pruss_irq installation and demo running sinetone example
  • Built bela-bullseye image again to make it sinetone example work…

Accomplishments

  • bela-customizations [PR #64]
  • Bela overlays loading properly and the sinetone example running out of the box and loading the Bela IDE in browser.

Blockers

  • No Blockers

Upcoming Targets

  • Create the root user, delete the debian user and allow to login via ssh as root.
  • Get dual partitioning for the Bela image (Bela Boot, rootfs)
  • Add bela-specific changes to the usb gadget in bela-customizations package.