Rebuilding Ubuntu on BeagleV-Fire

HI,
I need to add a few kernel drivers to the Ubuntu distribution on the BeagleV-Fire in order to support a custom CAPE. All of the fabric is now working but the sw side needs the kernel drivers (and potentially some other parts).

@RobertCNelson , I see that you have documented a number of build steps in BeagleV-Fire / BeagleV-Fire-ubuntu · GitLab

  • However it is not clear what the build platform is for these steps
    (on the target or via cross-compilation on some other system… personally I tend to use Linux VMs).
  • What the dependencies are (for instance my attempt at cross-compilation fails due to missing riscv tools, elf tools, genimage and few other bits).

And for the list of steps that you have covered, what is the anticipated sequence to rebuild, run menuconfig to add kernels modules and spit out an image suitable for reprogramming the mmc?

I think that you have just noted working sequences but I am trying to find a sequence that will achieve the desired output. Cyril suggested contacting you via the forum…

Thanks in advance…

So we build everything in a docker container tied to our GitLab instance: .gitlab-ci.yml · main · BeagleV-Fire / BeagleV-Fire-ubuntu · GitLab

image: robertcnelson/beagle-devscripts-kernel-debian-12-amd64:latest
# https://git.beagleboard.org/beagleboard/ci-docker-images

Here’s the docker build: docker/beagle-devscripts-kernel-debian-12-amd64/Dockerfile · main · BeagleBoard.org / ci-docker-images · GitLab

Then for this project, other dependcies added are:

bc bison bmap-tools cpio debhelper dosfstools flex genimage kmod libelf-dev libssl-dev libyaml-dev lz4 mtools

the order of build is located here: .gitlab-ci.yml · main · BeagleV-Fire / BeagleV-Fire-ubuntu · GitLab

(ignore the caching and touch .gitlab-runner that’s just hints to use local s3 server to grab/update cache artifacts)

You can see a daily build here: Jobs · BeagleV-Fire / BeagleV-Fire-ubuntu · GitLab

(incase it’s not obvious, you can also fork ^ above and then in your ci settings, enable ci, and you’ll get builds on every commit)…

Regards,

2 Likes

Thanks, that was really helpful… looking through the docket scripts now…

[Basically, I really just want to run the build steps manually on my local development host… modifying the kernel to include some drivers that I would like… and ultimately generating a new mmc image ready for burning onto the target… KISS … the neat but elaborate docker process can end up obfuscating some of what should/could/may be a simple process]…

Cheers…

So as long as your system is close to Debian 12.x era, and install

sudo apt update ; \
sudo apt-get install -yq bc bison bmap-tools cpio debhelper dosfstools flex genimage kmod libelf-dev libssl-dev libyaml-dev lz4 mtools

If you clone torvalds’s tree here: 01_git_sync.sh will use it for references

git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ~/linux-src

Generic build steps

./01_git_sync.sh
./02_build_hss.sh
./03_build_u-boot.sh
./04_build_linux.sh
./05_generate_payload.bin.sh
sudo ./06_generate_debian_console_root.sh
sudo ./07_create_sdcard_img.sh

You find the sdcard.img under: deploy/images/

Regards,

Hi, I’ve been trying to rebuild the Ubuntu image (for BeagleV Fire) but have encountered a number of issues. Bit of a newbie so I might be missing something obvious?

I had updated the board (gateware) using the instructions at https://docs.beagle.cc/latest/boards/beaglev/fire/demos-and-tutorials/gateware/upgrade-gateware.html. That all booted just fine with the stock image and updates applied.

My build platform is Ubuntu 24.04. I cloned the repo: git clone https://openbeagle.org/beaglev-fire/BeagleV-Fire-ubuntu.git.

Following the instructions at BeagleV-Fire / BeagleV-Fire-ubuntu · GitLab (which is reflected in the docker script) the first issue I hit is in step ./04_build_linux.sh):

  • *** No rule to make target 'firmware/regulatory.db', needed by 'drivers/base/firmware_loader/builtin/regulatory.db.gen.o'. Stop.. Fixed by downloading and copying these files into linux/firmware.
  • cp: cannot stat './arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dtb': No such file or directory. Fixed by adding dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-beaglev-fire.dtb to linux/arch/riscv/boot/dts/microchip/Makefile

