Author: NicolasPierron
Date: Sat Oct 15 21:01:30 2011
New Revision: 29855
URL: https://nixos.org/websvn/nix/?rev=29855&sc=1
Log:
Add support for NFS root file system.
Patch by Rickard Nilsson.
Modified:
nixos/trunk/modules/system/boot/stage-1-init.sh
nixos/trunk/modules/system/boot/stage-1.nix
Modified: nixos/trunk/modules/system/boot/stage-1-init.sh
==============================================================================
--- nixos/trunk/modules/system/boot/stage-1-init.sh Sat Oct 15 16:34:26
2011 (r29854)
+++ nixos/trunk/modules/system/boot/stage-1-init.sh Sat Oct 15 21:01:30
2011 (r29855)
@@ -221,8 +221,10 @@
# 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..."
Modified: nixos/trunk/modules/system/boot/stage-1.nix
==============================================================================
--- nixos/trunk/modules/system/boot/stage-1.nix Sat Oct 15 16:34:26 2011
(r29854)
+++ nixos/trunk/modules/system/boot/stage-1.nix Sat Oct 15 21:01:30 2011
(r29855)
@@ -169,6 +169,11 @@
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.
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits