Merge branch 'openafs' of git://github.com/errge/nixpkgs
Openafs fixes
This commit is contained in:
commit
4216e42ca8
|
@ -46,6 +46,16 @@ in
|
||||||
description = "Cache directory.";
|
description = "Cache directory.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
crypt = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "Whether to enable (weak) protocol encryption.";
|
||||||
|
};
|
||||||
|
|
||||||
|
sparse = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = "Minimal cell list in /afs.";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -70,18 +80,23 @@ in
|
||||||
startOn = "started network-interfaces";
|
startOn = "started network-interfaces";
|
||||||
stopOn = "stopping network-interfaces";
|
stopOn = "stopping network-interfaces";
|
||||||
|
|
||||||
preStart = ''
|
preStart = ''
|
||||||
mkdir -m 0755 /afs || true
|
mkdir -p -m 0755 /afs
|
||||||
mkdir -m 0755 -p ${cfg.cacheDirectory} || true
|
mkdir -m 0700 -p ${cfg.cacheDirectory}
|
||||||
${pkgs.module_init_tools}/sbin/insmod ${openafsPkgs}/lib/openafs/libafs-*.ko || true
|
${pkgs.module_init_tools}/sbin/insmod ${openafsPkgs}/lib/openafs/libafs-*.ko || true
|
||||||
${openafsPkgs}/sbin/afsd -confdir ${afsConfig} -cachedir ${cfg.cacheDirectory} -dynroot -fakestat
|
${openafsPkgs}/sbin/afsd -confdir ${afsConfig} -cachedir ${cfg.cacheDirectory} ${if cfg.sparse then "-dynroot-sparse" else "-dynroot"} -fakestat -afsdb
|
||||||
'';
|
${openafsPkgs}/bin/fs setcrypt ${if cfg.crypt then "on" else "off"}
|
||||||
|
'';
|
||||||
|
|
||||||
postStop = ''
|
# Doing this in preStop, because after these commands AFS is basically
|
||||||
umount /afs
|
# stopped, so systemd has nothing to do, just noticing it. If done in
|
||||||
|
# postStop, then we get a hang + kernel oops, because AFS can't be
|
||||||
|
# stopped simply by sending signals to processes.
|
||||||
|
preStop = ''
|
||||||
|
${pkgs.utillinux}/bin/umount /afs
|
||||||
${openafsPkgs}/sbin/afsd -shutdown
|
${openafsPkgs}/sbin/afsd -shutdown
|
||||||
rmmod libafs
|
${pkgs.module_init_tools}/sbin/rmmod libafs
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
assert stdenv.isLinux;
|
assert stdenv.isLinux;
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "openafs-1.6.1-${kernel.version}";
|
name = "openafs-1.6.6-${kernel.version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://www.openafs.org/dl/openafs/1.6.1/openafs-1.6.1-src.tar.bz2;
|
url = http://www.openafs.org/dl/openafs/1.6.6/openafs-1.6.6-src.tar.bz2;
|
||||||
sha256 = "1c7mid0dwl2x0sikr70bi5cs881y6pa4dfwkdmr3jscvx3wgfpnh";
|
sha256 = "0xfa64hvz0avp89zgz8ksmp24s6ns0z3103m4mspshhhdlikypk3";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ autoconf automake flex yacc ncurses perl which ];
|
buildInputs = [ autoconf automake flex yacc ncurses perl which ];
|
||||||
|
@ -41,6 +41,5 @@ stdenv.mkDerivation {
|
||||||
license = stdenv.lib.licenses.ipl10;
|
license = stdenv.lib.licenses.ipl10;
|
||||||
platforms = stdenv.lib.platforms.linux;
|
platforms = stdenv.lib.platforms.linux;
|
||||||
maintainers = stdenv.lib.maintainers.z77z;
|
maintainers = stdenv.lib.maintainers.z77z;
|
||||||
broken = true;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue