diff options
author | Cheyenne Wills <cwills@witznd.net> | 2024-11-14 12:31:06 -0700 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-11-16 09:31:49 +0000 |
commit | 0f31b49a7cacc5f9e71b5721c46879eb7c6d46bf (patch) | |
tree | 0ac32fbacacdb3a6b992f80a7c80eea92c879a71 /net-fs | |
parent | dev-util/stripe-mock: Stabilize 0.192.0 amd64, #943615 (diff) | |
download | gentoo-0f31b49a7cacc5f9e71b5721c46879eb7c6d46bf.tar.gz gentoo-0f31b49a7cacc5f9e71b5721c46879eb7c6d46bf.tar.bz2 gentoo-0f31b49a7cacc5f9e71b5721c46879eb7c6d46bf.zip |
net-fs/openafs: add 1.8.13
Closes: https://bugs.gentoo.org/943361
Closes: https://bugs.gentoo.org/933779
Closes: https://bugs.gentoo.org/910214
Closes: https://bugs.gentoo.org/886183
Closes: https://bugs.gentoo.org/908700
Closes: https://bugs.gentoo.org/909327
Closes: https://bugs.gentoo.org/828989
Closes: https://bugs.gentoo.org/926801
Signed-off-by: Cheyenne Wills <cwills@witznd.net>
Closes: https://github.com/gentoo/gentoo/pull/39306
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-fs')
27 files changed, 1586 insertions, 0 deletions
diff --git a/net-fs/openafs/Manifest b/net-fs/openafs/Manifest index a5e32ac409ab..9872ccdd593f 100644 --- a/net-fs/openafs/Manifest +++ b/net-fs/openafs/Manifest @@ -1,3 +1,5 @@ +DIST openafs-1.8.13-doc.tar.bz2 3779824 BLAKE2B aab4d57df918061982614ea83b1b5de08d1b851e6a141957ae5c5f68f558994725eee6623479659729df92d6cb9058120179107058ab8974b36701420bfce48e SHA512 df95f26a24829f82f86896d20d47da2e9b5bcb7ecf9d24cb5ab0b956733e67d6bd2021bc4b52d6734ad1aacfd2e22a5a15a3acc5f14a401bb7f4f83f52251f1e +DIST openafs-1.8.13-src.tar.bz2 15053864 BLAKE2B 83c62197b7825e46f733a593e096494a234607b0fa17ee30717b42740e1ebb13f43e11986cf39e950e79f867ed3ab40d1c80ab7aa79a153ffd9d8f3b1cde307a SHA512 f2b60b3942ba21a4f0fd837dfda1a9659ebe4d2f96edfbe7162e97faa8c5887fbea8fdef958af396356b78793f06e6744566a1aa6b70df2164c9ab37c06e2cd9 DIST openafs-1.8.7-doc.tar.bz2 3808045 BLAKE2B 8ded75239dd59633297ee4208a0f3f018486b5b5b71fda91229583fd2d6a7743bbbeba280e61ff91d602617fc47944105b06a5c0610b0c89c808ecba38af7f9c SHA512 6d087320ab6681686b6afb78621b21eaec26b91dbd03a13df447ad9f0ce897332ac378b38bf1abc590575d82d8cb22757249e60a2407e4ad498d46c083632e0d DIST openafs-1.8.7-src.tar.bz2 15059909 BLAKE2B 89aacc48100d3eabbec45acca3911fbd823c029a30e79ad16564dcc3646b9bbadb60a528f142fc907de0d4eb2831d922d8146cdba72c02f4e8db9ab806c84d86 SHA512 12d5aa9177dde10e504f71b4b1ae19be0b0c52e8031e0f5afacce4a2c3f2321970af65591edab6145f7400f6276acd7e8624aa66e816d2394324e2ef5c403c01 DIST openafs-1.8.8.1-doc.tar.bz2 3770278 BLAKE2B 4d10c96f05190a71b8d7aa89557946d0b95774ca77f40d8e9ca81f5d5bacff1966e637f3bd066181f2dcf182dbfffdf93521981745fe4dbfea142e6b17fcf574 SHA512 c229636ca4c7245d37fa25b02805982e3f667163ae312e14678117c60320ccce50230bf09e081167e789a76bad8fa39a88638cb439ab87954c93b6108004efa8 diff --git a/net-fs/openafs/files/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch b/net-fs/openafs/files/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch new file mode 100644 index 000000000000..ed9a4872dd8e --- /dev/null +++ b/net-fs/openafs/files/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch @@ -0,0 +1,54 @@ +From 393604963bcfd51b8bc2282fb86c0274abcea89f Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Mon, 22 Feb 2021 11:08:39 -0700 +Subject: [PATCH 01/13] autoconf: use AC_CHECK_TOOL for as and ld + +Some platforms use the GNU target triplet as a prefix to the toolchain +utilities (e.g. x86_64-pc-linux-gnu-as) to allow the use of alternative +toolchains, cross-compiling, etc. + +The Gentoo Linux distribution has a mode of building packages +(-native-symlinks) where the toolchain utilities only exist as their +prefixed names (e.g. 'as' does not exist, but 'x86_64_pc-linux-gnu-as' +does). This results in configure failing to locate the tools when using +AC_CHECK_PROGS. (Gentoo uses the --host and --build configure +parameters to specify the prefix names for the tools). + +Replace AC_CHECK_PROGS with AC_CHECK_TOOL for the toolchain related +commands 'as' and 'ld'. + +AC_CHECK_TOOL works like AC_CHECK_PROGS but it will also look for +the program with a prefix (specified by using configure's --host +parameter). + +Note: libtool.m4 runs AC_CHECK_TOOL for ar. + +Change-Id: I8005c765d213b7d1d6292a7dd80f10a3d0e2ec68 +Reviewed-on: https://gerrit.openafs.org/14544 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 268025f841f1a2bd16b802459a8b590939331bcd) +--- + src/cf/osconf.m4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 +index 843998542e85..aee81cfdb274 100644 +--- a/src/cf/osconf.m4 ++++ b/src/cf/osconf.m4 +@@ -25,10 +25,10 @@ PAM_OPTMZ= + + dnl standard programs + AC_PROG_RANLIB +-AC_CHECK_PROGS(AS, as, [false]) ++AC_CHECK_TOOL(AS, as, [false]) + AC_CHECK_PROGS(MV, mv, [false]) + AC_CHECK_PROGS(RM, rm, [false]) +-AC_CHECK_PROGS(LD, ld, [false]) ++AC_CHECK_TOOL(LD, ld, [false]) + AC_CHECK_PROGS(CP, cp, [false]) + AC_CHECK_PROGS(GENCAT, gencat, [false]) + +-- +2.45.2 + diff --git a/net-fs/openafs/files/0002-pam-paths.patch b/net-fs/openafs/files/0002-pam-paths.patch new file mode 100644 index 000000000000..95265a125519 --- /dev/null +++ b/net-fs/openafs/files/0002-pam-paths.patch @@ -0,0 +1,46 @@ +From d5a01932f821ab8ef9e21ff0857c744326f9c494 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 01:32:37 +0300 +Subject: [PATCH 02/13] pam-paths + +(cherry picked from commit ccb2133f6fa61b51d9ad65086c83a9740506d19f) +(cherry picked from commit bd72ed729d5a17a4d135476f977b619615b64e0e) +(cherry picked from commit 56caeaf664505c2b59d8a0fb323dd582a109d35b) +--- + src/pam/Makefile.in | 2 +- + src/pam/afs_util.h | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/pam/Makefile.in b/src/pam/Makefile.in +index f4f066618f79..c335e81ec657 100644 +--- a/src/pam/Makefile.in ++++ b/src/pam/Makefile.in +@@ -31,7 +31,7 @@ LT_libs = \ + + INSTALL_KAUTH = @INSTALL_KAUTH@ + +-MODULE_CFLAGS=${PAM_CFLAGS} ++MODULE_CFLAGS=${PAM_CFLAGS} -DBINDIR='"${bindir}"' + + all: test_pam pam_afs.la pam_afs.krb.la + +diff --git a/src/pam/afs_util.h b/src/pam/afs_util.h +index 56a42457be7c..ac2b01ca5126 100644 +--- a/src/pam/afs_util.h ++++ b/src/pam/afs_util.h +@@ -24,9 +24,9 @@ extern int do_klog(const char *user, const char *password, + const char *lifetime, const char *cell_name); + extern afs_int32 getPAG(void); + +-#define KLOG "/usr/afsws/bin/klog" +-#define KLOGKRB "/usr/afsws/bin/klog.krb" +-#define UNLOG "/usr/afsws/bin/unlog" ++#define KLOG BINDIR "/klog" ++#define KLOGKRB BINDIR "/klog.krb" ++#define UNLOG BINDIR "/unlog" + #define IGNORE_MAX 1000 + + #if defined(AFS_HPUX_ENV) +-- +2.45.2 + diff --git a/net-fs/openafs/files/0003-fbsd.patch b/net-fs/openafs/files/0003-fbsd.patch new file mode 100644 index 000000000000..5d6363bca737 --- /dev/null +++ b/net-fs/openafs/files/0003-fbsd.patch @@ -0,0 +1,28 @@ +From 5191eb2c1d896a9d87a031cb78235d1586f17d8f Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 10:15:37 +0300 +Subject: [PATCH 03/13] fbsd + +(cherry picked from commit 53a84d83b375483439d79e9d7dc150401f2477a8) +(cherry picked from commit 6d3c928ae95773f8cfbb801c7b000fa1f03d72c2) +(cherry picked from commit ea2741bd13e0b0ebdb3687e831ed242a7ea67457) +--- + src/comerr/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/comerr/Makefile.in b/src/comerr/Makefile.in +index a867e1ae15b7..556adb3e7133 100644 +--- a/src/comerr/Makefile.in ++++ b/src/comerr/Makefile.in +@@ -40,7 +40,7 @@ compile_et: compile_et.o error_table.o + *_linux* | *_umlinux* | *_darwin* | rs_aix72 | rs_aix73 ) \ + $(LT_LDRULE_static_NOQ) compile_et.o error_table.o -L${TOP_LIBDIR} -lopr $(buildtool_roken) $(MT_LIBS);; \ + * ) \ +- $(LT_LDRULE_static_NOQ) compile_et.o error_table.o -L${TOP_LIBDIR} -lopr -ll $(buildtool_roken) $(MT_LIBS);; \ ++ $(LT_LDRULE_static_NOQ) compile_et.o error_table.o -L${TOP_LIBDIR} -lopr -lfl $(buildtool_roken) $(MT_LIBS);; \ + esac + + libafscom_err.a: $(LT_objs) +-- +2.45.2 + diff --git a/net-fs/openafs/files/0004-sparc.patch b/net-fs/openafs/files/0004-sparc.patch new file mode 100644 index 000000000000..9a101679321f --- /dev/null +++ b/net-fs/openafs/files/0004-sparc.patch @@ -0,0 +1,59 @@ +From bab62364812662c0f0f66436eec3a4c7b6f9d586 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 10:16:25 +0300 +Subject: [PATCH 04/13] sparc + +(cherry picked from commit 96739d61d6c8be1feabad0227ede3baa19519aaa) +(cherry picked from commit 002c44ca274baddb358bdb73870cbd20b304264d) +(cherry picked from commit 01a13e7b282ab6d58fdfa3d1a90c60fac925b7c6) +--- + src/afs/LINUX/osi_probe.c | 6 ++++++ + src/cf/linux-test4.m4 | 6 +++--- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/src/afs/LINUX/osi_probe.c b/src/afs/LINUX/osi_probe.c +index be42ecf85ee3..59e6ab46b1ec 100644 +--- a/src/afs/LINUX/osi_probe.c ++++ b/src/afs/LINUX/osi_probe.c +@@ -231,7 +231,9 @@ extern int kallsyms_address_to_symbol(unsigned long address, + ) __attribute__((weak)); + #endif + ++#ifdef LINUX_EXPORTS_SYS_CALL_TABLE + extern SYSCALLTYPE sys_call_table[] __attribute__((weak)); ++#endif + extern SYSCALLTYPE ia32_sys_call_table[] __attribute__((weak)); + extern SYSCALLTYPE sys_call_table32[] __attribute__((weak)); + extern SYSCALLTYPE sys_call_table_emu[] __attribute__((weak)); +@@ -496,7 +498,11 @@ static probectl main_probe = { + 0, + #endif + ++#ifdef LINUX_EXPORTS_SYS_CALL_TABLE + sys_call_table, /* weak symbol ref */ ++#else ++ 0, ++#endif + 0, 0, /* module parameter answers */ + #ifdef AFS_LINUX_sys_call_table + AFS_LINUX_sys_call_table, /* compiled-in answer, if any */ +diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 +index b22930690e4d..08552def3fc9 100644 +--- a/src/cf/linux-test4.m4 ++++ b/src/cf/linux-test4.m4 +@@ -67,9 +67,9 @@ AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [ + AC_CHECK_LINUX_BUILD([for exported sys_call_table], + [ac_cv_linux_exports_sys_call_table], + [#include <linux/modversions.h>], +-[#ifndef __ver_sys_call_table +-#error sys_call_table not exported +-#endif], ++[ ++extern SYSCALLTYPE sys_call_table[] __attribute__((weak)); ++], + [EXPORTED_SYS_CALL_TABLE], + [define if your linux kernel exports sys_call_table], + []) +-- +2.45.2 + diff --git a/net-fs/openafs/files/0005-uname.patch b/net-fs/openafs/files/0005-uname.patch new file mode 100644 index 000000000000..4fdc83249490 --- /dev/null +++ b/net-fs/openafs/files/0005-uname.patch @@ -0,0 +1,37 @@ +From 5379cb53e1486674bd6f51c5771143a5806f770b Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 10:25:47 +0300 +Subject: [PATCH 05/13] uname + +(cherry picked from commit 020c6c42bf001b53f054cafbde739a71d4f07508) +(cherry picked from commit 99d126271f3302e84252a980639f9e6f39ef8208) +(cherry picked from commit 14bed4c153e5cbc551587a6de76a453be2e6d9d1) +--- + src/cf/sysname.m4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/cf/sysname.m4 b/src/cf/sysname.m4 +index aa4ad2cb4287..2991097d0337 100644 +--- a/src/cf/sysname.m4 ++++ b/src/cf/sysname.m4 +@@ -270,7 +270,7 @@ else + AFS_SYSNAME="ia64_linuxXX" + ;; + powerpc-*-linux*) +- AFS_SYSNAME="`/bin/arch`_linuxXX" ++ AFS_SYSNAME="`uname -m`_linuxXX" + ;; + powerpc64-*-linux*) + AFS_SYSNAME="ppc64_linuxXX" +@@ -288,7 +288,7 @@ else + AFS_SYSNAME="s390x_linuxXX" + ;; + sparc-*-linux*) +- AFS_SYSNAME="`/bin/arch`_linuxXX" ++ AFS_SYSNAME="`uname -m`_linuxXX" + ;; + sparc64-*-linux*) + AFS_SYSNAME="sparc64_linuxXX" +-- +2.45.2 + diff --git a/net-fs/openafs/files/0006-resolv.patch b/net-fs/openafs/files/0006-resolv.patch new file mode 100644 index 000000000000..4d77d81a9b1a --- /dev/null +++ b/net-fs/openafs/files/0006-resolv.patch @@ -0,0 +1,32 @@ +From 77fcdf422542d01610c36d1167cc59410bcc5e3a Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 10:27:13 +0300 +Subject: [PATCH 06/13] resolv + +(cherry picked from commit 911939ee76440e2f23e5867cbf3f5991167e4ec8) +(cherry picked from commit 577dc93125df68e3853cf934e412a6daf9e636f3) +(cherry picked from commit 0bd7623ef05bbaa7dd30405007250d1e2dc86c1b) +--- + src/cf/osconf.m4 | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 +index aee81cfdb274..bd2ac89b728c 100644 +--- a/src/cf/osconf.m4 ++++ b/src/cf/osconf.m4 +@@ -582,6 +582,12 @@ if test "x$enable_optimize_kernel" = "x" ; then + [enable_optimize_kernel=yes]) + fi + ++case $AFS_SYSNAME in ++ *linux*) ++ MT_LIBS="${MT_LIBS} -lresolv" ++ ;; ++esac ++ + # + # Special build targets + # +-- +2.45.2 + diff --git a/net-fs/openafs/files/0007-afsauthent-symbols.patch b/net-fs/openafs/files/0007-afsauthent-symbols.patch new file mode 100644 index 000000000000..fcdabd155aff --- /dev/null +++ b/net-fs/openafs/files/0007-afsauthent-symbols.patch @@ -0,0 +1,27 @@ +From 6fd3ca877e3095a93e9c25381e53a792ceb24160 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 11:12:56 +0300 +Subject: [PATCH 07/13] afsauthent-symbols + +(cherry picked from commit a443fcbbe03ff0d6c9b790cfd9283cd0952d3a0b) +(cherry picked from commit bebe3f25a63dd7365e10c1bbc588168fd448a4d8) +(cherry picked from commit c5de3eed6bea7ba33cd612e7dd2246509ab4dd6e) +--- + src/util/liboafs_util.la.sym | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/util/liboafs_util.la.sym b/src/util/liboafs_util.la.sym +index 04842e6ebf76..0f83ff5faaac 100644 +--- a/src/util/liboafs_util.la.sym ++++ b/src/util/liboafs_util.la.sym +@@ -13,6 +13,7 @@ Int32To_ktimeRelDate + LogCommandLine + LogLevel + LogThreadNum ++ka_GetAFSTicket + OpenLog + ReOpenLog + SetLogThreadNumProgram +-- +2.45.2 + diff --git a/net-fs/openafs/files/0008-flags.patch b/net-fs/openafs/files/0008-flags.patch new file mode 100644 index 000000000000..c0778d9441d1 --- /dev/null +++ b/net-fs/openafs/files/0008-flags.patch @@ -0,0 +1,33 @@ +From 4c317307b7985ec48e0fe6fb8a5764ef0e2041ae Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Fri, 4 Jan 2019 07:02:07 +0300 +Subject: [PATCH 08/13] flags + +(cherry picked from commit c46c9e03ba1464eecae7c974461c982ee00f5000) +(cherry picked from commit 08b0d7d40710ac49cd8f4904b0985c9e5cdd88c5) +(cherry picked from commit f00970cc1339971101d753c2a8fa3f414782a695) +--- + src/config/Makefile.config.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in +index d4b9063dac54..8039bec1dc04 100644 +--- a/src/config/Makefile.config.in ++++ b/src/config/Makefile.config.in +@@ -219,11 +219,11 @@ COMPILE_ET_C=${COMPILE_ET} -emit c + COMMON_INCL=$(MODULE_INCLUDE) -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} \ + -I${srcdir} -I. + +-COMMON_CFLAGS=$(CFLAGS) ${DBG} ${OPTMZ} $(XCFLAGS) \ ++COMMON_CFLAGS=$(CFLAGS) $(XCFLAGS) \ + ${COMMON_INCL} ${INCLUDE_LIBINTL} \ + $(CPPFLAGS_roken) $(ARCHFLAGS) + +-COMMON_LDFLAGS=$(LDFLAGS) $(LDFLAGS_hcrypto) $(LDFLAGS_roken) $(DBG) $(OPTMZ) ++COMMON_LDFLAGS=$(LDFLAGS) $(LDFLAGS_hcrypto) $(LDFLAGS_roken) + + # LWP Flags + LWP_CFLAGS=$(MODULE_CFLAGS) $(COMMON_CFLAGS) +-- +2.45.2 + diff --git a/net-fs/openafs/files/0009-docbook2pdf.patch b/net-fs/openafs/files/0009-docbook2pdf.patch new file mode 100644 index 000000000000..384ba828e46c --- /dev/null +++ b/net-fs/openafs/files/0009-docbook2pdf.patch @@ -0,0 +1,127 @@ +From 4501337bab87ec8724ae45fa50713584a211fb3a Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Fri, 4 Jan 2019 16:37:35 +0300 +Subject: [PATCH 09/13] docbook2pdf + +Jadetex based converters require jadetex tuning: + save_size=50000 + max_strings=1000000 + pool_size=2000000 + hash_extra=150000 +Otherwise TeX will run out of its capacity during large PDFs +generation. + +docbook2pdf needs to ignore an ID reference value which no element +has as its ID: + -e no-idref +This is already done by other converters implicitly. + +(cherry picked from commit c81ef9c4109eb1bfc9cb42d952b9d5240f3d713b) +(cherry picked from commit c4515998db6078ccf82fad23b774bc243ba1f020) +(cherry picked from commit 876c27c8fb7cc3c80e31d3e642a7727313b4f0c0) +--- + doc/xml/AdminGuide/Makefile.in | 5 ++++- + doc/xml/AdminRef/Makefile.in | 5 ++++- + doc/xml/QuickStartUnix/Makefile.in | 5 ++++- + doc/xml/UserGuide/Makefile.in | 5 ++++- + 4 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/doc/xml/AdminGuide/Makefile.in b/doc/xml/AdminGuide/Makefile.in +index caf48ac66828..6763e95c8849 100644 +--- a/doc/xml/AdminGuide/Makefile.in ++++ b/doc/xml/AdminGuide/Makefile.in +@@ -32,6 +32,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + KINDLEGEN = @KINDLEGEN@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + index.html: $(SRCS) + $(XSLTPROC) --param navig.graphics 1 \ +@@ -42,8 +43,10 @@ $(BOOK).pdf: $(SRCS) + if test "x$(DOCBOOK2PDF)" = "xfop"; then \ + $(XSLTPROC) $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl $(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) $(BOOK).xml; \ ++ $(TEXOPTS) $(DOCBOOK2PDF) $(BOOK).xml; \ + fi + + $(BOOK).epub: $(SRCS) +diff --git a/doc/xml/AdminRef/Makefile.in b/doc/xml/AdminRef/Makefile.in +index a9d78d6a5515..c13c26965d73 100644 +--- a/doc/xml/AdminRef/Makefile.in ++++ b/doc/xml/AdminRef/Makefile.in +@@ -15,6 +15,7 @@ XSLTPROC = @XSLTPROC@ --stringparam variablelist.as.blocks 1 --param use.id.as.f + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + entities.dtd sect1.xml sect5.xml sect8.xml: + ./generate-xml.pl $(TOP_SRCDIR) +@@ -23,8 +24,10 @@ $(BOOK).pdf: $(SRCS) + if test "x$(DOCBOOK2PDF)" = "xfop"; then \ + $(XSLTPROC) $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl $(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) $(BOOK).xml; \ ++ $(TEXOPTS) $(DOCBOOK2PDF) $(BOOK).xml; \ + fi + + $(BOOK).epub: $(SRCS) +diff --git a/doc/xml/QuickStartUnix/Makefile.in b/doc/xml/QuickStartUnix/Makefile.in +index b309015ce283..c52a171babea 100644 +--- a/doc/xml/QuickStartUnix/Makefile.in ++++ b/doc/xml/QuickStartUnix/Makefile.in +@@ -30,6 +30,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + index.html: $(SRCS) + $(XSLTPROC) --param navig.graphics 1 \ +@@ -40,8 +41,10 @@ $(BOOK).pdf: $(SRCS) + if test "x$(DOCBOOK2PDF)" = "xfop"; then \ + $(XSLTPROC) $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl $(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) $(BOOK).xml; \ ++ $(TEXOPTS) $(DOCBOOK2PDF) $(BOOK).xml; \ + fi + + $(BOOK).epub: $(SRCS) +diff --git a/doc/xml/UserGuide/Makefile.in b/doc/xml/UserGuide/Makefile.in +index 1a0fe66d6255..5dfc7d44e253 100644 +--- a/doc/xml/UserGuide/Makefile.in ++++ b/doc/xml/UserGuide/Makefile.in +@@ -30,6 +30,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + index.html: $(SRCS) + $(XSLTPROC) --param navig.graphics 1 \ +@@ -40,8 +41,10 @@ $(BOOK).pdf: $(SRCS) + if test "x$(DOCBOOK2PDF)" = "xfop"; then \ + $(XSLTPROC) $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl $(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) $(BOOK).xml; \ ++ $(TEXOPTS) $(DOCBOOK2PDF) $(BOOK).xml; \ + fi + + $(BOOK).epub: $(SRCS) +-- +2.45.2 + diff --git a/net-fs/openafs/files/0010-libperl.patch b/net-fs/openafs/files/0010-libperl.patch new file mode 100644 index 000000000000..b73ccf19e400 --- /dev/null +++ b/net-fs/openafs/files/0010-libperl.patch @@ -0,0 +1,31 @@ +From b9bd06a715cf2a68c73d6bdf57d475ae5d1d61d5 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Sat, 5 Jan 2019 10:15:03 +0300 +Subject: [PATCH 10/13] libperl + +Filter out -lnsl reported by perl. +libnsl it is neither needed nor provided. + +(cherry picked from commit 243186f42cc84af2ff90f6710c6e76b1a4121064) +(cherry picked from commit 99183cb191e653288ed8ed656ecd9f484a1715e3) +(cherry picked from commit e27f7a255c4f064c149d57ed965523ef9932f436) +--- + src/libuafs/Makefile.common.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libuafs/Makefile.common.in b/src/libuafs/Makefile.common.in +index 941605027176..eca360777151 100644 +--- a/src/libuafs/Makefile.common.in ++++ b/src/libuafs/Makefile.common.in +@@ -142,7 +142,7 @@ RX =../rx + AFSINT=../afsint + LIB =../lib + SWIG_PERL_CFLAGS = -fPIC `perl -MExtUtils::Embed -e ccopts` +-SWIG_PERL_LDFLAGS = -fPIC `perl -MExtUtils::Embed -e ldopts` ++SWIG_PERL_LDFLAGS = -fPIC `perl -MExtUtils::Embed -e ldopts | sed "s/-lnsl //g"` + SWIG = @SWIG@ + LIBUAFS_BUILD_PERL = @LIBUAFS_BUILD_PERL@ + +-- +2.45.2 + diff --git a/net-fs/openafs/files/0011-xbsa.patch b/net-fs/openafs/files/0011-xbsa.patch new file mode 100644 index 000000000000..cba3e37a39e6 --- /dev/null +++ b/net-fs/openafs/files/0011-xbsa.patch @@ -0,0 +1,31 @@ +From 523c217f8f1002814a54b2818ebb4490c3d2aa01 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gentoo.org> +Date: Sun, 13 Sep 2020 10:15:51 +0300 +Subject: [PATCH 11/13] xbsa + +When xbsa (tsm) support is enabled, butxInfo is defined in the +butc_xbsa.h, so it should not be redefined here, otherwise multiple +definitions of the butxInfo symbol error will occur. + +(cherry picked from commit 032844997f8c57168b91550c929ac1dd6544bafa) +(cherry picked from commit 84c3422235048eea573f103adb9e2e22b7be2ca1) +--- + src/butc/lwps.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/butc/lwps.c b/src/butc/lwps.c +index 3078d738238f..9769862bf0aa 100644 +--- a/src/butc/lwps.c ++++ b/src/butc/lwps.c +@@ -53,7 +53,7 @@ extern int forcemultiple; + /* XBSA Global Parameters */ + extern afs_int32 xbsaType; + #ifdef xbsa +-struct butx_transactionInfo butxInfo; ++extern struct butx_transactionInfo butxInfo; + #endif + + static struct TapeBlock { /* A 16KB tapeblock */ +-- +2.45.2 + diff --git a/net-fs/openafs/files/0012-xml-dtd.patch b/net-fs/openafs/files/0012-xml-dtd.patch new file mode 100644 index 000000000000..5e4ed0ba0088 --- /dev/null +++ b/net-fs/openafs/files/0012-xml-dtd.patch @@ -0,0 +1,67 @@ +From 689b5b3b684210356f5764dbb28145aa5a4b70f9 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gentoo.org> +Date: Sun, 12 Dec 2021 01:04:10 +0300 +Subject: [PATCH 12/13] xml-dtd + +Fix xml docs to use local dtd files. +Network should not be accessed during build. + +(cherry picked from commit 1cb479e32a055bd8786a8d0487a04ebdd104222b) +--- + doc/xml/AdminGuide/auagd000.xml | 2 +- + doc/xml/AdminRef/auarf000.xml | 2 +- + doc/xml/QuickStartUnix/auqbg000.xml | 2 +- + doc/xml/UserGuide/auusg000.xml | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/doc/xml/AdminGuide/auagd000.xml b/doc/xml/AdminGuide/auagd000.xml +index 6d5690dbea85..ebe52c452b58 100644 +--- a/doc/xml/AdminGuide/auagd000.xml ++++ b/doc/xml/AdminGuide/auagd000.xml +@@ -1,6 +1,6 @@ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.3//EN" +- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ++ "/usr/share/sgml/docbook/xml-dtd-4.3/docbookx.dtd" [ + <!ENTITY version SYSTEM "version.xml"> + <!ENTITY preface SYSTEM "auagd005.xml"> + <!ENTITY chapter1 SYSTEM "auagd006.xml"> +diff --git a/doc/xml/AdminRef/auarf000.xml b/doc/xml/AdminRef/auarf000.xml +index 6cbe7dce9f97..c52f6b10a70f 100644 +--- a/doc/xml/AdminRef/auarf000.xml ++++ b/doc/xml/AdminRef/auarf000.xml +@@ -1,6 +1,6 @@ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.3//EN" +- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ++ "/usr/share/sgml/docbook/xml-dtd-4.3/docbookx.dtd" [ + <!ENTITY version SYSTEM "version.xml"> + <!ENTITY preface SYSTEM "preface.xml"> + <!ENTITY sect1 SYSTEM "sect1.xml"> +diff --git a/doc/xml/QuickStartUnix/auqbg000.xml b/doc/xml/QuickStartUnix/auqbg000.xml +index 7c225bac2855..86fa6f91640a 100644 +--- a/doc/xml/QuickStartUnix/auqbg000.xml ++++ b/doc/xml/QuickStartUnix/auqbg000.xml +@@ -1,6 +1,6 @@ + <?xml version="1.0" encoding="utf-8"?> + <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.3//EN" +- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ++ "/usr/share/sgml/docbook/xml-dtd-4.3/docbookx.dtd" [ + <!ENTITY version SYSTEM "version.xml"> + <!ENTITY preface SYSTEM "auqbg003.xml"> + <!ENTITY chapter1 SYSTEM "auqbg004.xml"> +diff --git a/doc/xml/UserGuide/auusg000.xml b/doc/xml/UserGuide/auusg000.xml +index ffb965045bec..cf0e8e9c7455 100644 +--- a/doc/xml/UserGuide/auusg000.xml ++++ b/doc/xml/UserGuide/auusg000.xml +@@ -1,6 +1,6 @@ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.3//EN" +- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ++ "/usr/share/sgml/docbook/xml-dtd-4.3/docbookx.dtd" [ + <!ENTITY version SYSTEM "version.xml"> + <!ENTITY preface SYSTEM "auusg003.xml"> + <!ENTITY chapter1 SYSTEM "auusg004.xml"> +-- +2.45.2 + diff --git a/net-fs/openafs/files/0013-kernel-cc-ld.patch b/net-fs/openafs/files/0013-kernel-cc-ld.patch new file mode 100644 index 000000000000..fd55f63e7714 --- /dev/null +++ b/net-fs/openafs/files/0013-kernel-cc-ld.patch @@ -0,0 +1,47 @@ +From d6035d97bdf4c87a19cda7553d8a4713b04b47c3 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gentoo.org> +Date: Sun, 12 Dec 2021 01:06:18 +0300 +Subject: [PATCH 13/13] kernel-cc-ld + +Pass custom $CC and $LD to kernel during both configure check and build. +Otherwise hosts without `gcc` and `ld` wrappers will fail configure. + +See Gentoo bug 828951. + +(cherry picked from commit d4676024fe7b2dfac413e6509caccd13f94ac28d) +--- + src/cf/linux-test1.m4 | 4 ++-- + src/libafs/MakefileProto.LINUX.in | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4 +index 010a4464f25a..0d0eb4c798fc 100644 +--- a/src/cf/linux-test1.m4 ++++ b/src/cf/linux-test1.m4 +@@ -24,8 +24,8 @@ $2 + + MODULE_LICENSE("http://www.openafs.org/dl/license10.html"); + _ACEOF +- echo make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir $SPARSE_MAKEFLAGS modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD && +- make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir $SPARSE_MAKEFLAGS modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD 2>conftest.err && ++ echo make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir $SPARSE_MAKEFLAGS modules KBUILD_VERBOSE=1 CC="${CC}" LD="${LD}" >&AS_MESSAGE_LOG_FD && ++ make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir modules $SPARSE_MAKEFLAGS KBUILD_VERBOSE=1 CC="${CC}" LD="${LD}" >&AS_MESSAGE_LOG_FD 2>conftest.err && + ! grep -i "WARNING: .* undefined!$" conftest.err >/dev/null 2>&1 + then [$3] + else +diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in +index 6e62c8c97fe1..3d188127afbe 100644 +--- a/src/libafs/MakefileProto.LINUX.in ++++ b/src/libafs/MakefileProto.LINUX.in +@@ -324,7 +324,7 @@ ${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: ${LINUX_LIBAFS_NAME}.ko + ${LINUX_LIBAFS_NAME}.ko afspag.ko: .FORCE + env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common + ( env EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ +- $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} $(SPARSE_MAKEFLAGS) modules 2>&1 \ ++ $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} $(SPARSE_MAKEFLAGS) CC="${CC}" LD="${LD}" modules 2>&1 \ + || echo "FAILURE: make exit code $$?" ) | tee .makelog + @if grep -E -q '^(FAILURE|WARNING)' .makelog; then \ + grep -q '^WARNING' .makelog && echo "Error: Undefined symbols in modules" ; \ +-- +2.45.2 + diff --git a/net-fs/openafs/files/README.Gentoo b/net-fs/openafs/files/README.Gentoo new file mode 100644 index 000000000000..50d27123ca39 --- /dev/null +++ b/net-fs/openafs/files/README.Gentoo @@ -0,0 +1,297 @@ +README openafs for gentoo linux +------------------------------- + +Changelog: + +13.11.2005 point to online documentation where relevant +25.07.2005 update after ebuild overhaul +04.06.2001 initial release + +INDEX +A) Questions Likely to be Asked +1) Overview +2) Client installation +3) Server installation +3.1) Installing your afs server +3.2) Configuring the Top Level of the AFS filespace + +A. Questions Likely to be Asked +------------------------------- + +Q) How do I upgrade from a pre-1.4 version? +A) Consult http://www.gentoo.org/doc/en/openafs.xml. You will find + detailed instructions on how to safely upgrade. If you're very very + impatient, please take note that the init-scripts have changed names + and that you shouldn't use the old script after upgrading. Now go and play! + +Q) Why are the paths in the OpenAFS documentation different from the ones in + the gentoo package? +A) When AFS was conceived, Transarc (at the time the developing company) chose + new seperate paths for everything related to AFS. Though there are + advantages to this approach (like more easily copying an AFS-installation + from one machine to another), this is contrary to FHS, the standard for + filesystem layout as used in Gentoo and many other UNIX-systems. + +Q) Software package X requires the old path convention +A) If the software in mind is OSS and has an ebuild in portage, please let us + know so we can patch the software to work with a gentoo installation. If + you use third-party software that has the legacy paths hardcoded, we + recommend you take a look at the package "openafs-legacy". It is meant to + provide soft-links to an existing openafs-installation, such that those + packages find the information they're looking for. At the time of writing, + this packages is untested. Please let us know how well / badly it works + for you! + (After installing the FHS compliant ebuild, you first need to remove the + configuration files in the old paths, so there is room for the soft-links. + See below on how to go about this) + +Q) The ebuild has done the automatic transfer from old path-config files to + the new standard. But now my system won't start anymore. What do I do? +A) The ebuild was designed to not touch files that existed before, and also + leave the old configuration files there for a safe fallback. One cause + for failure that comes to mind is a system that contained some configuration + files in new paths before the transfer. In any case, we'd appreciate you + filing a bug report (http://bugs.gentoo.org). I hope you've read the + guide on how to upgrade, btw? It may very well give you better understanding + of what's happened. See http://www.gentoo.org/doc/en/openafs.xml. + +Q) My openafs client has gone into a state where I can't stop nor start the + service. What can I do, apart from rebooting? +A) Though I hope I've adapted the init-scripts to cope with most circumstances, + a failure to stop the client may arise for some reason. Here's a guideline + to stop the openafs client so you can cleanly restart. + 1) Check for kernel errors (caused by the client if you're running the + experimental version). To do this, use "dmesg". If you see errors + (like stack traces), it's recommended that you reboot after all (this is + known to happen when unload the kernel module when afsd is still running) + 2) Check if the /afs filesystem is mounted (e.g. "grep AFS /proc/mounts"). + If so, unmount it ("umount /afs"). Afterwards you'll need step 3: + 3) Check if afsd is running (e.g. "pgrep afsd"). If so, shut it down by + issuing "afsd -shutdown" + 4) Check if the kernel module is loaded ("lsmod | grep openafs"). If so, + unload it with "modprobe -r openafs" + 5) Just to be safe, you may want to recheck step 1 + + 6) Check if the bosserver is running ("pgrep bosserver"). If not, then + normally no part of the AFS server is running. If you doubt this + for whatever reason (like strange bosserver behaviour), you can check + if individual services are running and the stop those using the "kill" + command. Processes you're looking for are named like volserver, + fileserver, upserver, vlserver, ptserver, buserver, kaserver. + If it isn't running, and you're not feeling suspicious, go to step 9 + 7) Check the status of the bosserver by running + "bos status localhost -localauth". If it reports running services, + shutdown by running "bos shutdown localhost -localauth -wait". + 8) Shut down the bosserver ("killall bosserver" is the fastest know method) + + 9) Finally, every part of afs should be shutdown. Let the initscript- + system know by running "/etc/init.d/afs-client zap". + + Now you should be able to run "/etc/init.d/afs-client start" again + Please also report a bug stating the circumstances under which your + lockup situation occurred (including useful info like that produced by + "dmesg" + + +1. Overview +----------- + +- There's an openafs faq available on + http://www.angelfire.com/hi/plutonic/afs-faq.html +- Openafs main page is at http://www.openafs.org +- AFS was originally developed by Transarc which is now owned by IBM. + You can find some information about AFS on + http://www-306.ibm.com/software/stormgmt/afs/ + +2. Client installation +---------------------- + +NOTE: You need to have access to a running afs-server in your network. +First edit ThisCell and CellServDB according to your local network structure. +If you're unsure what to put there, either read the afs documentation or contact +your local administrators. Just run "emerge openafs" on your gentoo linux +machine to build the client. After building add the afs start script with +rc-update add afs. Now you're ready to go !! + +3. Server installation +---------------------- + +NOTE: This is a quick quick beginnings manual !!! If you really want to use afs +download and print out the afs documentation !!! + +3.1 Installing your afs server + + 1. Startup main afs server process + /usr/bin/bosserver -noauth & + Verify that /etc/openafs/server/ThisCell and CellServDB got created + + 2. Give your cell a name !! + /usr/bin/bos setcellname <server name> <cell name> -noauth + e.g.: /usr/bin/bos setcellname darks.net-labs.local gentoo -noauth + Verify that ThisCell and CellServDB got updated !!! + + 3. Startup authentification, backup, protection and volume loction servers + + /usr/bin/bos create <server name> kaserver simple /usr/libexec/openafs/kaserver -cell <cell name> -noauth + e.g: /usr/bin/bos create darks.net-labs.local kaserver simple /usr/libexec/openafs/kaserver -cell gentoo -noauth + + /usr/bin/bos create <server name> buserver simple /usr/libexec/openafs/buserver -cell <cell name> -noauth + e.g: /usr/bin/bos create darks.net-labs.local buserver simple /usr/libexec/openafs/buserver -cell gentoo -noauth + + /usr/bin/bos create <server name> ptserver simple /usr/libexec/openafs/ptserver -cell <cell name> -noauth + e.g: /usr/bin/bos create darks.net-labs.local ptserver simple /usr/libexec/openafs/ptserver -cell gentoo -noauth + + /usr/bin/bos create <server name> vlserver simple /usr/libexec/openafs/vlserver -cell <cell name> -noauth + e.g: /usr/bin/bos create darks.net-labs.local vlserver simple /usr/libexec/openafs/vlserver -cell gentoo -noauth + + Verify that all servers are running: + /usr/bin/bos status <server name> -noauth + e.g.: /usr/bin/bos status darks.net-labs.local -noauth + + 4. Initialize Cell Security + .. which basically means creating afs admin account. + + /usr/bin/kas -cell <cell name> -noauth + This should give you the ka> prompt. + + ka> create afs + initial_password: + Verifying, please re-enter initial_password: + ka> create admin + initial_password: + Verifying, please re-enter initial_password: + ka> + + Verfiy that users got created and set admin flag for user admin: + + ka> examine afs + + User data for afs + key (0) cksum is 2651715259, last cpw: Mon Jun 4 20:49:30 2001 + password will never expire. + An unlimited number of unsuccessful authentications is permitted. + entry never expires. Max ticket lifetime 100.00 hours. + last mod on Mon Jun 4 20:49:30 2001 by <none> + permit password reuse + ka> setfields admin -flags admin + ka> examine admin + + User data for admin (ADMIN) + key (0) cksum is 2651715259, last cpw: Mon Jun 4 20:49:59 2001 + password will never expire. + An unlimited number of unsuccessful authentications is permitted. + entry never expires. Max ticket lifetime 25.00 hours. + last mod on Mon Jun 4 20:51:10 2001 by <none> + permit password reuse + ka> + + Create users in the afs enviroment: + + /usr/bin/bos adduser <server name> admin -cell <cell name> -noauth + e.g.: /usr/bin/bos adduser darks.net-labs.local admin -cell gentoo -noauth + + /usr/bin/bos addkey <server name> -kvno 0 -cell <cell name> -noauth + e.g.: /usr/bin/bos addkey darks.net-labs.local -kvno 0 -cell gentoo -noauth + input key: + Retype input key: + NOTE: you need to give the password you provided for the afs account above + + Create a protection database entry for the admin user: + + /usr/bin/pts createuser -name admin -cell <cell name> [-id <AFS UID>] -noauth + MATCH UNIX ID'S AND AFS UID'S WITH THE -id FLAG !! + e.g.: /usr/bin/pts createuser -name admin -cell gentoo -noauth + User admin has id 1 + + /usr/bin/pts adduser admin system:administrators -cell <cell name> -noauth + e.g.: /usr/bin/pts adduser admin system:administrators -cell gentoo -noauth + + Check admin privileges: + + /usr/bin/pts membership admin -cell gentoo -noauth + Groups admin (id: 1) is a member of: + system:administrators + + Restart afs processes: + + /usr/bin/bos restart <server name> -all -cell <cell name> -noauth + e.g.: /usr/bin/bos restart darks.net-labs.local -all -cell gentoo -noauth + + 5. Start the file and volume servers and the salvager + + /usr/bin/bos create <server name> fs fs /usr/libexec/openafs/fileserver /usr/libexec/openafs/volserver /usr/libexec/openafs/salvager -cell <cell name> -noauth + e.g.: /usr/bin/bos create darks.net-labs.local fs fs /usr/libexec/openafs/fileserver /usr/libexec/openafs/volserver /usr/libexec/openafs/salvager -cell gentoo -noauth + + Verify that all processe are running: + + /usr/bin/bos status darks.net-labs.local -long -noauth + Instance kaserver, (type is simple) currently running normally. + Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts) + Last exit at Mon Jun 4 21:07:17 2001 + Command 1 is '/usr/libexec/openafs/kaserver' + + Instance buserver, (type is simple) currently running normally. + Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts) + Last exit at Mon Jun 4 21:07:17 2001 + Command 1 is '/usr/libexec/openafs/buserver' + + Instance ptserver, (type is simple) currently running normally. + Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts) + Last exit at Mon Jun 4 21:07:17 2001 + Command 1 is '/usr/libexec/openafs/ptserver' + + Instance vlserver, (type is simple) currently running normally. + Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts) + Last exit at Mon Jun 4 21:07:17 2001 + Command 1 is '/usr/libexec/openafs/vlserver' + + Instance fs, (type is fs) currently running normally. + Auxiliary status is: file server running. + Process last started at Mon Jun 4 21:09:30 2001 (2 proc starts) + Command 1 is '/usr/libexec/openafs/fileserver' + Command 2 is '/usr/libexec/openafs/volserver' + Command 3 is '/usr/libexec/openafs/salvager' + + 6. Create the main volume or synchronize with existing servers + + a) This is the first server: + + /usr/bin/vos create <server name> <partition name> root.afs -cell <cell name> -noauth + e.g.: /usr/bin/vos create darks.net-labs.local /vicepa root.afs -cell gentoo -noauth + + b) You're installing a backup server: + + /usr/bin/vos syncvldb <server name> -cell <cell name> -verbose -noauth + /usr/bin/vos syncserv <server name> -cell <cell name> -verbose -noauth + + 7. Start the Update Server + + /usr/bin/bos create <server name> upserver simple "/usr/libexec/openafs/upserver -crypt /etc/openafs -clear /usr/bin" -cell <cell name> -noauth + e.g.: /usr/bin/bos create darks.net-labs.local upserver simple "/usr/libexec/openafs/upserver -crypt /etc/openafs -clear /usr/bin" -cell gentoo -noauth + + 8. Modifiy /etc/openafs/afs.conf + + Edit afs.conf to start afs server + + That's it !! Your afs server should hopefully be up and running !!! + +3.2 Configuring the Top Level of the AFS filespace + + 1. Let anyuser lookup /afs + /usr/bin/fs setacl /afs system:anyuser rl + + 2. Create root volume + + /usr/bin/vos create <server name> <partition name> root.cell + /usr/bin/fs mkmount /afs/cellname root.cell + e.g.: /usr/afs/bin/fs mkmount /afs/gentoo root.cell + /usr/bin/fs setacl /afs/cellname system:anyuser rl + + Create read/write mountpoint + + /usr/bin/fs mkmount /afs/.cellname root.cell -rw + e.g.: /usr/bin/fs mkmount /afs/.gentoo root.cell -rw + + +OK .. you're ready to go !! Now it's time to read AFS documentation and learn how to +create volumes, create users and groups, set acl's and so on .. Have Fun :)) diff --git a/net-fs/openafs/files/ThisCell.default b/net-fs/openafs/files/ThisCell.default new file mode 100644 index 000000000000..e3a135d57e0e --- /dev/null +++ b/net-fs/openafs/files/ThisCell.default @@ -0,0 +1 @@ +openafs.org
\ No newline at end of file diff --git a/net-fs/openafs/files/cacheinfo.default b/net-fs/openafs/files/cacheinfo.default new file mode 100644 index 000000000000..0e4547fc23fd --- /dev/null +++ b/net-fs/openafs/files/cacheinfo.default @@ -0,0 +1 @@ +/afs:/var/cache/openafs:200000
\ No newline at end of file diff --git a/net-fs/openafs/files/openrc/openafs-client.confd b/net-fs/openafs/files/openrc/openafs-client.confd new file mode 100644 index 000000000000..2dfecd7cef54 --- /dev/null +++ b/net-fs/openafs/files/openrc/openafs-client.confd @@ -0,0 +1,55 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# ENABLE_AFSDB and ENABLE_DYNROOT determine whether AFSDB support and +# Dynroot support (dynamically generated /afs), respectively, should be +# enabled in the AFS client. +ENABLE_AFSDB="yes" +ENABLE_DYNROOT="yes" + +# Log stdout/stderr to /var/log/openafs/client.log (disabled by default) +# ENABLE_STD_LOGGING="no" + +# AFS client configuration options: +# --------------------------------------------------------------------------- +# possible AFS client afsd configuration options (from 1.3.74) are +# -blocks The number of blocks available in the workstation cache. +# -files The target number of files in the workstation cache (Default: +# 1000). +# -rootvol The name of the root volume to use. +# -stat The number of stat cache entries. +# -hosts List of servers to check for volume location info FOR THE +# HOME CELL. +# -memcache Use an in-memory cache rather than disk. +# -cachedir The base directory for the workstation cache. +# -mountdir The directory on which the AFS is to be mounted. +# -confdir The configuration directory . +# -nosettime Don't keep checking the time to avoid drift. +# -verbose Be chatty. +# -debug Print out additional debugging info. +# -kerndev [OBSOLETE] The kernel device for AFS. +# -dontfork [OBSOLETE] Don't fork off as a new process. +# -daemons The number of background daemons to start (Default: 2). +# -rmtsys Also fires up an afs remote sys call (e.g. pioctl, setpag) +# support daemon +# -chunksize [n] 2^n is the chunksize to be used. 0 is default. +# -dcache The number of data cache entries. +# -biods Number of bkg I/O daemons (AIX3.1 only) +# -prealloc Number of preallocated "small" memory blocks +# -pininodes Number of inodes which can be spared from inode[] for +# pointing at Vfiles. If this is set too high, you may have +# system problems, which can only be ameliorated by changing +# NINODE (or equivalent) and rebuilding the kernel. +# This option is now disabled. +# -logfile Place where to put the logfile (default in <cache>/etc/AFSLog. +# -waitclose make close calls always synchronous (slows em down, tho) +# -files_per_subdir [n] number of files per cache subdir. (def=2048) +# -shutdown Shutdown afs daemons +# --------------------------------------------------------------------------- +XXLARGE="-fakestat -stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" +XLARGE="-fakestat -stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" +LARGE="-fakestat -stat 2800 -dcache 2400 -daemons 5 -volumes 128" +MEDIUM="-fakestat -stat 2000 -dcache 800 -daemons 3 -volumes 70" +SMALL="-fakestat -stat 300 -dcache 100 -daemons 2 -volumes 50" +OPTIONS="AUTOMATIC" + diff --git a/net-fs/openafs/files/openrc/openafs-client.initd b/net-fs/openafs/files/openrc/openafs-client.initd new file mode 100644 index 000000000000..36dfa809435a --- /dev/null +++ b/net-fs/openafs/files/openrc/openafs-client.initd @@ -0,0 +1,137 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net + after openafs-server + use logger dns +} + +BSD_MOD="/boot/modules/libafs.ko" + +choose_afsdoptions() { + CACHESIZE=$(cut -d ':' -f 3 /etc/openafs/cacheinfo) + if [ -z "$OPTIONS" ] || [ "$OPTIONS" = "AUTOMATIC" ] ; then + if [ $CACHESIZE -lt 131072 ] ; then + OPTIONS=$SMALL + elif [ $CACHESIZE -lt 524288 ] ; then + OPTIONS=$MEDIUM + elif [ $CACHESIZE -lt 1048576 ] ; then + OPTIONS=$LARGE + elif [ $CACHESIZE -lt 2097152 ] ; then + OPTIONS=$XLARGE + else + OPTIONS=$XXLARGE + fi + fi + AFSD_OPTIONS="$OPTIONS $VERBOSE" + [ "$ENABLE_AFSDB" = "yes" ] && AFSD_OPTIONS="$AFSD_OPTIONS -afsdb" + [ "$ENABLE_DYNROOT" = "yes" ] && AFSD_OPTIONS="$AFSD_OPTIONS -dynroot" +} + +get_logfile() { + local redirect="/dev/null" + yesno ${ENABLE_STD_LOGGING} && redirect="/var/log/openafs/client.log" + echo ${redirect} +} + +start() { + local ret=1 + ebegin "Starting OpenAFS client" + + eindent + + # Check if afsd is already running -> abort + if pgrep -u 0 afsd >/dev/null ; then + eerror "afsd already running, not attempting to restart" + # Check if the openafs kernel module is loaded -> attempt unload + elif [ "${RC_UNAME}" = "Linux" ] && [ -d /proc/fs/openafs ] ; then + ewarn "OpenAFS already active, trying to unload module" + if ! modprobe -r libafs ; then + eerror "OpenAFS kernel module was loaded, unloading failed" + else + cleanstart + ret=$? + fi + elif [ "${RC_UNAME}" = "FreeBSD" ] && kldstat -n ${BSD_MOD} 2> /dev/null; then + ewarn "OpenAFS already active, trying to unload module" + if ! kldunload ${BSD_MOD}; then + eerror "OpenAFS kernel module was loaded, unloading failed" + else + cleanstart + ret=$? + fi + # Everything should be ok, start cleanly + else + cleanstart + ret=$? + fi + + eend ${ret} + eoutdent + return ${ret} +} + +cleanstart() +{ + # Make sure the mountpoint exists + mkdir /afs 2> /dev/null + # Make sure the cache directory exists + # If config doesn't exist, create one + if [ ! -e /etc/openafs/cacheinfo ]; then + echo "/afs:/var/cache/openafs:200000" > /etc/openafs/cacheinfo + fi + CACHEDIR=$(cut -d ':' -f 2 /etc/openafs/cacheinfo) + if ! mkdir -p "${CACHEDIR}"; then + eerror "Unable to create cache dir ${CACHEDIR}" + return 1 + fi + + # Start openafs: module and daemon + ebegin "Loading OpenAFS kernel module" + if [ "${RC_UNAME}" = "Linux" ]; then + modprobe libafs + elif [ "${RC_UNAME}" = "FreeBSD" ]; then + kldload ${BSD_MOD} + else + eerror "Unknown system. Contact the package maintainer." + fi + eend $? || return 1 + + ebegin "Starting OpenAFS daemon" + choose_afsdoptions + /usr/sbin/afsd ${AFSD_OPTIONS} >$(get_logfile) 2>&1 + eend $? +} + +stop() { + local ret=1 + ebegin "Stopping OpenAFS client" + + eindent + + # Three stage process: unmount / stop daemon / unload module + ebegin "Unmounting /afs" + umount /afs + if eend $? ; then + ebegin "Stopping OpenAFS daemon" + /usr/sbin/afsd -shutdown >$(get_logfile) 2>&1 + if eend $? ; then + ebegin "Unloading OpenAFS module" + if [ "${RC_UNAME}" = "Linux" ]; then + modprobe -r libafs + elif [ "${RC_UNAME}" = "FreeBSD" ]; then + kldunload ${BSD_MOD} + else + eerror "Unknown system. Contact the package maintainer." + fi + eend $? && ret=0 + fi + fi + + eoutdent + # Clean up: remove the mountpoint if it's an empty directory + rmdir /afs 2>/dev/null + return ${ret} +} diff --git a/net-fs/openafs/files/openrc/openafs-server.confd b/net-fs/openafs/files/openrc/openafs-server.confd new file mode 100644 index 000000000000..de5948e45272 --- /dev/null +++ b/net-fs/openafs/files/openrc/openafs-server.confd @@ -0,0 +1,7 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Add -syslog here AND in BosConfig to every daemon, if don't want to use +# OpenAFS's own logging system +BOSSERVER_OPTIONS="" + diff --git a/net-fs/openafs/files/openrc/openafs-server.initd b/net-fs/openafs/files/openrc/openafs-server.initd new file mode 100644 index 000000000000..ee2f6c4a003b --- /dev/null +++ b/net-fs/openafs/files/openrc/openafs-server.initd @@ -0,0 +1,33 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net + use logger dns +} + +start() { + ebegin "Starting OpenAFS BOS server" + start-stop-daemon \ + --quiet --start --background \ + --make-pidfile --pidfile /var/run/bosserver.pid \ + --exec /usr/sbin/bosserver \ + -- -nofork ${BOSSERVER_OPTIONS} + eend $? +} + +stop() { + local ret + ebegin "Stopping OpenAFS BOS server" + + # This kindly kills all server processes + /usr/bin/bos shutdown localhost -localauth -wait + ret=$? + if [ ${ret} -eq 0 ] ; then + start-stop-daemon --quiet --stop --pidfile /var/run/bosserver.pid + ret=$? + fi + + eend ${ret} +} diff --git a/net-fs/openafs/files/systemd/openafs-client.service b/net-fs/openafs/files/systemd/openafs-client.service new file mode 100644 index 000000000000..2cafd230277e --- /dev/null +++ b/net-fs/openafs/files/systemd/openafs-client.service @@ -0,0 +1,17 @@ +[Unit] +Description=OpenAFS Client Service +After=network.target remote-fs.target nss-lookup.target + +[Service] +Type=forking +ExecStartPre=/bin/sh -c "/bin/mkdir -p $(cut -d : -f 2 /etc/openafs/cacheinfo)" +ExecStartPre=/bin/sh -c "fs sysname > /dev/null 2>/dev/null; test $? -ne 0 || (echo AFS client appears to be running -- not starting && exit 1)" +ExecStartPre=/sbin/modprobe libafs +ExecStart=/usr/sbin/afsd $AFSD_ARGS $AFSD_CACHE_ARGS +ExecStop=/bin/umount /afs +ExecStopPost=/usr/sbin/afsd -shutdown +ExecStopPost=/sbin/rmmod libafs +KillMode=none + +[Install] +WantedBy=multi-user.target remote-fs.target diff --git a/net-fs/openafs/files/systemd/openafs-client.service.conf b/net-fs/openafs/files/systemd/openafs-client.service.conf new file mode 100644 index 000000000000..e06fd625d603 --- /dev/null +++ b/net-fs/openafs/files/systemd/openafs-client.service.conf @@ -0,0 +1,62 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# AFS client configuration options: +# --------------------------------------------------------------------------- +# possible AFS client afsd configuration options (from 1.3.74) are +# -afsdb Use DNS to lookup SRV or AFSDB records instead of +# reading the CellServDB file. +# -dynroot Dynamically generate /afs entries +# -blocks The number of blocks available in the workstation cache. +# -files The target number of files in the workstation cache (Default: +# 1000). +# -rootvol The name of the root volume to use. +# -stat The number of stat cache entries. +# -fakestat Return fake values for stat calls on cross-cell mounts. +# -hosts List of servers to check for volume location info FOR THE +# HOME CELL. +# -memcache Use an in-memory cache rather than disk. +# -cachedir The base directory for the workstation cache. +# -mountdir The directory on which the AFS is to be mounted. +# -confdir The configuration directory . +# -nosettime Don't keep checking the time to avoid drift. +# -verbose Be chatty. +# -debug Print out additional debugging info. +# -kerndev [OBSOLETE] The kernel device for AFS. +# -dontfork [OBSOLETE] Don't fork off as a new process. +# -daemons The number of background daemons to start (Default: 2). +# -rmtsys Also fires up an afs remote sys call (e.g. pioctl, setpag) +# support daemon +# -chunksize [n] 2^n is the chunksize to be used. 0 is default. +# -dcache The number of data cache entries. +# -biods Number of bkg I/O daemons (AIX3.1 only) +# -prealloc Number of preallocated "small" memory blocks +# -pininodes Number of inodes which can be spared from inode[] for +# pointing at Vfiles. If this is set too high, you may have +# system problems, which can only be ameliorated by changing +# NINODE (or equivalent) and rebuilding the kernel. +# This option is now disabled. +# -logfile Place where to put the logfile (default in <cache>/etc/AFSLog. +# -waitclose make close calls always synchronous (slows em down, tho) +# -files_per_subdir [n] number of files per cache subdir. (def=2048) +# -shutdown Shutdown afs daemons +# --------------------------------------------------------------------------- +[Service] +# afsd args +Environment="AFSD_ARGS=-afsdb -dynroot -fakestat" + +# XXL Cache +#"-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" +# XL Cache +#"-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" +# L Cache +#"-stat 2800 -dcache 2400 -daemons 5 -volumes 128" +# M Cache +#"-stat 2000 -dcache 800 -daemons 3 -volumes 70" +# S Cache +#"-stat 300 -dcache 100 -daemons 2 -volumes 50" + +# Set afsd cache args explicitly to one of the Gentoo defined cache-sizes or, +# preferably, set it automatically based on /etc/openafs/cacheinfo using: +# emerge --config openafs +#Environment="AFSD_CACHE_ARGS=" diff --git a/net-fs/openafs/files/systemd/openafs-server.service b/net-fs/openafs/files/systemd/openafs-server.service new file mode 100644 index 000000000000..92b48f1dec56 --- /dev/null +++ b/net-fs/openafs/files/systemd/openafs-server.service @@ -0,0 +1,11 @@ +[Unit] +Description=OpenAFS Server Service +After=syslog.target network.target + +[Service] +ExecStartPre=/bin/sh -c "/bin/mkdir -p $(cut -d : -f 2 /etc/openafs/cacheinfo)" +ExecStart=/usr/sbin/bosserver -nofork $BOSSERVER_ARGS +ExecStop=/usr/bin/bos shutdown localhost -wait -localauth + +[Install] +WantedBy=multi-user.target diff --git a/net-fs/openafs/files/systemd/openafs-server.service.conf b/net-fs/openafs/files/systemd/openafs-server.service.conf new file mode 100644 index 000000000000..feba47dcf356 --- /dev/null +++ b/net-fs/openafs/files/systemd/openafs-server.service.conf @@ -0,0 +1,4 @@ +[Service] +# Add options to bosserver, for example, add -syslog here AND in BosConfig +# to every daemon, if don't want to use OpenAFS's own logging system +#Environment="BOSSERVER_ARGS=-syslog" diff --git a/net-fs/openafs/files/systemd/tmpfiles.d/openafs-client.conf b/net-fs/openafs/files/systemd/tmpfiles.d/openafs-client.conf new file mode 100644 index 000000000000..52a9eee76109 --- /dev/null +++ b/net-fs/openafs/files/systemd/tmpfiles.d/openafs-client.conf @@ -0,0 +1 @@ +d /afs 0755 root root diff --git a/net-fs/openafs/openafs-1.8.13.ebuild b/net-fs/openafs/openafs-1.8.13.ebuild new file mode 100644 index 000000000000..658e4d21389c --- /dev/null +++ b/net-fs/openafs/openafs-1.8.13.ebuild @@ -0,0 +1,339 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="modules" +inherit autotools linux-mod-r1 flag-o-matic pam systemd tmpfiles toolchain-funcs + +MY_PV=${PV/_/} +MY_P="${PN}-${MY_PV}" +KERNEL_LIMIT=6.11 + +DESCRIPTION="The OpenAFS distributed file system" +HOMEPAGE="https://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE="" +SRC_URI=" + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2 +" + +S="${WORKDIR}/${MY_P}" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="~amd64 -riscv ~sparc ~x86 ~amd64-linux ~x86-linux" + +IUSE="apidoc bitmap-later debug doc fuse kauth kerberos +modules +namei +ncurses perl +pthreaded-ubik selinux +supergroups tsm ubik-read-while-write" + +BDEPEND=" + dev-lang/perl + app-alternatives/lex + app-alternatives/yacc + apidoc? ( + app-text/doxygen[dot] + media-gfx/graphviz + ) + doc? ( + dev-libs/libxslt + || ( + dev-java/fop + app-text/dblatex + app-text/docbook-sgml-utils[jadetex] + ) + ) + perl? ( dev-lang/swig )" +DEPEND=" + virtual/libcrypt:= + virtual/libintl + amd64? ( tsm? ( app-backup/tsm ) ) + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + ) + fuse? ( sys-fs/fuse:0= ) + kauth? ( sys-libs/pam ) + kerberos? ( virtual/krb5 ) + ncurses? ( sys-libs/ncurses:0= )" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-afs )" + +PATCHES=( + "${FILESDIR}"/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch + "${FILESDIR}"/0002-pam-paths.patch + "${FILESDIR}"/0003-fbsd.patch + "${FILESDIR}"/0004-sparc.patch + "${FILESDIR}"/0005-uname.patch + "${FILESDIR}"/0006-resolv.patch + "${FILESDIR}"/0007-afsauthent-symbols.patch + "${FILESDIR}"/0008-flags.patch + "${FILESDIR}"/0009-docbook2pdf.patch + "${FILESDIR}"/0010-libperl.patch + "${FILESDIR}"/0011-xbsa.patch + "${FILESDIR}"/0012-xml-dtd.patch + "${FILESDIR}"/0013-kernel-cc-ld.patch +) +CONFIG_CHECK="~!AFS_FS KEYS" +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" + +pkg_pretend() { + if use modules && use kernel_linux && kernel_is -ge ${KERNEL_LIMIT/\./ } ; then + ewarn "Gentoo supports kernels which are supported by OpenAFS" + ewarn "which are limited to the kernel versions: < ${KERNEL_LIMIT}" + ewarn "" + ewarn "You are free to utilize eapply_user to provide whatever" + ewarn "support you feel is appropriate, but will not receive" + ewarn "support as a result of those changes." + ewarn "" + ewarn "Please do not file a bug report about this." + ewarn "" + ewarn "Alternatively, you may:" + ewarn "1. Use OpenAFS FUSE client, build OpenAFS with USE=fuse to enable it." + ewarn "2. Use native kernel AFS client: configure your kernel with CONFIG_AFS_FS." + ewarn "net-fs/openafs is not required in this case, but client's functionality will be limited." + fi +} + +pkg_setup() { + use kernel_linux && linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # fixing 2-nd level makefiles to honor flags + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \ + src/*/Makefile.in || die '*/Makefile.in sed failed' + + # build system is very delicate, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + _elibtoolize -c -f -i + eaclocal -I src/cf -I src/external/rra-c-util/m4 -I src/external/autoconf-archive/m4 + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache || die +} + +src_configure() { + # requires the --enable-static to avoid build errors. This is + # currently an upstream limitation. + local myconf=( + --enable-static + --disable-strip-binaries + $(use_enable bitmap-later) + $(use_enable debug) + $(use_enable debug debug-locks) + $(use_enable debug debug-lwp) + $(use_enable fuse fuse-client) + $(use_enable kauth) + $(use_enable modules kernel-module) + $(use_enable namei namei-fileserver) + $(use_enable ncurses gtx) + $(use_enable pthreaded-ubik) + $(use_enable supergroups) + $(use_enable ubik-read-while-write) + $(use_with apidoc dot) + $(use_with doc docbook-stylesheets /usr/share/sgml/docbook/xsl-stylesheets) + $(use_with kerberos krb5) + $(use_with perl swig) + ) + + # bug #861368 + filter-lto + + if use debug; then + use kauth && myconf+=( --enable-debug-pam ) + use modules && myconf+=( --enable-debug-kernel ) + fi + + if use modules; then + if use kernel_linux; then + if kernel_is -ge 3 17 && kernel_is -le 3 17 2; then + myconf+=( --enable-linux-d_splice_alias-extra-iput ) + fi + myconf+=( --with-linux-kernel-headers="${KV_DIR}" \ + --with-linux-kernel-build="${KV_OUT_DIR}" ) + fi + fi + + use amd64 && use tsm && myconf+=( --enable-tivoli-tsm ) + + local ARCH="$(tc-arch-kernel)" + local MY_ARCH="$(tc-arch)" + local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC" + + AFS_SYSKVERS=26 \ + econf "${myconf[@]}" + +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 + local d + if use doc; then + emake -C doc/xml/AdminGuide auagd000.pdf + emake -C doc/xml/AdminRef auarf000.pdf + emake -C doc/xml/QuickStartUnix auqbg000.pdf + emake -C doc/xml/UserGuide auusg000.pdf + fi + if use apidoc; then + doxygen doc/doxygen/Doxyfile || die "Failed to build doxygen files" + fi +} + +src_install() { + local OPENRCDIR="${FILESDIR}/openrc" + local SYSTEMDDIR="${FILESDIR}/systemd" + + emake DESTDIR="${ED}" install_nolibafs + + if use modules; then + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.ko ]] || die "Couldn't find compiled kernel module" + linux_domodule ${srcdir}/libafs.ko + modules_post_process + fi + fi + + insinto /etc/openafs + doins src/afsd/CellServDB + newins "${FILESDIR}/ThisCell.default" ThisCell + newins "${FILESDIR}/cacheinfo.default" cacheinfo + + # pam_afs and pam_afs.krb have been installed in irregular locations, fix + if use kauth; then + dopammod "${ED}"/usr/$(get_libdir)/pam_afs* + fi + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die + + # remove kdump stuff provided by kexec-tools #222455 + rm -rf "${ED}"/usr/sbin/kdump* || die + + # avoid collision with mit_krb5's version of kpasswd + if use kauth; then + mv "${ED}"/usr/bin/kpasswd{,_afs} || die + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die + fi + + # avoid collision with heimdal's pagsh + if has_version app-crypt/heimdal; then + mv "${ED}"/usr/bin/pagsh{,_afs} || die + mv "${ED}"/usr/share/man/man1/pagsh{,_afs}.1 || die + fi + + # move lwp stuff around #200674 #330061 + mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die + # update paths to the relocated lwp headers + sed -ri \ + -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \ + "${ED}"/usr/include/*.h \ + "${ED}"/usr/include/*/*.h \ + || die + + # minimal documentation + use kauth && doman src/pam/pam_afs.5 + DOCS=( "${FILESDIR}/README.Gentoo" src/afsd/CellServDB NEWS README ) + + # documentation package + rm -rf doc/txt/winnotes || die # unneeded docs + if use doc; then + DOCS+=( doc/{pdf,protocol,txt} CODING CONTRIBUTING ) + newdoc doc/xml/AdminGuide/auagd000.pdf AdminGuide.pdf + newdoc doc/xml/AdminRef/auarf000.pdf AdminRef.pdf + newdoc doc/xml/QuickStartUnix/auqbg000.pdf QuickStartUnix.pdf + newdoc doc/xml/UserGuide/auusg000.pdf UserGuide.pdf + fi + use apidoc && DOCS+=( doc/doxygen/output/html ) + einstalldocs + + # Gentoo related scripts + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server + dotmpfiles "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf + systemd_dounit "${SYSTEMDDIR}"/openafs-client.service + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service + systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf + + # used directories: client + keepdir /etc/openafs + + # used directories: server + keepdir /etc/openafs/server + diropts -m0700 + keepdir /var/lib/openafs + keepdir /var/lib/openafs/db + diropts -m0755 + keepdir /var/lib/openafs/logs + + # link logfiles to /var/log + dosym ../lib/openafs/logs /var/log/openafs +} + +pkg_preinst() { + ## Somewhat intelligently install default configuration files + ## (when they are not present) + local x + for x in cacheinfo CellServDB ThisCell ; do + if [[ -e "${EROOT}"/etc/openafs/${x} ]] ; then + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/ + fi + done +} + +pkg_postinst() { + use kernel_linux && linux-mod-r1_pkg_postinst + + tmpfiles_process openafs-client.conf + + elog "This installation should work out of the box (at least the" + elog "client part doing global afs-cell browsing, unless you had" + elog "a previous and different configuration). If you want to" + elog "set up your own cell or modify the standard config," + elog "please have a look at the Gentoo OpenAFS documentation" + elog "(warning: it is not yet up to date wrt the new file locations)" + elog + elog "The documentation can be found at:" + elog " https://wiki.gentoo.org/wiki/OpenAFS" + elog + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before" + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited." +} + +pkg_config() { + elog "Setting cache options for systemd." + + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf + [[ ! -e "${SERVICED_FILE}" ]] && die "Systemd service.d file ${SERVICED_FILE} not found." + + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo) + [[ -z ${CACHESIZE} ]] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo." + + if [[ ${CACHESIZE} -lt 131070 ]]; then + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50" + elif [[ ${CACHESIZE} -lt 524288 ]]; then + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70" + elif [[ ${CACHESIZE} -lt 1048576 ]]; then + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" + elif [[ ${CACHESIZE} -lt 2209715 ]]; then + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" + else + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" + fi + + # Replace existing env var if exists, else append line + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \ + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \ + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \ + die "Updating ${SERVICED_FILE} failed." +} |