Skip to content

Commit ecebb1f

Browse files
committed
Add "nfs" initrd profile
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
1 parent 4c02132 commit ecebb1f

File tree

9 files changed

+51
-0
lines changed

9 files changed

+51
-0
lines changed

mkosi/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ def default(cls) -> tuple["ToolsTreeProfile", ...]:
637637
class InitrdProfile(StrEnum):
638638
lvm = enum.auto()
639639
network = enum.auto()
640+
nfs = enum.auto()
640641
pkcs11 = enum.auto()
641642
plymouth = enum.auto()
642643
raid = enum.auto()

mkosi/initrd.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,10 @@ def network_config() -> list[str]:
210210
]
211211

212212

213+
def nfs_config() -> list[str]:
214+
return [f"--extra-tree={f}:{f}" for f in ("/etc/idmapd.conf", "/etc/idmapd.conf.d") if Path(f).exists()]
215+
216+
213217
def raid_config() -> list[str]:
214218
return [
215219
f"--extra-tree={f}:{f}"
@@ -349,6 +353,8 @@ def main() -> None:
349353
cmdline += ["--profile", p]
350354
if p == "network":
351355
cmdline += network_config()
356+
elif p == "nfs":
357+
cmdline += nfs_config()
352358
elif p == "raid":
353359
cmdline += raid_config()
354360

mkosi/resources/man/mkosi-initrd.1.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ initrds and Unified Kernel Images for the current running system.
4646

4747
The `lvm` profile enables support for LVM.
4848
The `network` profile enables support for network via **systemd-networkd**.
49+
The `nfs` profile enables support for NFS. It requires networking in the
50+
initrd, using the `network` profile, or some other custom method.
4951
The `pkcs11` profile enables support for PKCS#11.
5052
The `plymouth` profile provides a graphical interface at boot (animation and
5153
password prompt).

mkosi/resources/man/mkosi.1.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,8 @@ boolean argument: either `1`, `yes`, or `true` to enable, or `0`, `no`,
10541054

10551055
The `lvm` profile enables support for LVM.
10561056
The `network` profile enables support for network via **systemd-networkd**.
1057+
The `nfs` profile enables support for NFS. It requires networking in the
1058+
initrd, using the `network` profile, or some other custom method.
10571059
The `pkcs11` profile enables support for PKCS#11.
10581060
The `plymouth` profile provides a graphical interface at boot (animation and
10591061
password prompt).
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Content]
4+
KernelModules=
5+
fs/nfs/
6+
net/sunrpc/
7+
nfs_acl
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Match]
4+
Distribution=arch
5+
6+
[Content]
7+
Packages=nfs-utils
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Match]
4+
Distribution=|debian
5+
Distribution=|ubuntu
6+
7+
[Content]
8+
Packages=nfs-common
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Match]
4+
Distribution=fedora
5+
6+
[Content]
7+
Packages=
8+
nfs-utils
9+
libnfsidmap
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: LGPL-2.1-or-later
2+
3+
[Match]
4+
Distribution=opensuse
5+
6+
[Content]
7+
Packages=
8+
nfs-client
9+
libnfsidmap1

0 commit comments

Comments
 (0)