Release of my Kernel Development Tool
Lucas Tanure
tanure at linux.com
Sat May 27 03:19:42 EDT 2023
Hi,
I have been working with Kernel development and single-board computers
for a few years now, and to help me with my development, I created
this tool:
https://github.com/lucastanure/kernel_dev_tools (GPLv2)
It helps me to build and test the kernel in a faster and easy way. But
it also helps me to switch between boards (Rpi4, Vim4, Vim3, rk399) in
a reliable way.
The aim of this tool is to centralize the configuration of a
particular board (cross-compiler, kernel configuration, make targets,
etc.) in a config file and expose a simple workflow.
Example:
I have my VIM4 board configuration:
[vim4_arm64]
cc = aarch64-none-linux-gnu-
cc_path =
~/.local/bin/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin
kernel_target = Image
kernel_file = Image-devel
dtb_path = dtbs_devel
config_file = $kdt_boards/vim4_arm64_defconfig
ramfs_file = initramfs-linux-devel.img
update_ramfs = mkinitcpio -k $version -g $ramfs_file
on = kasa --alias Strip_9BA6 --type strip on --name P2
off = kasa --alias Strip_9BA6 --type strip off --name P2
And my workflow to develop the kernel is as follows:
$ export board=vim4
# Do some kernel changes
$ kb config # Configures the kernel
$ kb build # Builds the kernel
$ kb scp vim4 # Copy the kernel, modules and device trees to my VIM4
board using rsync and scp
# Reboot the board using ssh or issue:
$ kb off ; sleep 2 ; kb on # Power cycle the board if reboot by ssh
is not available
This tool has many more features, like updating kernels in image files
and removing Gerrit "Change-id" from patch files.
In the near future, I will add the following:
- Check a series of patches before upstreaming. Build the kernel with
every patch in a patch series and check for building warnings,
checkpatch, sparse, etc.
- Device tree tool to help to upstream new boards to the kernel
mainline. Like, find device nodes from a device tree that don't have a
driver for it and list Kernel configs needed by the device tree.
Happy coding
Thanks
Lucas
More information about the Kernelnewbies
mailing list