After this I get an sdcard image. The second issue is when I flash this to the board the linux hangs part way through the boot process (output below). If I take the image built from the repo (https://openbeagle.org/beaglev-fire/BeagleV-Fire-ubuntu/-/jobs) this works just fine.

So my questions are:

  • Why isn’t my build process just working like it seems to for the docker on the repo?
  • Why doesn’t my image work as it is built by the same process as the docker script?

Just to confirm I had run scripts 01 - 07 in order as per the script in the docker file (https://openbeagle.org/beaglev-fire/BeagleV-Fire-ubuntu/-/blob/main/.gitlab-ci.yml?ref_type=heads)

Many thanks for any support or help :slight_smile:

Output of boot attached
BeagleBootLog.txt (15.8 KB)

Very interesting! You fought bravely to get to where you are now.

I tried the same as you, but I ended up setting up docker and
snagging the image Robert set up for us already. Smooth sailing from there.

The very next thing you should expect to see is the Serial ports initializing,
which leads me to suspect a faulty device-tree or some of your settings in “.config”.

If you break u-boot, you can type in the commands from boot.scr and do a fdt print
just before you execute the last bootm go command to see the loaded DT.

It looks like I need to do this; my BeagleV Fire won’t update over the air because Ubuntu “lunar lobster” is end of life. I have a host system that’s Fedora Silverblue. I can host any container image, either with Docker or Podman.

  1. Is there an image in a repository I can pull, or do I need to do a docker build?
  2. I can use either Debian or Ubuntu on the Fire. My preference is Ubuntu 24.04 because updates will be there till April 2029, but if Debian stable is an option that’s OK. Can I use the image to build either, and how do I configure it to select the distro?

You can always pull the latest image from here:
Jobs · BeagleV-Fire / BeagleV-Fire-ubuntu · GitLab

1 Like

Thanks!! For some reason, Balena Etcher said the flash failed (Windows 11) but the board came back up in Ubuntu 24.04 LTS and everything seems to be working.

You might want to add instructions for accessing the nightly builds to https://jkridner.beagleboard.io/docs/boards/beaglev/fire/demos-and-tutorials/flashing-board.html#flashing-emmc. The main firmware download link on BeagleBoard.org still points to the original “lunar lobster” image, which is unsupported now.

This will upgrade your build:

sudo sed -i -e 's:lunar:noble:g' /etc/apt/sources.list

Then start package upgrade

sudo apt update
sudo apt-get install dpkg apt
sudo apt-get upgrade
sudo apt-get dist-upgrade

Debian Trixie (13) is an option going forward Q2 2025, trixie Freeze Timeline and Policy

Regards,

I tried that - ran into broken packages and apt was quite unhappy. I ended up re-flashing with a nightly image and everything seems to be working, albeit quite slowly.

I’m a little leery of trixie; how long before it goes stable?

This upcoming Summer…

Thanks! I can wait; I barely have time to troubleshoot my own code these days. Testing trixie on RISC-V would be a distraction. But I’d run bullseye if it’s available; I’m using that on some other devices.

We’re always happy to take merge requests! :wink:

Trixie (13) will be the ‘first’ version of Debian to support RISC-V

Regards,

1 Like

PS, you can also edit /etc/apt/sources.list and use:

https://old-releases.ubuntu.com/ubuntu/

Regards,

I tried that too - still got apt / dpkg in a corrupted state and don’t know why. I simply don’t have the time to troubleshoot stuff that worked when I bought the board.

In that case, I should probably try trixie - Ubuntu 24.04 LTS seems to be a tad on the slow side relative to 23.04.

on 24.04 double check snapd isn’t running… it was pre-installed in the original image, but forcefully disabled, ubuntu might have forced it to be renabled…

Nope - no snapd. But something is using almost 500 megabytes of RAM. The Fire has 2048 MB, right?

beagle@BeagleV:~ $ more /proc/meminfo
MemTotal:        1579084 kB
MemFree:         1217872 kB
MemAvailable:    1420504 kB
Buffers:           23304 kB
Cached:           193736 kB
SwapCached:            0 kB