Debian Customizing U-Boot

From Variscite Wiki
Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release mx8mm-debian-bookworm-6.6.52_24.12-v1.0.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release


DART-MX8M-MINI - Customizing U-Boot

Introduction

This guide demonstrates how to patch and rebuild Debian U-Boot images.

To learn how to build the U-Boot images outside of Debian, see: Build U-Boot from source code

Prerequirements

Make sure you set up the Flexbuild Docker environment properly. Follow the instructions from step 5 of the Build Debian from source code page.

Add your patches on top of the Variscite source code

The following steps can be executed outside or inside the container.

Fetch the U-Boot source:

$ git clone https://github.com/varigit/uboot-imx -b lf_v2024.04_6.6.52-2.2.0_var01
$ cd uboot-imx
$ git clean -fdx

Next, make the desired changes to the U-Boot source code. Example:

$ vim drivers/net/fsl_enetc.c
$ vim drivers/net/fsl_enetc.h

After changing the source code, commit the changes locally and generate a patch file:

$ git add .
$ git commit -e
$ git format-patch -1

Once the patch is created, copy it to the U-Boot patch folder, which is inside the Flexbuild directory:

$ mkdir -p [...]/flexbuild/patch/uboot/
$ cp 0001-my-changes.patch [...]/flexbuild/patch/uboot/

Build U-Boot individually

Do not run any 'git am' or 'git apply' command. That will be done inside the U-Boot Makefile. Now, if you're not inside the container, get in with the following commands:

$ cd [...]/flexbuild             (Outside Docker environment)
$ . setup.env                    (Outside Docker environment)
$ bld docker                     (Outside Docker environment)

Once you've entered the Docker environment, run:

$ bld -f sdk-var.yml -m imx8mm-var-dart uboot             (Inside Docker environment)

Rebuild U-Boot

Once you've built U-Boot, a clean step is needed if a rebuild is required:

$ bld clean-bsp                                           (Inside Docker environment)

Then, just build U-Boot normally with:

$ bld -f sdk-var.yml -m imx8mm-var-dart uboot             (Inside Docker environment)