| Crates.io | rfl-template |
| lib.rs | rfl-template |
| version | 0.1.5 |
| created_at | 2025-12-05 09:21:56.807116+00 |
| updated_at | 2025-12-07 17:17:19.081498+00 |
| description | A CLI tool to scaffold Rust for Linux kernel modules |
| homepage | |
| repository | https://github.com/bensantora/rfl-template |
| max_upload_size | |
| id | 1967921 |
| size | 17,874 |
This crate is no longer actively maintained. The repository has been archived and no additional development or support will occur.
I consent to the transfer of this crate to the first person who asks help@crates.io for it.
Thank you for any past interest and usage.
A CLI tool to scaffold Rust for Linux (RFL) kernel modules with proper boilerplate and conventions.
cargo install --path .
Or build from source:
cargo build --release
# Binary will be in target/release/rfl-template
rfl-template new my_driver \
--author "Your Name" \
--description "My awesome kernel driver" \
--license "GPL-2.0"
rfl-template new my_driver
This will use default values:
my_driver/
├── Cargo.toml # Rust package configuration
├── Kbuild # Kernel build system integration
├── README.md # Build and usage instructions
└── src/
└── lib.rs # Module implementation
The tool generates a basic kernel module with:
// SPDX-License-Identifier: GPL-2.0
//! My awesome kernel driver
use kernel::prelude::*;
module! {
type: MyDriver,
name: "my_driver",
author: "Your Name",
description: "My awesome kernel driver",
license: "GPL-2.0",
}
struct MyDriver;
impl kernel::Module for MyDriver {
fn init(_module: &'static ThisModule) -> Result<Self> {
pr_info!("my_driver: Module loaded\n");
Ok(MyDriver)
}
}
impl Drop for MyDriver {
fn drop(&mut self) {
pr_info!("my_driver: Module unloaded\n");
}
}
Module names must:
Valid: my_driver, test_module, driver2
Invalid: MyDriver, my-driver, 2driver
Generated modules require a Linux kernel source tree with Rust support enabled.
See the generated README.md in each module for detailed build instructions.
Usage: rfl-template new <NAME> [OPTIONS]
Arguments:
<NAME> Name of the kernel module
Options:
-a, --author <AUTHOR> Author name
-d, --description <DESCRIPTION> Module description
-l, --license <LICENSE> License [default: GPL-2.0]
-h, --help Print help
Common kernel-compatible licenses:
GPL-2.0 (default)GPL-2.0-onlyGPL-2.0-or-laterMITApache-2.0BSD-3-Clauserfl-template new char_device \
--author "John Doe" \
--description "A character device driver" \
--license "GPL-2.0"
rfl-template new net_driver \
--author "Jane Smith" \
--description "A network device driver"
Contributions are welcome! Please feel free to submit issues or pull requests.
MIT OR Apache-2.0
Made for the Rust for Linux community 🦀🐧