Yocto Build Linux TI

From Variscite Wiki
Revision as of 16:38, 26 April 2023 by Nate (talk | contribs) (Created page with "<!-- Set release according to "release" parameter in URL and use am62-yocto-dunfell-5.10.168_08.06.00.42-v1.0 as default --> {{INIT_RELEASE_PARAM|am62-yocto-dunfell-5.10.168_0...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release am62-yocto-dunfell-5.10.168_08.06.00.42-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
Yocto Build Linux from source code - VAR-SOM-AM62

Introduction

This guide walks through the process for manually building and installing Linux from source. It is derived from TI's Build Linux guide

Fetch source code and install dependencies

This section describes the one time process to install the toolchains and fetch the necessary source code for building Linux.

Install Toolchains to home directory

$ cd ~
$ wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz && \
   tar -Jxvf gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz -C $HOME && \
   wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz && \
   tar -Jxvf gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz -C $HOME

Fetch Source Code

Setup a working directory

$ export WORKDIR=~/am62x-var-som-linux
$ mkdir ${WORKDIR}

Fetch the Linux source:

$ cd $WORKDIR
$ git clone https://github.com/varigit/ti-linux-kernel -b ti-linux-5.10.y_var01 ti-linux-kernel

Build Linux out of Yocto tree

After fetching the source code and installing dependencies, you may return to $WORKDIR anytime and follow these steps to build Linux:

Setup the environment:

Export the working directory

$ export WORKDIR=~/am62x-var-som-linux

Export variables for building Linux

$ export PATH=$HOME/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu/bin:$PATH

Build for GP am62 SoC:

Change to kernel directory:

$ cd $WORKDIR/ti-linux-kernel

Configure the Kernel:

$ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- -j$(nproc) am62x_var_defconfig

Build Kernel:

Build All:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- -j$(nproc)

Build Image only:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- -j$(nproc) Image

Build modules only:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- -j$(nproc) modules

Build device trees only:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- -j$(nproc) dtbs