linux-rust
PPA description
Ubuntu kernel with Rust support enabled
=======
Git repository: https:/
Steps to compile a Rust kernel module:
1) Add this ppa
2) Install prerequisite packages and rust-for-linux + linux-rust from this ppa (and reboot)
3) Git clone the linux source code:
$ git clone https:/
4) Install kernel build dependencies
$ cd linux
$ fakeroot debian/rules clean
$ sudo apt build-dep .
5) Prepare the linux source to build Rust modules:
$ cp /boot/config-
$ export PATH=/var/
$ make EXTRAVERSION=
5) Now you can build Rust modules using the prepared Linux source directory as your kernel source target
=======
Example Rust module:
== hello_rust.rs ==
// SPDX-License-
//! Rust hello world example.
//! Build with:
//! $ make KDIR=<linux_
use kernel::prelude::*;
module! {
type: HelloRust,
name: "hello_rust",
author: "Andrea Righi <email address hidden>",
description: "Rust hello world example",
license: "GPL v2",
}
struct HelloRust {
}
impl kernel::Module for HelloRust {
fn init(_module: &'static ThisModule) -> Result<Self> {
}
}
impl Drop for HelloRust {
fn drop(&mut self) {
}
}
== Makefile ==
NAME=hello_rust
export PATH:=/
ifndef KERNELRELEASE
ifndef KDIR
KDIR:=/
endif
PWD := $(shell pwd)
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
install:
$(MAKE) -C $(KDIR) M=$(PWD) modules_install
clean:
rm -f *.o *.ko *.mod* .*.cmd *.d Module.symvers modules.order
rm -rf .tmp_versions
else
obj-m := $(NAME).o
endif
Adding this PPA to your system
You can update your system with unsupported packages from this untrusted PPA by adding ppa:arighi/linux-rust to your system's Software Sources. (Read about installing)
sudo add-apt-repository ppa:arighi/linux-rust sudo apt update
For questions and bugs with software in this PPA please contact Andrea Righi.
PPA statistics
- Activity
- 0 updates added during the past month.