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 support for NFS #89

Open
0n0w1c opened this issue Jun 5, 2021 · 0 comments
Open

Add support for NFS #89

0n0w1c opened this issue Jun 5, 2021 · 0 comments

Comments

@0n0w1c
Copy link

0n0w1c commented Jun 5, 2021

Add support for NFS to make booting via nfsroot possible. My preference would be to pass the nfsroot as sysroot for systemd (or for booster to otherwise support overlayfs. This is a feature lacking in mkinitcpio.

For a simple test setup, if using Arch or derivative, you will want to install dnsmasq and nfs-utils to supply dhcpd, tftp, and NFS services.

/etc/dnsmasq.conf

enable-tftp
tftp-root=/srv/tftp/boot

port=0
log-dhcp
dhcp-range=192.168.1.20,192.168.1.29,24h
dhcp-option=3,192.168.1.1
dhcp-option=6,8.8.8.8
dhcp-option=17,192.168.1.10:/srv/nfs/root
dhcp-option=66,192.168.1.10

Helpful link to convert dhcp options to human readable.

Copy a root filesystem to /srv/nfs/root

/etc/exports

/srv/nfs/root 192.168.1.0/24(rw,async,sec=sys,no_root_squash,no_subtree_check)

As for setting up the /srv/tftp/boot I must leave it as a point of study. What you place in this directory depends on the client and how you wish to boot (uefi, grub, firmware). Basically, this is PXE booting and whatever the client needs to accomplish it.

The client requests a dhcp address and dhcp-options and then connects to the tftp server. The client then requests particular files from /srv/tftp/boot (ie pxelinux, kernel, initramfs). The client's init then mounts the exported NFS filesystem which it uses as the rootfs.

Example kernel command line parameters:

root=nfs:192.168.1.10:/srv/nfs/root ip=dhcp rw rootwait console=tty1 plymouth.enable=0 selinux=0 audit=0

And another shameless plug: systemd.volatile=overlay

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

No branches or pull requests

1 participant