From 08ebd830a559692f9b34a1619cca44b1888468a0 Mon Sep 17 00:00:00 2001 From: Ihor Antonov Date: Wed, 9 May 2018 10:15:16 -0400 Subject: Fix kernel crash caused by absent root device --- nixos/modules/system/boot/grow-partition.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nixos/modules/system/boot/grow-partition.nix') diff --git a/nixos/modules/system/boot/grow-partition.nix b/nixos/modules/system/boot/grow-partition.nix index 1e6f9e442b67..8c9b1502558a 100644 --- a/nixos/modules/system/boot/grow-partition.nix +++ b/nixos/modules/system/boot/grow-partition.nix @@ -30,7 +30,7 @@ with lib; boot.initrd.postDeviceCommands = '' rootDevice="${config.fileSystems."/".device}" - if [ -e "$rootDevice" ]; then + if waitDevice "$rootDevice"; then rootDevice="$(readlink -f "$rootDevice")" parentDevice="$rootDevice" while [ "''${parentDevice%[0-9]}" != "''${parentDevice}" ]; do -- cgit 1.4.1