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,

1 Like

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.