8000 Add "nfs" (and "network") initrd profiles by aafeijoo-suse · Pull Request #3766 · systemd/mkosi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add "nfs" (and "network") initrd profiles #3766

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aafeijoo-suse
Copy link
Contributor

nfs-utils-2.8.4 will provide its own nfsroot-generator [1] to allow mounting the real rootfs via NFSv4, so we can create an "nfs" initrd profile to support it. Also, this requires some type of networking in the initrd, so I also created a "network" profile to enable systemd-networkd.

Tested in openSUSE Tumbleweed using a custom OBS build [2] and in Fedora rawhide, since it already ships nfs-utils-2-8-4-rc2 [3].

[1] http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=ed86ea08dadafbac948c6a45629a6f3282a77233
[2] https://build.opensuse.org/package/show/home:afeijoo:branches:openSUSE:Factory:nfsroot/nfs-utils
[3] https://src.fedoraproject.org/rpms/nfs-utils/c/e7f85470bc0ba53a3338468f50ffc62bf0f03cba?branch=rawhide

This profile provides networking in the initrd using systemd-networkd.
@aafeijoo-suse aafeijoo-suse force-pushed the initrd-profiles-network-nfs branch from 88446ea to ffac73d Compare June 11, 2025 15:57
[Content]
KernelModules=
fs/nfs/
net/ipv6/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not also ipv4? Also maybe this should rather be part of the network profile and not only the nfs profile?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, ipv6 is only required for rpcbind, hence we don't need those modules here since the generator is for NFSv4.

In any case, it wouldn't hurt to always add some network kernel modules with the network profile. We could use dracut as a reference to start: https://github.com/dracutdevs/dracut/blob/master/modules.d/90kernel-network-modules/module-setup.sh#L39-L44

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds reasonable.

nfs-utils-2.8.4 will provide its own nfsroot-generator [1] to allow mounting the
real rootfs via NFSv4, so this initrd profile will enable this feature.

[1] http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=ed86ea08dadafbac948c6a45629a6f3282a77233
@aafeijoo-suse aafeijoo-suse force-pushed the initrd-profiles-network-nfs branch from ffac73d to e2838d6 Compare June 16, 2025 10:12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a file for Arch and Debian as well? In Arch the required packages should be nfs-utils and procps-ng with the idmapping library being required by nfs-utils. In Debian the required packages should be procps (for sysctl) and nfs-common (for mount.nfs4, libnfsidmap1 is also a hard dependency of this).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could, but do you want to add this before the version of nfs-utils/nfs-common that provides this feature is released? Also, that would require some changes in the network profile, since at least Debian/Ubuntu ship systemd-networkd with the systemd package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, forgot again that this is yet unreleased.

I think I'd add them and note in the docs, that this needs at least version 2.8.4 or adding a generator of ones own. That seems easier than monitoring when these needed versions migrate into releases. For Debian this will probably be a while anyway, since they've frozen for trixie already and something newer than 2.8.3 will only make it into a release in two years. What do you think, @DaanDeMeyer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah let's just add all of these right away, no need to wait until the distribution ships a recent enough version of nfsutils

Comment on lines +1 to +4
# SPDX-License-Identifier: LGPL-2.1-or-later

enable systemd-networkd.service
enable systemd-resolved.service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'm OK with going with this approach for now but can I interest you by any chance to add support for /usr/lib/systemd/initrd-preset to systemd? I'm confident that sharing presets between initrd and main system is not going to scale in the long run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can only see problems with cases like the Debian/Ubuntu mentioned before, where systemd-networkd is shipped with the systemd package, so maybe they would enable it without wanting to do it, because the systemd package is always included. That said, IMO it should be on a separate package...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0