配置并编译内核参考:
https://www.cnblogs.com/kinglongmee/p/5043656.html
https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
#编译内核参考文档 Arch
https://www.tldp.org/HOWTO/NFS-Root-4.html
原文参考: 如何制作nfs root 完整系统
https://wiki.archlinux.org/index.php/Diskless_system
https://wiki.archlinux.org/index.php/Diskless_system#NFS
参考文章:
https://www.bbsmax.com/A/gGdXyZYz4m/
NFS服务搭建,依赖nfs-utils包
具体配置:
vi /etc/exports
/srv *(rw,fsid=0,no_root_squash,no_subtree_check)
/srv/arch *(rw,no_root_squash,no_subtree_check)
构建NFSROOT启动的initramfs文件,使用内核进行构建,内核需要已经启用NFS相关配置的内核
Now the initramfs needs to be constructed.
NFS
Trivial modifications to the net hook are required in order for NFSv4 mounting to work (not supported by nfsmount--the default for the net hook).
# sed s/nfsmount/mount.nfs4/ "$root/usr/lib/initcpio/hooks/net" > "$root/usr/lib/initcpio/hooks/netnfs4"
# cp $root/usr/lib/initcpio/install/net{,nfs4}
The copy of net is unfortunately needed so it does not get overwritten when mkinitcpio-nfs-utils is updated on the client installation.
Edit $root/etc/mkinitcpio.conf and add nfsv4 to MODULES, netnfs4 to HOOKS, and /usr/bin/mount.nfs4 to BINARIES.
Next, we chroot our installation and run mkinitcpio:
# arch-chroot "$root" mkinitcpio -p linux
以下修改没有理解;
# vim "$root/etc/fstab"
tmpfs /var/log tmpfs nodev,nosuid 0 0
tmpfs /var/spool/cups tmpfs nodev,nosuid 0 0
但是貌似很重要
ipxe客户端中的内核启动命令:
#下载内核
kernel tftp://${net0/gateway}/arch/boot/x86_64/vmlinuz-linux548
initrd tftp://${net0/gateway}/arch/boot/intel_ucode.img
initrd tftp://${net0/gateway}/arch/boot/x86_64/initramfs-linux548.img
#内核参数 nfsroot= 参数中的 ‘:’ 特别重要
imgargs vmlinuz-linux548 initrd=intel_ucode.img initrd=initramfs-linux548.img root=/dev/nfs nfsroot=${net0/gateway}:/arch verify=n ip=dhcp imgtrust --allow
#启动
boot