diff options
author | Ian Stakenvicius <axs@gentoo.org> | 2013-09-05 20:10:53 +0000 |
---|---|---|
committer | Ian Stakenvicius <axs@gentoo.org> | 2013-09-05 20:10:53 +0000 |
commit | 109862290c32e30106890fb8b60cd35bc22a7828 (patch) | |
tree | 386039b9faad4ef72996214cf6d6a119738ac3cd /net-fs | |
parent | Remove older version (diff) | |
download | historical-109862290c32e30106890fb8b60cd35bc22a7828.tar.gz historical-109862290c32e30106890fb8b60cd35bc22a7828.tar.bz2 historical-109862290c32e30106890fb8b60cd35bc22a7828.zip |
committed revbump with patches to support 3.11 kernels, thanks to johnfg_
Package-Manager: portage-2.1.12.2/cvs/Linux x86_64
Manifest-Sign-Key: 0x2B6559ED
Diffstat (limited to 'net-fs')
-rw-r--r-- | net-fs/openafs-kernel/ChangeLog | 9 | ||||
-rw-r--r-- | net-fs/openafs-kernel/Manifest | 11 | ||||
-rw-r--r-- | net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-1.patch | 102 | ||||
-rw-r--r-- | net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-2.patch | 99 | ||||
-rw-r--r-- | net-fs/openafs-kernel/openafs-kernel-1.6.5-r2.ebuild | 92 |
5 files changed, 308 insertions, 5 deletions
diff --git a/net-fs/openafs-kernel/ChangeLog b/net-fs/openafs-kernel/ChangeLog index 936b5784b64a..ae8ce9bf1ee0 100644 --- a/net-fs/openafs-kernel/ChangeLog +++ b/net-fs/openafs-kernel/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-fs/openafs-kernel # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs-kernel/ChangeLog,v 1.159 2013/09/03 13:43:45 vincent Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs-kernel/ChangeLog,v 1.160 2013/09/05 20:10:46 axs Exp $ + +*openafs-kernel-1.6.5-r2 (05 Sep 2013) + + 05 Sep 2013; Ian Stakenvicius <axs@gentoo.org> + +files/openafs-1.6.5-kernel-3.11-1.patch, + +files/openafs-1.6.5-kernel-3.11-2.patch, +openafs-kernel-1.6.5-r2.ebuild: + committed revbump with patches to support 3.11 kernels, thanks to johnfg_ 03 Sep 2013; Vicente Olivert Riera <vincent@gentoo.org> openafs-kernel-1.6.5-r1.ebuild: diff --git a/net-fs/openafs-kernel/Manifest b/net-fs/openafs-kernel/Manifest index 71155d16d33a..6ab175398a43 100644 --- a/net-fs/openafs-kernel/Manifest +++ b/net-fs/openafs-kernel/Manifest @@ -6,18 +6,21 @@ AUX openafs-1.6.2-kernel-3.8-2.patch 4761 SHA256 6638d923ae70674528cb90dabb4c7dc AUX openafs-1.6.2-kernel-3.8-3.patch 2699 SHA256 41bd2ee35867f1899f9ae4bd7df38042ef591aae0330a27c32dbb725f15e648f SHA512 fb0777696dd1780ce0ed0ae3160fedf960df91afd680f0f11896d726beec06f3534a68abce2dbb474f171cd3a400f38d948971848a653f3d63d6f410ac929b7f WHIRLPOOL 1044b75eaadff4cea49cc315bdc8c9d36db9d957571cc50a716287fa5a25132a27faf54fb8c943b85deaa7de15ad75cce044536ab3eb86715e29ab5dd334a350 AUX openafs-1.6.2-kernel-3.8-4.patch 1300 SHA256 3604174099c3a98a0596b86ed083c609c3124ff95fb73e44a81bac489a9f5c5e SHA512 feb75e80fb3ed7f868476abce7caa301908c5fda6b999e68891f174786f6b5151a9615491d6ba48bbe2b5224082ceebcc5d1d4b108a776eb104eac5e61afa0c8 WHIRLPOOL d3fa687fea25dbbc71d2dde86a57741d21cd4e6bc6153120c502c73cf7812f2ff511fab9c411f2b02727a4adbdec65c97830b7ae1315c45eba0d26f5f9baaa92 AUX openafs-1.6.2-kernel-3.8-5.patch 2463 SHA256 745bdd7e75f65ca7af3caf5bf0a85fcba1ff17a2336adc4fc286d843f7af89db SHA512 3f11aed22890ab679cfa245b19af76267b0047fa4279914b5f7616646f455485cb67191abb5eab0aeecd845e65eca43f16761a5288492c5dd91be9a9e38399ae WHIRLPOOL c1dcd37946e053fa85b1ee9592c69beee7e01ee4d5b29545145d2d8f12f2a40efee94ac5e658f5cc9199ac1d3cb5168918c53b205f2ce959aa4de28ff9fb8468 +AUX openafs-1.6.5-kernel-3.11-1.patch 3702 SHA256 ef1b1f1859e7b4e62ade92f07846e126c05525a55f3e6e0ce5ae8f0b7abc9b39 SHA512 0123a1b62605bc2b89385367bea51c59d29d83d6b92ccfe3edf65896ead9874d6b9f127e003c637448897114c8a2709d6d9d212af8f090a930959462d78aa277 WHIRLPOOL d50db673cecb3bf37f90923d0eb3eb4fa045f5111ed6e6e4de1ad2c41122c66a697b7132df1c01cacba1d8e846a6e46d82d74e8a49b34dc24149d56e5c26bde1 +AUX openafs-1.6.5-kernel-3.11-2.patch 3083 SHA256 a76ee1d2494ff48ecb73983ee7aec7aa3cd4cbb564b2443a7106aa2a4ebfeb0c SHA512 2957ef5885ab3cb2ab5250748521314091efb2df1fe432ae5fa90112c911cb49ebd819ce510b13bed7ffd36602adb58db4109edb958a38732f6cef91f0bde551 WHIRLPOOL e65e5e7c7bcf0b5c47f5fc3ae7695065568ecf2129379045bfec186d90a00e96859a0c79aebf900ed59d69d10ae8e991e9990bbcdd0234dc487f3d3472dcf1af DIST openafs-1.6.2-patches-1.tar.bz2 10880 SHA256 bde25a4ec9ab38cb9864deb38d4d3f4b3affc44969c072a3329844dbbebd1c5c SHA512 f6cd5916bc072cb855a0edfb640cf53cfdc5fb7d3b9ed0e23e9c739ea4f046653ac60b731cb469838085c92286485fafa00807b857f89ca2c90fea3dce2c9a56 WHIRLPOOL 93a6648ddc8e35c05c176a9d835fefcd97afc217bbf80547895e5da40ac4e0a85842dd89c5b3074986045db67548f766a72cd5a2c05eb24c62ae04f26a490e04 DIST openafs-1.6.2-src.tar.bz2 14378378 SHA256 0db0877cd42131a744472ad0abfa26a4402a5bad94adb4d1eada75c8b6895bc9 SHA512 769b82d4ba8fe391f7dacc1f422d0bca564450ee3e05da34296aa461fecab825956e2bea4849af65af8592ffe50853e725ee0a700c1afaea67652adf8a93c01c WHIRLPOOL 61947ee3f0e3d7107f3611add14bd90ca1f5744986f75a92a28f6ccda8936f16441ec819640eebbd0cfaffaaa716c3077980b28512a84e9be770a4320a19997a DIST openafs-1.6.5-patches-1.tar.bz2 10880 SHA256 bde25a4ec9ab38cb9864deb38d4d3f4b3affc44969c072a3329844dbbebd1c5c SHA512 f6cd5916bc072cb855a0edfb640cf53cfdc5fb7d3b9ed0e23e9c739ea4f046653ac60b731cb469838085c92286485fafa00807b857f89ca2c90fea3dce2c9a56 WHIRLPOOL 93a6648ddc8e35c05c176a9d835fefcd97afc217bbf80547895e5da40ac4e0a85842dd89c5b3074986045db67548f766a72cd5a2c05eb24c62ae04f26a490e04 DIST openafs-1.6.5-src.tar.bz2 14400420 SHA256 176fab2d710d8dcf566f5aa229fd796dd8165561d57590e32790a3034a195ef2 SHA512 2a03b87499f3304c85664787602f1e2f1988a5baa34bc7754e28f8ead6a1b70d826e63cd6ce4b4c5a97ae48fff6255a51be973c098f8a176369ae557b18830f1 WHIRLPOOL 66c058a09396054dc675351b1b27628144a7f29b2255e7192906290bd0b76ea8c08a398d773031a9835edbdd2452990cc6e3273c02e4d25560d62ddcd7318c97 EBUILD openafs-kernel-1.6.2-r1.ebuild 2675 SHA256 45010f6f5b72240ba37711fa25ad0edd0294ad2cb15279d761e6a18ceefdccd0 SHA512 f068c378fadbe66cf48dd01127a4007c6c89919bc857ac68d26d729eceec2b2e3e1325ec58f7438ffbf3b3b7e083a66ade2d87d2738622099263fc1c95af394a WHIRLPOOL 463ad4c98cad71651bad2384011c509290cc939b409ed86cbad7bf773c8552033d7f50536e793a75413d0f5425353ddfd956aa60329e38fdcaf089606f11d88b EBUILD openafs-kernel-1.6.5-r1.ebuild 2641 SHA256 78674020891ddd8b372216f520a14446b4663678d72b58ca362e058d827362fd SHA512 588afb4ae9d3ace7b5735b590439234f0aa2aa39755eb151799c8a1b0dcc5c68a5ef1b1420376b53262bcf7593e4cf82152f877bc54c1a7c91f79d9f748d8a9a WHIRLPOOL f614ae8a750fd514703f660e3bbd994f5d11cffabfba92e698d550732c658a5fd2a3e62280f18b1f58296d07f36b6fc06bf2bb127612c372b4f4ce52bdd216a0 -MISC ChangeLog 26813 SHA256 a33512afe8cbb6b3abaad41525f0fce998a97cf7f5ef7d853f92f0881ab1e75b SHA512 8c0d7cd0f2b6dddd2e341666ce5faaae9442ae525b0376862779ef0453c9f224ca467ad5a89c4001e944da7fdc818c5fcddd9aa72185c20cea1b2ac627aea3f6 WHIRLPOOL d0e5be3a72b6f72e5117da0722e8cf2babfc0884120862a818db599a7905bf0bb2da874170f681e91efca57e3818693a43fce9f4c7d4da25ab0403b59b088039 +EBUILD openafs-kernel-1.6.5-r2.ebuild 2700 SHA256 d96e53d85658522ed299fb172ea20b5ce734da76065ae31e7be65bfe27bfea47 SHA512 f60977af6a2f9bbe42b4853bb693c1c5808f05111f340235ae3ca5d8d67064cd4293a1f1f3fb07a7ff69e439e05000d260c05d1bdc55b9be09b24676dc94018e WHIRLPOOL 9cf283f0b86317b2f12e84821d295ae41cfe80fa809e01b6f0f9d7003f9f690683ad63a52996827d0d28ed8bbe342013b17d9bf104c528baa27aa392148c75c1 +MISC ChangeLog 27096 SHA256 e1874ece7309bdf030b13a4820ce930730d777d1a2e1d539da100c269a5657bf SHA512 3546c86d44b89bccad6eb2db7e6a3d7359d7e2a3d14a54a3c40d9ce42de12924c03e0dc60cda6c205cd4314829433187b5d3901dda15d020f0d0df64c0f1ab67 WHIRLPOOL 7b2c7d7e4b85c9d3d3108eb215679fabc86c7892ddbd558e1cda5cb4d089ff6b9de3b22450b087287e4e820ce8025b9ef382b41487e03ca543bf5b03dffa5a38 MISC metadata.xml 286 SHA256 b3e704b0f9a832001902f16472eafe5d2aa59afbf04b1eb6cf87f927316d87d3 SHA512 203f23847bccc6104cd62343070b5ead629a5033bf88b5468420628189d260f435606f7185c555a9849cee50ca855c370dfcb19426c6bc11b5c2da1b331e693e WHIRLPOOL 3fe5d977e05abd548bc36fa5f9be966e4cc5813f37c7052a57ba921b2540b61fd15d664c385e710ad857615a5643e599fb66fa623a29cb67420ab38a2e1d8730 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) -iEYEAREIAAYFAlIl54oACgkQWunnsum7y6i8GwCfVCbT8DGdubDzMilA2UrsgSMU -GGoAn2VErpjjB0bngdl7olxVX5/+9r3Q -=a0FE +iF4EAREIAAYFAlIo5U4ACgkQ2ugaI38ACPA6dAEAqLXhlqezH+fdeCa4yCagIxvh +FydJ6L/2Di59DhqT+BgA/1bt4+wYWq1Gp+nt+BSqfEJsU89JeOJ+qksdnaSpDw4z +=TgCY -----END PGP SIGNATURE----- diff --git a/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-1.patch b/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-1.patch new file mode 100644 index 000000000000..5047b1f4ecee --- /dev/null +++ b/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-1.patch @@ -0,0 +1,102 @@ +From 8563077e818d62a3c764caf8818d8bf24a3cb0b6 Mon Sep 17 00:00:00 2001 +From: Marc Dionne <marc.dionne@your-file-system.com> +Date: Mon, 8 Jul 2013 10:53:00 -0400 +Subject: [PATCH] Linux 3.11: Convert from readdir to iterate file operation + +Convert the readdir function so that it can be used as the new +"iterate" file operation. This new operation is passed a context +that contains a pointer to the filldir function and the offset. +The context is passed into the new dir_emit function that will +call the function specified by the context. + +The new dir_emit function returns true on success, so we must be +careful about how we check for failure since this is different +behaviour from what filldir currently does. + +Change-Id: I6b01b4c78a501bdf4f8d583b0d3b94d677c5d541 +--- + acinclude.m4 | 1 + + src/afs/LINUX/osi_vnodeops.c | 22 ++++++++++++++++++++++ + 2 files changed, 23 insertions(+), 0 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 6ffb686..15b5ad8 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -842,6 +842,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) + AC_CHECK_LINUX_STRUCT([inode], [i_mutex], [fs.h]) + AC_CHECK_LINUX_STRUCT([inode], [i_security], [fs.h]) + AC_CHECK_LINUX_STRUCT([file_operations], [flock], [fs.h]) ++ AC_CHECK_LINUX_STRUCT([file_operations], [iterate], [fs.h]) + AC_CHECK_LINUX_STRUCT([file_operations], [sendfile], [fs.h]) + AC_CHECK_LINUX_STRUCT([file_system_type], [mount], [fs.h]) + AC_CHECK_LINUX_STRUCT([filename], [name], [fs.h]) +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index 46fbb88..25cbac2 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -271,7 +271,11 @@ extern int BlobScan(struct dcache * afile, afs_int32 ablob); + * handling and use of bulkstats will need to be reflected here as well. + */ + static int ++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) ++afs_linux_readdir(struct file *fp, struct dir_context *ctx) ++#else + afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir) ++#endif + { + struct vcache *avc = VTOAFS(FILE_INODE(fp)); + struct vrequest treq; +@@ -350,7 +354,11 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir) + * takes an offset in units of blobs, rather than bytes. + */ + code = 0; ++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) ++ offset = ctx->pos; ++#else + offset = (int) fp->f_pos; ++#endif + while (1) { + dirpos = BlobScan(tdc, offset); + if (!dirpos) +@@ -408,7 +416,13 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir) + * holding the GLOCK. + */ + AFS_GUNLOCK(); ++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) ++ /* dir_emit returns a bool - true when it succeeds. ++ * Inverse the result to fit with how we check "code" */ ++ code = !dir_emit(ctx, de->name, len, ino, type); ++#else + code = (*filldir) (dirbuf, de->name, len, offset, ino, type); ++#endif + AFS_GLOCK(); + } + DRelease(&entry, 0); +@@ -419,7 +433,11 @@ afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir) + /* If filldir didn't fill in the last one this is still pointing to that + * last attempt. + */ ++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) ++ ctx->pos = (loff_t) offset; ++#else + fp->f_pos = (loff_t) offset; ++#endif + + ReleaseReadLock(&tdc->lock); + afs_PutDCache(tdc); +@@ -748,7 +766,11 @@ out: + + struct file_operations afs_dir_fops = { + .read = generic_read_dir, ++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) ++ .iterate = afs_linux_readdir, ++#else + .readdir = afs_linux_readdir, ++#endif + #ifdef HAVE_UNLOCKED_IOCTL + .unlocked_ioctl = afs_unlocked_xioctl, + #else +-- +1.7.2.5 + diff --git a/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-2.patch b/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-2.patch new file mode 100644 index 000000000000..3ffddf083e24 --- /dev/null +++ b/net-fs/openafs-kernel/files/openafs-1.6.5-kernel-3.11-2.patch @@ -0,0 +1,99 @@ +From 6482f944119254da9cdea533d7ca89d3d46f0559 Mon Sep 17 00:00:00 2001 +From: Marc Dionne <marc.dionne@your-file-system.com> +Date: Tue, 3 Sep 2013 07:55:14 -0400 +Subject: [PATCH] Linux 3.11: Adapt to d_count changes + +In preparation for upcoming changes in the 3.12 cycle, d_lockref +was introduced late in the 3.11 cycle. The dentry's d_lock and +d_count are moved to this new structure. A new d_lock macro makes +the change transparent for locking, but direct users of d_count +must adapt. A new d_count() helper function is provided and +should now be used. + +Use the new d_count() helper function if available, and move +some of the ifdef logic into a helper compatibility function. + +Change-Id: I32a21a174d763fb7df8f1e04da3bb7260684571d +--- + acinclude.m4 | 3 +++ + src/afs/LINUX/osi_compat.h | 28 ++++++++++++++++++++++++++++ + src/afs/LINUX/osi_vnodeops.c | 12 +----------- + 3 files changed, 32 insertions(+), 11 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 15b5ad8..800333b 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -897,6 +897,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) + AC_CHECK_LINUX_FUNC([d_alloc_anon], + [#include <linux/fs.h>], + [d_alloc_anon(NULL);]) ++ AC_CHECK_LINUX_FUNC([d_count], ++ [#include <linux/dcache.h>], ++ [d_count(NULL);]) + AC_CHECK_LINUX_FUNC([d_make_root], + [#include <linux/fs.h>], + [d_make_root(NULL);]) +diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h +index ce9178e..fdddf59 100644 +--- a/src/afs/LINUX/osi_compat.h ++++ b/src/afs/LINUX/osi_compat.h +@@ -608,4 +608,32 @@ afs_proc_create(char *name, umode_t mode, struct proc_dir_entry *parent, struct + #endif + } + ++static inline int ++afs_dentry_count(struct dentry *dp) ++{ ++#if defined(HAVE_LINUX_D_COUNT) ++ return d_count(dp); ++#elif defined(D_COUNT_INT) ++ return dp->d_count; ++#else ++ return atomic_read(&dp->d_count); ++#endif ++} ++ ++static inline void ++afs_maybe_shrink_dcache(struct dentry *dp) ++{ ++#if defined(HAVE_LINUX_D_COUNT) || defined(D_COUNT_INT) ++ spin_lock(&dp->d_lock); ++ if (afs_dentry_count(dp) > 1) { ++ spin_unlock(&dp->d_lock); ++ shrink_dcache_parent(dp); ++ } else ++ spin_unlock(&dp->d_lock); ++#else ++ if (afs_dentry_count(dp) > 1) ++ shrink_dcache_parent(dp); ++#endif ++} ++ + #endif /* AFS_LINUX_OSI_COMPAT_H */ +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index e9191ae..a60027e 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -1684,17 +1684,7 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp, + rehash = newdp; + } + +-#if defined(D_COUNT_INT) +- spin_lock(&olddp->d_lock); +- if (olddp->d_count > 1) { +- spin_unlock(&olddp->d_lock); +- shrink_dcache_parent(olddp); +- } else +- spin_unlock(&olddp->d_lock); +-#else +- if (atomic_read(&olddp->d_count) > 1) +- shrink_dcache_parent(olddp); +-#endif ++ afs_maybe_shrink_dcache(olddp); + + AFS_GLOCK(); + code = afs_rename(VTOAFS(oldip), (char *)oldname, VTOAFS(newip), (char *)newname, credp); +-- +1.7.2.5 + diff --git a/net-fs/openafs-kernel/openafs-kernel-1.6.5-r2.ebuild b/net-fs/openafs-kernel/openafs-kernel-1.6.5-r2.ebuild new file mode 100644 index 000000000000..a99ab2698173 --- /dev/null +++ b/net-fs/openafs-kernel/openafs-kernel-1.6.5-r2.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/openafs-kernel/openafs-kernel-1.6.5-r2.ebuild,v 1.1 2013/09/05 20:10:46 axs Exp $ + +EAPI="5" + +inherit autotools eutils multilib linux-mod versionator toolchain-funcs + +MY_PV=$(delete_version_separator '_') +MY_PN=${PN/-kernel} +MY_P2="${MY_PN}-${PV}" +MY_P="${MY_PN}-${MY_PV}" +PVER="1" +DESCRIPTION="The OpenAFS distributed file system kernel module" +HOMEPAGE="http://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +SRC_URI="http://openafs.org/dl/openafs/${MY_PV}/${MY_P}-src.tar.bz2 + mirror://gentoo/${MY_P2}-patches-${PVER}.tar.bz2" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="~amd64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" +IUSE="" + +S=${WORKDIR}/${MY_P} + +CONFIG_CHECK="!DEBUG_RODATA ~!AFS_FS KEYS" +ERROR_DEBUG_RODATA="OpenAFS is incompatible with linux' CONFIG_DEBUG_RODATA option" +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!" +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled" + +QA_TEXTRELS_x86_fbsd="/boot/modules/libafs.ko" +QA_TEXTRELS_amd64_fbsd="/boot/modules/libafs.ko" + +pkg_setup() { + if use kernel_linux; then + linux-mod_pkg_setup + fi +} + +src_prepare() { + EPATCH_EXCLUDE="012_all_kbuild.patch" \ + EPATCH_SUFFIX="patch" \ + epatch "${WORKDIR}"/gentoo/patches + epatch "${FILESDIR}"/${P/-kernel/}-kernel-3.11-{1..2}.patch + + # packaging is f-ed up, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + eaclocal -I src/cf + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache +} + +src_configure() { + ARCH="$(tc-arch-kernel)" \ + econf \ + --with-linux-kernel-headers=${KV_DIR} \ + --with-linux-kernel-build=${KV_OUT_DIR} +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 -j1 only_libafs || die +} + +src_install() { + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.${KV_OBJ} ]] || die "Couldn't find compiled kernel module" + + MODULE_NAMES="libafs(fs/openafs:${srcdir})" + + linux-mod_src_install + elif use kernel_FreeBSD; then + insinto /boot/modules + doins "${S}"/src/libafs/MODLOAD/libafs.ko + fi +} + +pkg_postinst() { + # Update linker.hints file + use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules" + use kernel_linux && linux-mod_pkg_postinst +} + +pkg_postrm() { + # Update linker.hints file + use kernel_FreeBSD && /usr/sbin/kldxref "${EPREFIX}/boot/modules" + use kernel_linux && linux-mod_pkg_postrm +} |