As I continue down this rabbit hole I find that in buildroot the nfs-utils in nfs-utils.mak nfsv4 is specifically disabled.
NFS_UTILS_CONF_OPTS = \
--disable-nfsv4 \
--disable-nfsv41 \
--disable-gss \
--disable-uuid \
--enable-tirpc \
--enable-ipv6 \
--without-tcp-wrappers \
--with-statedir=/run/nfs \
--with-rpcgen=$(HOST_DIR)/bin/rpcgen
HOST_NFS_UTILS_CONF_OPTS = \
--disable-nfsv4 \
--disable-nfsv41 \
--disable-gss \
--disable-uuid \
--disable-ipv6 \
--without-tcp-wrappers \
--with-statedir=/run/nfs \
--disable-caps \
--disable-tirpc \
--without-systemd \
Need to be changed to enable nfsv4 to this
NFS_UTILS_CONF_OPTS = \
--enable-nfsv4 \
--enable-nfsv41 \
--disable-gss \
--disable-uuid \
--enable-tirpc \
--enable-ipv6 \
--without-tcp-wrappers \
--with-statedir=/run/nfs \
--with-rpcgen=$(HOST_DIR)/bin/rpcgen
HOST_NFS_UTILS_CONF_OPTS = \
--enable-nfsv4 \
--enaable-nfsv41 \
--disable-gss \
--disable-uuid \
--disable-ipv6 \
--without-tcp-wrappers \
--with-statedir=/run/nfs \
--disable-caps \
--disable-tirpc \
--without-systemd \
Once enabled the package and initrd need to be recompiled.
In the initrd in /bin/fog.mount in lines 17 and 19
ref: mount -o nolock,proto=tcp,rsize=32768,wsize=32768,intr,noatime “$storage” /images >/tmp/mount-output 2>&1
The mount command needs to be updated to create an nfsv4 mount.
from this
up)
mount -o nolock,proto=tcp,rsize=32768,wsize=32768,intr,noatime "$storage" /images >/tmp/mount-output 2>&1
;;
down)
mount -o nolock,proto=tcp,rsize=32768,intr,noatime "$storage" /images >/tmp/mount-output 2>&1
;;
to this
up)
mount -o nolock,nfsvers=4,proto=tcp,rsize=32768,wsize=32768,intr,noatime "$storage" /images >/tmp/mount-output 2>&1
;;
down)
mount -o nolock,nfsvers=4,proto=tcp,rsize=32768,intr,noatime "$storage" /images >/tmp/mount-output 2>&1
;;
So far the FOG web code needs to be updated because the nfsv4 shares are presented differently than the >nfsv4.
nfsv3 share structure
/images/
/images/dev/
nfsv4 shares structure
/
/images/
/capture/
./lib/fog/bootmenu.class.php starting at 1497 https://github.com/FOGProject/fogproject/blob/171d63724131c396029992730660497d48410842/packages/web/lib/fog/bootmenu.class.php#L1497
Replacing
$storage = escapeshellcmd(
sprintf(
'%s:/%s/%s',
$ip,
trim($StorageNode->get('path'), '/'),
(
$TaskType->isCapture() ?
'dev/' :
''
)
)
);
to this
$storage = escapeshellcmd(
sprintf(
'%s:/%s',
$ip,
(
$TaskType->isCapture() ?
'capture/' :
trim($StorageNode->get('path'), '/')
)
)
);
Its still not clear if there is a benefit to the cost of modifying the code to support NFS v4 over just keeping everything the same.