This repository provides tools and resources for customizing and building a Linux kernel with a focus on packet filtering using the Netfilter subsystem. It also includes scripts and configurations for setting up a testing environment within virtual machines.
Contains the kernel configuration, source code, and a custom kernel module. The Makefile
in this folder supports various tasks:
- config: Copies the kernel configuration file into the Linux kernel source directory.
- kbuild: Builds the entire Linux kernel.
- install: Creates a symbolic link to the compiled kernel (
bzImage
) inside thetests/vm
folder, enabling the VM to boot with this custom kernel. - kmodule: Builds the custom kernel module and copies the resulting
.ko
file into thetests/vm/shared
folder. This allows the VM's guest OS to load the module usinginsmod
.
Note: The modules
subfolder contains the source code for the custom kernel module and a Makefile
to compile and install it into the shared VM folder. Refer to the specific README.md
within the modules
folder for instructions on recompiling and copying the module after modifications.
Includes scripts and configurations to set up a containerized environment for building and running the kernel and modules.
Note: For setup instructions, see the README.md
inside the podman
folder.
Contains:
vm
: The root filesystem used by the virtual machine to run the guest OS with the custom kernel. It also includes scripts to build, run, and connect to the VM.scripts
: Collection of scripts for testing and various use cases within the VM environment.
-
Navigate to the
podman
folder:cd podman
-
Follow the instructions provided in the
README.md
within thepodman
folder to set up the containerized environment.
- After setting up the environment, you can build and install the kernel and modules using the provided make targets.
- Use the scripts inside the
tests/scripts
folder for testing specific functionalities within the VM.
This repository is designed to facilitate customizing the Linux kernel, building kernel modules, and testing them within virtual machines, all orchestrated through containerized environments. Follow the provided instructions in each subfolder's README.md
files to properly set up and operate the environment.
For further assistance or questions, refer to the individual README files within each folder.