From c7fd05a650c160169952382827d1aff0ced1265c Mon Sep 17 00:00:00 2001 From: Florian Friesdorf Date: Wed, 28 Dec 2011 21:46:50 +0000 Subject: [PATCH] test we have cryptsetup-1.4.1 in initrd svn path=/nixos/trunk/; revision=31132 --- modules/system/boot/luksroot.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/system/boot/luksroot.nix b/modules/system/boot/luksroot.nix index 3781e6b13b9..f89de818f27 100644 --- a/modules/system/boot/luksroot.nix +++ b/modules/system/boot/luksroot.nix @@ -38,8 +38,19 @@ in done ''; + # test whether cryptsetup finds all dependencies and is at least + # version 1.4.1 boot.initrd.extraUtilsCommandsTest = '' - $out/bin/cryptsetup --version + cryptsetup_version=$($out/bin/cryptsetup --version |cut -d' ' -f2) + if test $(echo $version |cut -d'.' -f1) -lt 1; then + if test $(echo $version |cut -d'.' -f2) -lt 4; then + if test $(echo $version |cut -d'.' -f3) -lt 2; then + echo "Somehow the version of cryptsetup is too old: $cryptsetup_version instead of 1.4.1" + exit 1 + fi + fi + fi + unset cryptsetup_version ''; boot.initrd.preLVMCommands = ''