-
Notifications
You must be signed in to change notification settings - Fork 305
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
Add erofs and overlayfs kernel modules to initramfs #3048
Conversation
We have been adding these kernel modules to our Automotive image via our manifests: doing it this way alternatively ensures dependant modules of composefs are inserted into the initramfs on all OSes with ostree installed. Generally this is how we install dependant kernel modules anyway for packages, via a module-setup.sh file. |
src/boot/dracut/module-setup.sh
Outdated
@@ -19,6 +19,10 @@ | |||
# You should have received a copy of the GNU Lesser General Public | |||
# License along with this library. If not, see <https://www.gnu.org/licenses/>. | |||
|
|||
installkernel() { | |||
hostonly='' instmods erofs overlay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a complex topic because I am sure there are ostree users who are not using composefs today and this may break their initramfs builds (if they e.g. don't have erofs.ko enabled).
We clearly need to do this when we make composefs the default, but it isn't yet.
I think anyone who wants to do this can pretty easily configure dracut externally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know most of these dracut commands you can add a "-o" which means "optional" and "optional" means, include it if it's there otherwise don't worry about it and skip. Would that be appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How many platforms is this "module-setup.sh" file used for, all the CentOS Stream variants, all the Fedora variants... Does it cover even more than this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RHEL 9 kernel would have this not included but Automotive kernel would, so we would need this to be optional at least for that https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2620/diffs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's other Linux systems that use ostree and dracut, I think at least some Debian variants may do so.
I know most of these dracut commands you can add a "-o" which means "optional" and "optional" means, include it if it's there otherwise don't worry about it and skip. Would that be appropriate?
I'm fine with that, it seems like it'd fix this case. It is a minor size penalty for those not using composefs now, but we want them to do so in the future for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed hostonly=''
, I'm not sure we need it. I did various testing of options today to try and create this behaviour, and none of the options suited what I wanted to do.
But, it turns out, it does the behaviour we desire by default. It skips these kernel modules if they don't exist, spits out an error message, includes everything it can and exits 0. I couldn't silence the error message, but maybe it's not a bad thing we are explicitly told these modules can't be found. I also checked the contents of the generated initramfs and everything is there.
$ sudo compress=pigz dracut -f; echo $?; sudo lsinitrd | grep -i "overlay.ko\|erofs.ko"
dracut-install: could not get modinfo from 'erofs': No such file or directory
dracut-install: could not get modinfo from 'overlay': No such file or directory
0
These kernel modules are required for composefs usage in the initramfs. The composefs use-case as of today uses an overlayfs on top of a erofs.
2306a7e
to
6879176
Compare
@ericcurtin: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
https://gitlab.gnome.org/ seems to be down, causing all builds to fail... |
These kernel modules are required for composefs usage in the initramfs.
The composefs use-case as of today uses an overlayfs on top of a erofs.