I am new to the world of rust and in particular to rust drivers.
I'm trying to compile an example driver found on the web but for some reason I am not able to achieve it
When I try to run the command:
cargo xbuild --target x86_64-linux-kernel-module
I get the following error:
error: The sysroot can't be built for the Stable channel. Switch to nightly.
Reading about it on the web, I think I have understood that I must use the nightly version in order to compile. I have followed several steps including downloading the nightly version toolchain and setting it up.
rustup toolchain install nightly
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.51.0-nightly (c5a96fb79 2021-01-19)
rustup override set nightly
If I run: rustup show
Default host: x86_64-unknown-linux-gnu
rustup home: /path/to/snap/rustup/common/rustup
nightly-x86_64-unknown-linux-gnu (directory override for '/path/to/my/directory/linux-kernel-module-rust')
rustc 1.51.0-nightly (c5a96fb79 2021-01-19)
But, when I try to compile again I keep getting the same error.
Fun fact is that when I run: rustc --version
I get: rustc 1.43.0
Shouldn't it be rustc 1.51.0-nightly?
Any help will help me a lot.