Kernel Development Scripts
These are my kernel development scripts. Some are specific to my setup, others are more generic. I'm working on making them more generic over time.
Generally I assume the distro I'm using (Arch Linux.) Additionally you will need to install appropriate packages, again at some point I will try to document the required packages.
The scripts have been expanded to include some rudimentary support for the
aarch64 architecture. To use this functionality, run
The following scripts use this 3rd-party code:-
NOTE: These scripts are interdependent and assume that the they are all on
NOTE: By convention, files that end in
.sh are not designed to be
user-runnable, but are instead ran from other scripts.
kerndev-update- Updates a list of linux trees in specific directories and on specific branches. This is configured to my personal setup, so you will need to edit this script to fit your set up. The list of directories and branches are clearly separated from the actual code that updates so this is a quick task.
kerndev-create- Creates a qemu kernel development environment. The image is an Arch Linux system.
kerndev-build- Configures and builds the kernel, optionally placing header and module files into the dev env image. It accepts a single optional argument which, if provided, specifies a cross-compile target architecture.
kerndev-config- Sets kernel configuration options for the development environment.
kerndev-rebuild- Same as
kerndev-install- Installs header and module files into the dev env image. This is invoked by
kerndev-buildunless explicitly disabled.
kerndev-module-headers- Generates a stripped version of the kernel source for building external modules.
kerndev-run- Runs the kernel development environment with virtio networking.
gdbto a running dev env. Debugging config options are enabled by
kerndev-buildby default. When you run
gdbwhich automatically connects to the qemu instance.
gdb has a big issue with the CPU changing architecture on
startup, so you ought to run
kerndev-debug. If you
Remote 'g' packet reply is too long errors you have triggered this
issue and specifying arch afterwards doesn't seem to fix anything. If you need
to debug early boot code, you'll need to investigate how to work around this
checkpatch.plagainst the specified files, ignoring line length.
checkpatch.plagainst the specified files.