-
Notifications
You must be signed in to change notification settings - Fork 363
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
base: main
Are you sure you want to change the base?
Add "nfs" (and "network") initrd profiles #3766
Conversation
This profile provides networking in the initrd using systemd-networkd.
88446ea
to
ffac73d
Compare
mkosi/resources/mkosi-initrd/mkosi.profiles/nfs/mkosi.conf.d/fedora.conf
Show resolved
Hide resolved
[Content] | ||
KernelModules= | ||
fs/nfs/ | ||
net/ipv6/ |
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.
Why not also ipv4? Also maybe this should rather be part of the network profile and not only the nfs profile?
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.
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
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.
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
ffac73d
to
e2838d6
Compare
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.
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).
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 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.
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.
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?
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.
Yeah let's just add all of these right away, no need to wait until the distribution ships a recent enough version of nfsutils
# SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
enable systemd-networkd.service | ||
enable systemd-resolved.service |
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.
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.
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 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...
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