配置并編譯內(nèi)核參考:
https://www.cnblogs.com/kinglongmee/p/5043656.html
https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
#編譯內(nèi)核參考文檔 Arch
https://www.tldp.org/HOWTO/NFS-Root-4.html
原文參考: 如何制作nfs root 完整系統(tǒng)
https://wiki.archlinux.org/index.php/Diskless_system
https://wiki.archlinux.org/index.php/Diskless_system#NFS
參考文章:
https://www.bbsmax.com/A/gGdXyZYz4m/
NFS服務(wù)搭建,依賴nfs-utils包
具體配置:
vi /etc/exports
/srv? ? ? *(rw,fsid=0,no_root_squash,no_subtree_check)
/srv/arch? *(rw,no_root_squash,no_subtree_check)
構(gòu)建NFSROOT啟動的initramfs文件,使用內(nèi)核進行構(gòu)建,內(nèi)核需要已經(jīng)啟用NFS相關(guān)配置的內(nèi)核
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客戶端中的內(nèi)核啟動命令:
#下載內(nèi)核
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
#內(nèi)核參數(shù) nfsroot= 參數(shù)中的 ‘:’ 特別重要
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