summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-15 15:36:52 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-15 15:36:52 -0400
commitdee64b4c2cbd0a598cb79afbf54d99bc9aba9ed8 (patch)
tree32d411e1cc947256b02fbca672d486040a14dbfe /pkgs/os-specific
parent3aae32372a5c86ae8953873a573ccb9775200217 (diff)
downloadnixpkgs-dee64b4c2cbd0a598cb79afbf54d99bc9aba9ed8.tar
nixpkgs-dee64b4c2cbd0a598cb79afbf54d99bc9aba9ed8.tar.gz
nixpkgs-dee64b4c2cbd0a598cb79afbf54d99bc9aba9ed8.tar.bz2
nixpkgs-dee64b4c2cbd0a598cb79afbf54d99bc9aba9ed8.tar.lz
nixpkgs-dee64b4c2cbd0a598cb79afbf54d99bc9aba9ed8.tar.xz
nixpkgs-dee64b4c2cbd0a598cb79afbf54d99bc9aba9ed8.tar.zst
nixpkgs-dee64b4c2cbd0a598cb79afbf54d99bc9aba9ed8.zip
Work around timeouts after creating a LUKS device
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/systemd/crypt-devices-are-ready.patch22
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix7
2 files changed, 28 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/systemd/crypt-devices-are-ready.patch b/pkgs/os-specific/linux/systemd/crypt-devices-are-ready.patch
new file mode 100644
index 00000000000..4646ed0e44c
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/crypt-devices-are-ready.patch
@@ -0,0 +1,22 @@
+Do start device units for uninitialised encrypted devices, because the
+service that initialises the filesystem depends on the appearance of
+the device unit.  Also, this makes more sense to me: the device is
+ready; it's the filesystem that's not, but taking care of that is the
+responsibility of the mount unit.  (However, this ignores the fsck
+unit, so it's not perfect...)
+
+diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
+index d17bdd9..040b10e 100644
+--- a/rules/99-systemd.rules.in
++++ b/rules/99-systemd.rules.in
+@@ -14,10 +14,6 @@ KERNEL=="vport*", TAG+="systemd"
+ SUBSYSTEM=="block", KERNEL!="ram*|loop*", TAG+="systemd"
+ SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
+ 
+-# Ignore encrypted devices with no identified superblock on it, since
+-# we are probably still calling mke2fs or mkswap on it.
+-SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
+-
+ # Ignore raid devices that are not yet assembled and started
+ SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0"
+ SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index 2219d82138f..cd9cc2dae2c 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -13,7 +13,12 @@ stdenv.mkDerivation rec {
     sha256 = "0cgnnl6kqaz3als5y9g8jvsvbs4c8ccp0vl4s1g8rwk69w2cwxd2";
   };
 
-  patches = [ ./reexec.patch ./ignore-duplicates.patch ./fix-device-aliases.patch ];
+  patches =
+    [ ./reexec.patch
+      ./ignore-duplicates.patch
+      ./fix-device-aliases.patch
+      ./crypt-devices-are-ready.patch
+    ];
 
   buildInputs =
     [ pkgconfig intltool gperf libcap dbus kmod xz pam acl