Building / verifying Voltron

Build the module and the kernel it links against.

1Kernel tree

2To verify the module (needs Module.symvers from a built kernel)

The module compiles to .o already; the final modpost link needs the kernel's Module.symvers, which only exists after a kernel build.

# 1) Build the kernel (you are doing this). Mind RAM: -j16 OOM'd with ~4GB free.
#    Prefer a conservative job count, e.g.:
cd kernel-src && make -j4            # produces Module.symvers

# 2) Build the out-of-tree module against it:
cd ../src && make                    # KDIR defaults to ../kernel-src
#    -> voltron.ko

3Remote build (prepared kernel-build box)

If a machine already has the v7.3 kernel tree built (with Module.symvers), build the module there in one step:

cd src
make remote          # rsync src/ + include/ to the box and build voltron.ko
make remote-fetch    # copy the built voltron.ko back to ./
make remote-clean    # clean the remote module build

Defaults target root@10.2.1.29 with the kernel at /root/build/linux and the module at /root/build/voltron. Override as needed:

make remote REMOTE=root@host REMOTE_KDIR=/path/to/linux REMOTE_DIR=/path/to/voltron
The build box may be an LXC container (build-only) — voltron.ko built there is for that kernel's vermagic and must be loaded on a matching v7.3 host/VM.

4Loading / runtime test

Running host kernel here is 6.12, build target is 7.3 — so insmod must happen in a v7.3 VM (QEMU harness TBD), not on this host.

sudo insmod voltron.ko
ls /sys/kernel/voltron/           # version default_mode cluster/ policy/
# feed a fake node (normally done by voltron-ctld):
echo "2 10.0.0.2 fe80::2" | sudo tee /sys/kernel/voltron/cluster/add_node
echo "4026531835"          | sudo tee /sys/kernel/voltron/policy/add_cgroup
cat /sys/kernel/voltron/policy/cgroups/4026531835/mode   # -> deny
sudo rmmod voltron

5Status