I am wanting to develop some out-of-tree LKM's in Rust and have just finished enabling Rust Support in my kernel (enabling CONFIG_RUST) and I've also cloned rust-for-linux, though I don't understand how this directory enables the kernel and am unsure of what needs to be done with it.
Can anyone clarify how I am suppose to use rust-for-linux while writing an out-of-tree kernel module? I'm just not seeing this info on the website.
there's a template, it's very similar to a out of tree module in C, just with .rs files instead of .c files to be compiled:
the build is actually driven by the master Makefile in the kernel source tree (with r4l enabled), you just specifies the M variable to point to the directory of the module.
you can check out the provided Kbuild and Makefile for reference.
Yeah, I should have mentioned I've got a skeletal kernel mod written w/ Makefile and KBuild. But that's not the rust-for-linux source that I cloned (and which all the build instructions claim I need for ... some reason). AFAIK, rust-for-linux is for reference, but not really used in the actual running kernel that was enabled with Rust in anyway.