Add support for NFS root file system.

Patch by Rickard Nilsson.

svn path=/nixos/trunk/; revision=29855
This commit is contained in:
Nicolas Pierron 2011-10-15 21:01:30 +00:00
parent 5164ca570f
commit 38bc39c299
2 changed files with 9 additions and 2 deletions

@ -221,8 +221,10 @@ mountFS() {
# For CIFS mounts, retry a few times before giving up.
local n=0
while true; do
if mount -t "$fsType" -o "$options" "$device" /mnt-root$mountPoint; then
break
if [ "$fsType" = "nfs" ]; then
nfsmount "$device" "/mnt-root$mountPoint" && break
else
mount -t "$fsType" -o "$options" "$device" "/mnt-root$mountPoint" && break
fi
if [ "$fsType" != cifs -o "$n" -ge 10 ]; then fail; break; fi
echo "retrying..."

@ -169,6 +169,11 @@ let
cp ${kernelPackages.splashutils}/${kernelPackages.splashutils.helperName} $out/bin/splash_helper
''}
# Copy nfsmount if there is any NFS mounts required for boot.
${optionalString (filter (fs: fs.fsType == "nfs" && (fs.mountPoint == "/" || fs.neededForBoot)) fileSystems != []) ''
cp -v ${pkgs.klibc}/lib/klibc/bin.static/nfsmount $out/bin
''}
${config.boot.initrd.extraUtilsCommands}
# Run patchelf to make the programs refer to the copied libraries.