Build the module and the kernel it links against.
kernel-src/ (Linux v7.3, detached), pinned via git worktree off ../linux.make defconfig + enabled): CONFIGFS_FS=y, INFINIBAND=y, INFINIBAND_ADDR_TRANS=y, RDMA_RXE=m, OCFS2_FS=m, PSI=y, cgroups.make modules_prepare has been run.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
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.
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
.o. Link/runtime verification deferred.