Error in using kernel::fs module

I am struggling to get a bare fs module going so far on Ubuntu 23.04.

I just set up my environment by following the steps

The demo code works, but when i using the same framework to compile the example code

It won't compile, and the error is:

error[E0432]****: unresolved import kernel::fs
--> /home/osilab/rust_module/
2 | use kernel::{c_str, fs};
| ^^ no fs in the root

I don't know how to fix this. Using a straight Rust-for-Linux kernel may resolve the issues I think.

The docs page you're looking at corresponds to the upstream rust-for-linux project's repository, and not to the Linux 6.2 release.

To see docs that match up with what you have, I'm pretty sure (CC @josh? I'm not an active contributor to rust-for-linux.) you would want to download the source package (you can get it here) and run make rustdoc.

Or just look at the files. I looked in the rust/ folder, and saw that the fs module wasn't there. That way I didn't have to compile it.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.