{"id":15004306,"url":"https://github.com/rust-for-linux/rust-out-of-tree-module","last_synced_at":"2025-05-16T11:06:46.413Z","repository":{"id":37627881,"uuid":"440976023","full_name":"Rust-for-Linux/rust-out-of-tree-module","owner":"Rust-for-Linux","description":"Basic template for an out-of-tree Linux kernel module written in Rust.","archived":false,"fork":false,"pushed_at":"2025-03-10T14:13:15.000Z","size":22,"stargazers_count":301,"open_issues_count":0,"forks_count":42,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-16T11:06:40.549Z","etag":null,"topics":["linux-kernel","rust"],"latest_commit_sha":null,"homepage":"https://rust-for-linux.com","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rust-for-Linux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-12-22T20:25:39.000Z","updated_at":"2025-05-01T16:58:40.000Z","dependencies_parsed_at":"2024-05-06T01:39:11.602Z","dependency_job_id":"b3b994dd-1d76-46b6-b311-af8400b7db0e","html_url":"https://github.com/Rust-for-Linux/rust-out-of-tree-module","commit_stats":{"total_commits":20,"total_committers":7,"mean_commits":2.857142857142857,"dds":0.4,"last_synced_commit":"15de8569df46e16f4940b52c91ee8f6bfbe5ab22"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rust-for-Linux%2Frust-out-of-tree-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rust-for-Linux%2Frust-out-of-tree-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rust-for-Linux%2Frust-out-of-tree-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rust-for-Linux%2Frust-out-of-tree-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rust-for-Linux","download_url":"https://codeload.github.com/Rust-for-Linux/rust-out-of-tree-module/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518383,"owners_count":22084374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux-kernel","rust"],"created_at":"2024-09-24T19:00:51.201Z","updated_at":"2025-05-16T11:06:41.388Z","avatar_url":"https://github.com/Rust-for-Linux.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust out-of-tree module\n\nThis is a basic template for an out-of-tree Linux kernel module written in Rust.\n\nPlease note that:\n\n  - The Rust support is experimental.\n\n  - The kernel that the module is built against needs to be Rust-enabled (`CONFIG_RUST=y`).\n\n  - The kernel tree (`KDIR`) requires the Rust metadata to be available. These are generated during the kernel build, but may not be available for installed/distributed kernels (the scripts that install/distribute kernel headers etc. for the different package systems and Linux distributions are not updated to take into account Rust support yet).\n\n  - All Rust symbols are `EXPORT_SYMBOL_GPL`.\n\nExample:\n\n```sh\n$ make KDIR=.../linux-with-rust-support LLVM=1\nmake -C .../linux-with-rust-support M=$PWD\nmake[1]: Entering directory '.../linux-with-rust-support'\n  RUSTC [M] .../rust-out-of-tree-module/rust_out_of_tree.o\n  MODPOST .../rust-out-of-tree-module/Module.symvers\n  CC [M]  .../rust-out-of-tree-module/rust_out_of_tree.mod.o\n  LD [M]  .../rust-out-of-tree-module/rust_out_of_tree.ko\nmake[1]: Leaving directory '.../linux-with-rust-support'\n```\n\n```txt\n[    1.076945] rust_out_of_tree: Rust out-of-tree sample (init)\n[    1.084944] rust_out_of_tree: My numbers are [72, 108, 200]\n[    1.085944] rust_out_of_tree: Rust out-of-tree sample (exit)\n```\n\nFor details about the Rust support, see https://rust-for-linux.com.\n\nFor details about getting started with kernel development in Rust, see https://docs.kernel.org/rust/.\n\nFor details about out-of-tree modules, see https://docs.kernel.org/kbuild/modules.html.\n\n## rust-analyzer\n\nRust for Linux (with https://lore.kernel.org/rust-for-linux/20230121052507.885734-1-varmavinaym@gmail.com/ applied) supports building a `rust-project.json` configuration for [`rust-analyzer`](https://rust-analyzer.github.io/), including for out-of-tree modules:\n\n```sh\nmake -C .../linux-with-rust-support M=$PWD rust-analyzer\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-for-linux%2Frust-out-of-tree-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-for-linux%2Frust-out-of-tree-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-for-linux%2Frust-out-of-tree-module/lists"}