This crate is used to generate bindings to the C side of the kernel at build time using
the bindgen tool. A particular version is required.
Install it via (note that this will download and build the tool from source)::
cd <linux_source_dir>
cargo install --locked --version $(scripts/min-tool-version.sh bindgen) bindgen-clibindgen needs to find a suitable libclang in order to work. If it is
not found (or a different libclang than the one found should be used),
the process can be tweaked using the environment variables understood by
clang-sys (the Rust bindings crate that bindgen uses to access
libclang):
-
LLVM_CONFIG_PATHcan be pointed to anllvm-configexecutable. -
Or
LIBCLANG_PATHcan be pointed to alibclangshared library or to the directory containing it. -
Or
CLANG_PATHcan be pointed to aclangexecutable.
This crate implements a kernel module that enables sworndisk running in kernel as a device mapper target, based on rust-for-linux project.
To compile this crate, you should download and build the rust-for-linux kernel first, refer to this document for details.
Our build is based on the rust-next branch of this repo, checked out with commit b2516f7af9d238ebc391bdbdae01ac9528f1109e.
After building the kernel successfully, you could build the kernel module with our make script:
KDIR=<linux_source_dir> makeTo format the codes of those crate, run:
KDIR=<linux_source_dir> make fmtTo clean object files or kernel module files, run:
KDIR=<linux_source_dir> make cleanTODO: you should prepare a virtual machine, running the kernel with rust enabled.