Debian Customizing U-Boot

From Variscite Wiki
Revision as of 22:09, 3 June 2025 by Bruno (talk | contribs)
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 - Debian Customize from source code

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

Add your patches on top of the Variscite source code

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, create a diff file, edit, and save:

$ git diff > uboot-imx/uboot.diff

Refer to the instructions on how to download the Debian source code and apply the U-Boot patch during the Debian image build process. After cloning the Debian source code, it will be located in the ~/debian_imx8mm_var_dart/ti-bdebstrap/".

Create the directory ~/debian_imx8mm_var_dart/ti-bdebstrap/patches/ti-u-boot and copy the uboot.diff patch.

$ mkdir -p ~/debian_imx8mm_var_dart/ti-bdebstrap/patches/ti-u-boot
$ cp /uboot-imx/uboot.diff  ~/debian_imx8mm_var_dart/ti-bdebstrap/patches/ti-u-boot

Refer to Build and flash the Debian image with uboot changes.

Use your remote repository on GitHub

Create a GitHub account and upload your proprietary U-Boot to a new repository: You can fork our repository to your account by visiting the following link and clicking on "Fork" at the top right of the screen: https://github.com/varigit/uboot-imx/tree/lf_v2024.04_6.6.52-2.2.0_var01

Alternatively, you can clone the repository to your local machine, and push it later to your account.

Refer to How to Download Debian Source Code. After downloading the source, open the file ~/debian_imx8mm_var_dart/ti-bdebstrap/configs/bsp_sources.toml and locate the tag _var01.

   atf_srcrev = "00f1ec6b8740ccd403e641131e294aabacf2a48b"
   optee_srcrev = "012cdca49db398693903e05c42a254a3a0c0d8f2"
   uboot_srcuri = "https://github.com/varigit/ti-u-boot.git"  #change to your repository name of uboot
   uboot_srcrev = "80ceb4d91326e00edd22a3fabf5dd2d64f6a7635"  #update the hash with the latest commit
   linux_fw_srcrev = "09.02.00.010"

Finally refer to Build the Debian image with updated u-boot repository.