Trucrux Inc

Linux Kernel Configuration

Customizing Linux Kernel #

Updating Defconfig #

Default kernel defconfig is

 arch/arm64/configs/imx8mq_trucrux_defconfig

Default path to kernal

build_xwayland/tmp/work/imx8mq-trux-q01-fslc-linux/linux-trucrux/5.4.142+gitAUTOINC+<commit id>/git/

Kernel can be customized using bitbake menuconfig command

$ cd ~/CodeSetup/
$ source setup-environment build_xwayland
$ bitbake -c menuconfig virtual/kernel

Now customize kernel by selecting options using

"*" = build in
"M" = Modular
" " = not selected

once finished save and exit.

The .config file is stored in

~/CodeSetup/build_xwayland/tmp/work/imx8mq-trux-q01-fslc-linux/linux-fslc-trucrux/5.4.142-r0/build/.config

Once the configuration is done the file has to be saved as a defconfig file. To save configuration as a defconfig file

$ bitbake -c savedefconfig virtual/kernel

The defconfig will be saved in

~/CodeSetup/build_xwayland/tmp/work/imx8mq-trux-q01-fslc-linux/linux-fslc-trucrux/5.4.142-r0/build/defconfig

now to apply the defconfig during kernel build, copy defconfig file to “meta-trucrux/recipies-kernel/linux/files/” as shown below.

If “files” directory is not present, create a new “files” directory

$ cd CodeSetup/build_xwayland/tmp/work/imx8mq-trux-q01-fslc-linux/linux-fslc-trucrux/5.4.142-r0/build
$ cp defconfig ~/CodeSetup/sources/meta-trucrux/recipies-kernel/linux/files/

Create a bbappend file

$ cd CodeSetup/sources/meta-trucrux/recipes-kernel/linux/
$ touch linux-trucrux_%.bbappend
$ vi linux-trucrux_%.bbappend

now add the following lines in bbappend file

SRC_URI += "file://defconfig"
KBUILD_DEFCONFIG_imx8mq-trux-q01 = "${WORKDIR}/defconfig"

bitbake linux kernel

$ bitbake linux-trucrux

Customizing Source Code #

To make changes in source code creating a local_repos is recommended.

$ cd ~/CodeSetup
$ mkdir local_repos
$ git clone https://github.com/Trucrux/linux-fslc-trucrux.git -b v5.4.142_dunfell

now use git to create a branch or make changes in same branch (creating new branch is recommended)

Make required changes in the kernel.

To include the changes during kernel build create a bbappend file as shown below:

$ cd ~/CodeSetup/sources/meta-trucrux/recipies-kernel/linux
$ touch linux-trucrux_5.4.bbappend

(ignore if bbappend is already exist)
and append the following in bbappend file

KERNEL_SRC = "git://${BSPDIR}/local_repos/linux-fslc-trucrux;protocol=file"
SRCBRANCH = "< branch name > "
SRCREV = "The commit id you'd like to use"

bitbake linux kernel

$ bitbake linux-trucrux

NOTE: bbappend files apply changes during runtime

DTSI and DTS files for SOM and DVP board #

Path : arch/arm64/boot/dts/freescale/

File Name Description
imx8mq-trux-8MDVP-dcss-mipi.dtsi DTSI file for DVP board MIPI display
imx8mq-trux-8MDVP-hdmi.dtsi DTSI file for DVP board HDMI display
imx8mq-trux.dtsi DTSI file for imx8mq-trux SOM
imx8mq-trux-8MDVP.dtsi DTSI file for DVP board
imx8mq-trux-8MDVP-sd.dtsi DTSI file for DVP board SD card
imx8mq-trux-wifi.dtsi DTSI file for WiFi
imx8mq-trux-8MDVP-sd-mipi.dts DTS file for SD card with MIPI display
imx8mq-trux-8MDVP-wifi-mipi.dts DTS file for WiFi with MIPI display
imx8mq-trux-8MDVP-sd-hdmi.dts DTS file for SD card with HDMI display
imx8mq-trux-8MDVP-wifi-hdmi.dts DTS file for WiFi with HDMI display