Debian Edit Modify Build and Flash Kernel

From Variscite Wiki
Revision as of 22:46, 19 February 2022 by Nate (talk | contribs) (Add = Building a custom device tree =)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
DART-MX8M-MINI - Customizing the Debian Linux kernel


This section describes how to build a new kernel configuration using menuconfig and deploy it.

1 Building a custom device tree

To build and install a custom device tree, add the filename to G_LINUX_DTB in https://github.com/varigit/debian-var/blob/debian_buster_var01/variscite/imx8mm-var-dart/imx8mm-var-dart.sh

2 Configuring the kernel

The default kernel configuration file used by Debian is part of the kernel source tree and is located at:

~/var_mx8mm_dart_debian_buster/src/kernel/arch/arm64/configs/imx8_var_defconfig


To configure the kernel using Debian:

3 Modifying the kernel configuration

To modify the kernel configuration (add/remove features and drivers) please follow the steps below:

$ cd ~/var_mx8mm_dart_debian_buster/src/kernel
$ sudo make ARCH=arm64 mrproper
$ sudo make ARCH=arm64 imx8_var_defconfig
$ sudo make ARCH=arm64 menuconfig

Navigate the menu and select the desired kernel functionality

Exit the menu and answer "Yes" when asked "Do you wish to save your new configuration?"

$ sudo make ARCH=arm64 savedefconfig
$ sudo cp arch/arm64/configs/imx8_var_defconfig arch/arm64/configs/imx8_var_defconfig.orig
$ sudo cp defconfig arch/arm64/configs/imx8_var_defconfig

3.1 Building a new kernel configuration

3.1.1 Build the kernel image, dtb files and kernel modules

$ cd ~/var_mx8mm_dart_debian_buster
$ sudo MACHINE=imx8mm-var-dart ./var_make_debian.sh -c kernel
$ sudo MACHINE=imx8mm-var-dart ./var_make_debian.sh -c modules


Note: If you have modules newly added / removed, make sure you run the following command:
$ sudo MACHINE=imx8mm-var-dart ./var_make_debian.sh -c rtar

This will create a rootfs.tar.gz file that contains your new modules.

3.2 Deploy the kernel image, dtb files and kernel modules

3.3 Deploy Kernel, dtb via network

3.3.1 Updating Device tree to target

Transfer dtbs to target
On PC:

$ cd ~/var_mx8mm_dart_debian_buster
$ scp output/*.dtb root@<yourboard-ip>:/boot/

Once prompted give root as password. <yourboard-ip> is ipaddress of your board.
Once transfer is done, follow below commands
On Target Console:

# sync;reboot
Note: If you just intend to do dtb, then only follow this section and reboot the target


3.3.2 Updating kernel Image to target

Transfer the output/Image.gz kernel image to target
On PC:

$ scp output/Image.gz root@<yourboard-ip>:/boot/

Once prompted give root as password. <yourboard-ip> is ipaddress of your board.
Once transfer is done, follow below commands
On Target Console:

# sync;reboot