Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for Linux 6.1 #3

Merged
merged 1 commit into from
Jan 21, 2023

Conversation

rnestler
Copy link
Contributor

I tried building the kernel module for the Linux 6.1 kernel and these were the changes that were needed. I'm not sure if it makes sense to merge this, since it is probably due to changes in https://github.com/Rust-for-Linux/linux which were not yet up-streamed, but if anyone tries something similar this diff might be helpful.

@ojeda
Copy link
Member

ojeda commented Dec 19, 2022

Yeah, this template was intended to match the rust branch in the other repo, but soon it will make sense to move it to match mainline. Thanks for the PR, I am sure it will be useful for somebody!

@ojeda
Copy link
Member

ojeda commented Jan 20, 2023

Raphael, could you please rebase it for the current mainline? The b change is not needed anymore. Thanks!

@rnestler
Copy link
Contributor Author

Raphael, could you please rebase it for the current mainline? The b change is not needed anymore. Thanks!

It fails without the b changes for 6.1.7 which is the latest release in the 6.1 series.

Or do you mean I should update it for 6.2-rc4?

@ojeda
Copy link
Member

ojeda commented Jan 21, 2023

Yeah, I meant to the latest Linus' tag (the change is there since -rc1), 6.2 should be out in a few weeks.

@ojeda
Copy link
Member

ojeda commented Jan 21, 2023

Or we can put this in, and you can send another PR for the b change and we merge it a bit later.

@rnestler
Copy link
Contributor Author

Or we can put this in, and you can send another PR for the b change and we merge it a bit later.

Sounds good to me 🙂

@rnestler
Copy link
Contributor Author

@ojeda
Copy link
Member

ojeda commented Jan 21, 2023

Nice! Thanks for documenting it! :)

By the way, on:

I'm also considering reporting this to the ArchLinux developers, but I'm not sure how much priority Rust kernel modules should have, given the early stage. I'll probably wait until Linux 6.2 is released before investigating further.

I would say it is indeed a bit too early to put things in distros -- many pieces will need to arrive into mainline to make it useful for end users and to make it production ready. But, of course, playing with it and starting to see how it could be eventually bundled in distros is great :)

As for the metadata files etc.: everything must be compiled with the exact same toolchain. In any case, for playing around with Rust modules, it is easier to do so in-tree, since as you have seen, you have to compile the kernel with Rust support enabled anyway (and currently to do anything useful you will need to add extra abstractions to the kernel crate, too), thus I recommend to just add your module to the kernel tree directly instead of dealing with two folders/repos.

@ojeda ojeda merged commit a5de4e6 into Rust-for-Linux:main Jan 21, 2023
@rnestler rnestler deleted the fix-build-for-linux-6.1 branch March 3, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants