Yocto Build Linux TI: Difference between revisions
(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...") |
|||
Line 45: | Line 45: | ||
Configure the Kernel: | Configure the Kernel: | ||
Clean directory: | |||
$ make mrproper | |||
Create .config from {{#var:KERNEL_DEFCONFIG}} | |||
$ {{#var:KERNEL_MAKE}} {{#var:KERNEL_DEFCONFIG}} | $ {{#var:KERNEL_MAKE}} {{#var:KERNEL_DEFCONFIG}} | ||
Optional: Make changes to .config and save to {{#var:KERNEL_DEFCONFIG}} | |||
$ {{#var:KERNEL_MAKE}} {{#var:KERNEL_DEFCONFIG}} | |||
$ {{#var:KERNEL_MAKE}} savedefconfig | |||
$ cp defconfig arch/arm64/configs/{{#var:KERNEL_DEFCONFIG}} | |||
Build Kernel: | Build Kernel: |
Revision as of 16:41, 26 April 2023
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:
- Visit variwiki.com
- Select your SoM
- Select the software release
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:
Clean directory: $ make mrproper Create .config from am62x_var_defconfig $ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- -j$(nproc) am62x_var_defconfig Optional: Make changes to .config and save to am62x_var_defconfig $ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- -j$(nproc) am62x_var_defconfig $ make ARCH=arm64 CROSS_COMPILE=aarch64-none-linux-gnu- -j$(nproc) savedefconfig $ cp defconfig arch/arm64/configs/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