1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 12:42:24 +00:00

* Apply a patch to propagate the --force flag in the legacy drbdadm to

drbdsetup.  Otherwise "drbdadm primary --force" won't work as
  expected (the kernel will say "State change failed: Need access to
  UpToDate data").

svn path=/nixpkgs/trunk/; revision=30195
This commit is contained in:
Eelco Dolstra 2011-11-02 18:54:49 +00:00
parent 2d2ee447fb
commit d0c3f05c13
2 changed files with 19 additions and 2 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, flex, udev }:
{ stdenv, fetchurl, flex, udev, perl }:
assert stdenv.isLinux;
@ -10,7 +10,9 @@ stdenv.mkDerivation rec {
sha256 = "096njwxjpwvnl259gxq6cr6n0r6ba0h5aryvgk05hqi95jx927vg";
};
buildInputs = [ flex ];
patches = [ ./pass-force.patch ];
buildInputs = [ flex perl ];
configureFlags = "--without-distro --without-pacemaker --localstatedir=/var --sysconfdir=/etc";

View file

@ -0,0 +1,15 @@
Propagate the --force flag in the legacy drbdadm to drbdsetup.
Otherwise "drbdadm primary --force" won't work as expected (the kernel
will say "State change failed: Need access to UpToDate data").
diff -ru -x '*~' drbd-8.4.0-orig/user/legacy/drbdadm_main.c drbd-8.4.0/user/legacy/drbdadm_main.c
--- drbd-8.4.0-orig/user/legacy/drbdadm_main.c 2011-07-07 06:55:39.000000000 -0400
+++ drbd-8.4.0/user/legacy/drbdadm_main.c 2011-11-02 14:51:04.000000000 -0400
@@ -1547,6 +1547,7 @@
for (i = 0; i < soi; i++) {
argv[NA(argc)] = setup_opts[i];
}
+ if (force) argv[NA(argc)] = "--force";
argv[NA(argc)] = 0;
setenv("DRBD_RESOURCE", res->name, 1);