From 774a0a397c82c6258de1dcacafa502175f44a6e1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 10 Jan 2007 14:07:10 +0000 Subject: [PATCH] * Allow the root device to be specified by label. svn path=/nixos/trunk/; revision=7612 --- system/system.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/system/system.nix b/system/system.nix index 12d345bd2d5..d1f0164d314 100644 --- a/system/system.nix +++ b/system/system.nix @@ -71,9 +71,11 @@ rec { inherit extraUtils; autoDetectRootDevice = config.get ["boot" "autoDetectRootDevice"]; rootDevice = - (pkgs.library.findSingle (fs: fs.mountPoint == "/") - (abort "No root mount point declared.") - (config.get ["fileSystems"])).device; + let rootFS = + (pkgs.library.findSingle (fs: fs.mountPoint == "/") + (abort "No root mount point declared.") + (config.get ["fileSystems"])); + in if rootFS ? device then rootFS.device else "LABEL=" + rootFS.label; rootLabel = config.get ["boot" "rootLabel"]; inherit stage2Init; modulesDir = modulesClosure;