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

Add erofs and overlayfs kernel modules to initramfs #3048

Closed
wants to merge 1 commit into from

Conversation

ericcurtin
Copy link
Collaborator

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.

@ericcurtin ericcurtin self-assigned this Sep 19, 2023
@ericcurtin
Copy link
Collaborator Author

ericcurtin commented Sep 19, 2023

We have been adding these kernel modules to our Automotive image via our manifests:

https://gitlab.com/CentOS/automotive/sample-images/-/blob/main/osbuild-manifests/include/computed-vars.ipp.yml#L101

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.

@@ -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
Copy link
Member

@cgwalters cgwalters Sep 19, 2023

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.

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

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

Copy link
Member

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.

Copy link
Collaborator Author

@ericcurtin ericcurtin Sep 20, 2023

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.
@ericcurtin ericcurtin force-pushed the add_overlay_and_erofs_to_initrd branch from 2306a7e to 6879176 Compare September 20, 2023 09:59
@openshift-ci
Copy link

openshift-ci bot commented Sep 20, 2023

@ericcurtin: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images 6879176 link true /test images
ci/prow/fcos-e2e 6879176 link true /test fcos-e2e

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.

@ericcurtin
Copy link
Collaborator Author

https://gitlab.gnome.org/ seems to be down, causing all builds to fail...

@ericcurtin ericcurtin closed this Sep 20, 2023
@cgwalters cgwalters deleted the add_overlay_and_erofs_to_initrd branch September 20, 2023 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants