diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-11-17 03:03:09 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-11-17 03:03:09 +0000 |
commit | 3455c0a5153ae27d7c6c16ecd35fa3dec33f3dda (patch) | |
tree | b29c1fa32b8be70c36e7f8bf53ab5fca875037f9 /net-fs/openafs | |
parent | b0735771a80a647a2ea5a03a87d5873d175bd744 (diff) |
gentoo auto-resync : 17:11:2024 - 03:03:09
Diffstat (limited to 'net-fs/openafs')
27 files changed, 1612 insertions, 0 deletions
diff --git a/net-fs/openafs/Manifest b/net-fs/openafs/Manifest index 45dd89af4afb..96adab62e3a3 100644 --- a/net-fs/openafs/Manifest +++ b/net-fs/openafs/Manifest @@ -1,9 +1,37 @@ +AUX 0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch 1906 BLAKE2B 0db29672f80ec761849a6de09213f772f0e2eac6131e5730574f1301d6837a34aaea24069b89f444cccc2f2ec526e225df74b833fe6902e38afa501006093175 SHA512 35dbfa88d94cd7d7ae35812209cd269fb96ac2d865315bed000ec0c025b9b0a1a3d8841177e82b6289657216da411e61470d3c3e3e033362a4d835640ef5bdf0 +AUX 0002-pam-paths.patch 1432 BLAKE2B 74e088a4f12fda4ce4555e7081feebb2b45ac52c80ea91e6e30a3bb6c01fc4b0bb73b17c081f819c055539e286dc807ac892a83d7e898ca78d80df2f0a533d02 SHA512 9520e9198f9a88281afa09f72d5b37035007e916c62d0fef3dc0cb49b5b00f40964c0cd3664951d948ab4c9bee32ccf90d357198774c377b25d900ebe0e784a4 +AUX 0003-fbsd.patch 1142 BLAKE2B a1d56d5f6a71fc2637ad1cf96469e1e7afc92173f958a960b41d40b3326d451d33eeca3814baf6f27ed2c523a347380ee249b3fb38a7b0098df644dda3dfc3f7 SHA512 6fb89d6b333b8f09c51033b3568c97051714fab53a97c35a8f220768e688d91708b07e70fe803896225c4a673d7f33fa0098649b27731aa8ef26e8dc33e95595 +AUX 0004-sparc.patch 2100 BLAKE2B bf40fade397effbb00bf4a765a7dad8961130965bb573a9030e231684ab4b047982ebe5d2f858d5b8a05c104e137bb3c86fc2f7f13aec645182bd292da453ff3 SHA512 10395b4d53b00e0aa2d58392a06a391ded55af1d9ae7ad34a7c75dc6f9f9e55fe112a1b03b097fe01a17219b0080a83247ad10c5da7f0a79a5720aea9bc1cb89 +AUX 0005-uname.patch 1370 BLAKE2B f55f23a0667985724416da7efe3d42fe921f95f731e81fbfcdb75b0b57f944e6eae4c384fdbc5d7c5b6d558f0934d503d639cc4c1b83c4f3f05d37734620bd60 SHA512 e5bb5aa8f7159285d1fccd7ee2005c9098a5c10817d0c1e05692ae59075c0347851e0b66429dc53d387a3cce1476e0b373bd157fbe52d4830100d62c5aa52659 +AUX 0006-resolv.patch 824 BLAKE2B 75e479c346dd73d87d977e939288adf20a69f3d482580610924929647688378b927292b5921909b73d98f18f47f2a880b863d20ac32c6e572c0875c2c2915bac SHA512 055878d803ac797f72fcb810e1aa3925be786579fee3079217d1d7dbc3df633a844a76fbed0ff183cc85c01d7fb481eb68d808f3c3108b91f444442f8396986a +AUX 0007-afsauthent-symbols.patch 809 BLAKE2B d9afdc44472cb147d208d8d670346f6c4c717c6b791a60446907cd646f3b6f167bc0000a4a5ebc2031b624e130edea2b9f15ab7ab3c8d53c67ee6006a81963ef SHA512 75fe1e092bd701e65f303a37477897fd4393e5cc4be5033cd1cac3ff2d221f147ca71fb96015350cdda2b0bb881fbc77872ed0f8b1aa67fd5afffe024790e6df +AUX 0008-flags.patch 1219 BLAKE2B 5b4ee3167f36f602bb3483547ac977413f3b38d1e99392261ec64b78357f4fdf9238831795a8a1ee969e6d70a4e584ba560622ac5d51f864f24f106d8c2ba293 SHA512 59261225b002f32265ab70834bff9322f6b487bcb93b810bb4c8f661230dde014313329d4937327b706d3bf00bb95076bbfd73786440b9a3eaf14de2121a2d7e +AUX 0009-docbook2pdf.patch 4767 BLAKE2B 1ee48e24e7ccb432393ad524b95794f94c3c3f21b4c762daf6bfdac0c57a32d2f9fc13e5c4cb6589c12d0f99934755b1851d10ff7e56dcbf926926fecef30307 SHA512 0aeaf99b52a74364d939449440bc81d8065fbec73128d89048a783b7c6bc317d2d5de699883af3312889aba918593d4606d0b7c88f431f33f9962598f3cc953d +AUX 0010-libperl.patch 1088 BLAKE2B c1ffa67ab9038798cad60f8892147a045169e971841db1c6818fa1a928ec5790da50c55d357089dc57fc16afde17148f4e8f76a25ba349afea13a2f710e56c44 SHA512 71e52c0579401afa54cc389b0f3da1ee6b3f7a0f914dbcf8b4b23e192d575ca5ebc1082433a68b7ab7ed7073364534f47c8ad64e52587d983eba1740e3b7f35a +AUX 0011-xbsa.patch 985 BLAKE2B 7669f0e6b8370dafca6eeac8d2bb0b1f133f24f4d9166c87cd55843a88cd93cc121eac9365cf04a9b47881544746ab5a7f98864bae5e38443f4275f20a9bfcc8 SHA512 18fbbc5c32d17a31b0955adc161b924c87ae3ad218bb54f590852282a84dceb1e1fc77c68b6e985dd27f96112b6719ad7b241fd20bb7f7f4db452e713bcb32d0 +AUX 0012-xml-dtd.patch 2789 BLAKE2B 8b5807822d27bb91eff23e8565e98c77c7e4598d007009a9580fc29436c7f845db2f23440573731fdb98c6049e0a81a1839d118447495dac9d25400374906ff1 SHA512 9a291751c4ac4ba98a9eacccc056093a06f1abdf8f1d25ae85917b7f1055f216fe98f06066e695d05349503d137d534a0530169a6c672d4dade7b4bc32c75ac6 +AUX 0013-kernel-cc-ld.patch 2489 BLAKE2B dc85da09afbbbbb3cf20c20eeff26e77fc7b4aef6d1d8b3fed07b61bbab337a0fdf580590f7c485cf67a41243d497bb0ce4ab29945d5cb3f0f2d83ba6fd82d06 SHA512 dca05d0c57248f49b38a7e4c074189dcfe9db81ca3d1133549a9a7ce6b9840f0d61875b05eb4e1f4eb373cd4229edd78bb8b7adda350485065f5a2f050853d7d +AUX README.Gentoo 13526 BLAKE2B 5cec095471ebf674d5d51677ea5605f0d1913528196c9402bdab2bd30c94ea0e64b12fe6f7572072fc92c7279ace82cc712728e784551d119a29729627737721 SHA512 1bb9f7a55be65a55420aed12df76a6f60fb7f7d2bf5015fbb8c09e0b691c8a1d8afc53bd0a325b6fd8ff5e244348df79ef618aa6699f3fd68547898b5a4c06e2 +AUX ThisCell.default 11 BLAKE2B e52dcb3991b2c15618a69fd58a57bce8dad1f9145ed4b680975ebc18ad2ad587e36c8f672042bde36cbb5652c9d94235429d948338d8b6a54ed4056bcb421cca SHA512 82011bb6c39abec73a5dd7ca06c97dab391e78ae682a6d0befe790be59499e162620dedc1f69fa753efb636d18d813bd100ea2d19c3f8f80bdeddc9e63bbca5d +AUX cacheinfo.default 30 BLAKE2B 09f010b7e10e89818edb3bbf3d4283b2f5c709d27de73590435e3fee023991983c2a18add9fb8ea563c22258f6f4b53ebbe6aa349ebf6991bbc323a0014fc045 SHA512 1299075743225150f693ad8408c26be15dfaedba378bc62662285d8f477561b8c6dfe641335b854979d71aff928e4c27d3e2f4de6ed0f623b8400beed0f86f7e +AUX openrc/openafs-client.confd 3015 BLAKE2B bc392549adc89958ae3d31cb84904c5bbb2d592ef84b9eacf9535c9f22fa0c3248ae5d35d4be965dcc568a1a76f7f0f9873eb5f29041246e27e95941537012cb SHA512 ad38a8e5f011b51ce9558af1e3464d089fed8e441bc48b9554a035d221d717c983e6a1e170477b4d68bd4375aba97cfdee41b2d8bce02ac26a0f345ca274dccf +AUX openrc/openafs-client.initd 3371 BLAKE2B fb1f153cc161bf8ef48bd6b92591b8b430b4fd728808959c063f62e0c0df10254846ccade48b1d8fe750fabf1f633ed63a486f29643b7933e8c193e8abccf334 SHA512 aaaf71e6c9bd15838ff61f907d2df93e621945baa3fd1d37d1403f83c9f3afa5ecc9e01dcc95c52f23af5144dec93c7feb1febb60bbe5c3e53cfee26ad836135 +AUX openrc/openafs-server.confd 235 BLAKE2B 7b45cd31cf1cdb571e031fe7b74a8dcce6b36d5680c6a5c26dc319b56083ed91c75b1ff4453c40edd7cc205208162cd1163a640d6c75a2c675acc1bcbce03ecc SHA512 0b3b23e6ecf5163569ac26ba3736e37b67b0e30822d56084d5378c7a686bf9d0f3683b13437b896b513882a535dfd92fb85fb54134be8d52d28c2fee4302d758 +AUX openrc/openafs-server.initd 682 BLAKE2B 500d71f883f6cb02b37dbcee66e2abe2da55c4a43739218309720a06b7c5fd781a59888a279a13dd71a00fa849152e07ff690b5071d9523a6f9ebb2018acbbdf SHA512 36b879327f6753b7cb43b83436ca6feb1c765ee62509e0d7bb9550ac25f717c0774ce9a7ed8a1889ad1131869cb842b1fe36f3594a5c240dab9c2a63b7bbb0ca +AUX systemd/openafs-client.service 600 BLAKE2B b5b2bce69ebef14200faea8b5731d06dec0d29850e7ddd33dfc4c8b9ad07e2104f3b4872dc246a6ad00b574ac4d49e170c25e01427ae78be735af9249025ae9f SHA512 db204de36d626a8861bf69b8e673a647ff8bd89ac865a29ffed0f3e3cb361e7b46e7a50462ff3bcb59754175cc092541f23e3292da3392f8e4daf38377c9f59c +AUX systemd/openafs-client.service.conf 3185 BLAKE2B bf551c1fe4f27100800346fb26e4f95d0bc743c2fa1ae67d24dfb02a1b7d9bf5e71cbacf4a69b9a6548fb2ba7ee3a7c796857f1eaa42e80491914b1a0794fc8e SHA512 ab0886f3a1ce3df7e9f85991a140bdc3baee230dcb9f70d025c899fe742af8cdc7fbaeb8f2ef73d0acadfa29d0a37fb320fd93093210892fbc78427ca18c5c5c +AUX systemd/openafs-server.service 318 BLAKE2B a400865ef8c5796da636434de16de8447f1c27e4d3623747606edfccad75a8816d4d5d3c2e944128c27c7b843701f5a403209adc0356a799b30633efb4ebbd81 SHA512 ded9a765b591fda78629f8b9645cc0b71f064826f9b1a5e89ff1fa9195d049555ae578b23396c275f0866fc2ba84e85e17159fd7521d9bef1ccd070ffdabd7cb +AUX systemd/openafs-server.service.conf 192 BLAKE2B 4ab26af2d366691de2447a142c1c72f3827212880ab8ceb66d67b24448ff510513a05feadc2b9e2cc4e23e5ef995232fb9634abb60947f4c0c6c0cc6891e0a12 SHA512 d6a7f57533b7abb5dd859cedc5c253e959d8b822f68202564c6b8a65a57278b0036ae503fd7cb411e1bdad0eea70763416c32fabd0e9a71e814bf11ff1a61613 +AUX systemd/tmpfiles.d/openafs-client.conf 22 BLAKE2B 49b31e03b8ee512d6a2758cf946ff6bf650b25acc96ad043fed54868a4726647d0ff5a02fc697605d007c0ea95c2b1cb7e4cdffd01c515b99a5bf09c7244e5a8 SHA512 ee8daa10c6fac2d05085f74b0a807e27e327124380ae6e642f29bfe0b2f3b3909da3024a1c4f6b86a712e05ed05875d36c3b1cc06543a1f390f713a16a2baca6 +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 DIST openafs-1.8.8.1-src.tar.bz2 14866119 BLAKE2B ae58a1d30fc8d72b4487700203c03e62fc15d0034a03516d4ea5b52c33970e8d9954e6b3c812a4633910c512d283c11431abbcb3868569d8d5ced1a69585263e SHA512 fb181e0989e9bae714af26de916a96946eea20f98b47154f2de7b5e296cb4f42af5df037ef7b603073e97eafe52d7c401666f03130c1e0c9a6ae1a6c2707c384 DIST openafs-patches-20210116.tar.xz 67300 BLAKE2B aaafa197d1be1e9d89685fe5193a4682ea9e5e5c1c3227963a97ca7a98e6ab5e855ee65d615a31162559b30ae5867fde6ceeec1055af1a375e73b9fa25654de5 SHA512 06e9e1b65fceda34a197556aba1a05eabb630723fc17c5060d5e2a054e60ab8c5195d5c80eff3d3444bcdca40b7115da9143f5b8100659061446038ad4a79007 DIST openafs-patches-20211212.tar.xz 13892 BLAKE2B 64582135ff3b81725cf0510d1157785b112f76197b8f50a947d22a82b8b55bebd163f2288b19d68a994f22c78bd90b6bfdad5f75383df1cac06d40feb72e8de8 SHA512 40a1a0d126ae194609da8a264c26b278b6081d95020bcbdb3a809952a70535fa551d1983e811e4ab9deaec06f061075906c2bbaf91e4354bff3520584e3fd336 +EBUILD openafs-1.8.13.ebuild 10785 BLAKE2B cc0f6a296a9a90f3a23a8f431042430608a2f574e36841f36673b1841d278c6db9478f56a6edfb54f8bf98002ba8022e10549b251ff43edea1c7bdd62dc7df87 SHA512 b039f7af5de39859e2162925cd91e8dad588e621751589603509abacf0240814f54c9a1f47a2923262bc795ea95cbb11ce85b3f4c00bf8583f8a4d28240322b8 EBUILD openafs-1.8.7.ebuild 10613 BLAKE2B 243cf09efb3b53f74ac96c9b15a9f26ca84a3a76866e334594942ac23f450b3ae7b38c64aa784346dcb7035223a83a2260a3bcc94a07811fbae125a06e7b372a SHA512 486d21e1b917475a4cbd4b210be0d985203fdea1360cf3b0fe47d3bc2309791e7c980192ccf2359d0c699286a8b101fd318ae4d1f7a01c66a6b05d0a1965ed96 EBUILD openafs-1.8.8.1-r1.ebuild 10507 BLAKE2B 1ab828bdc461825f568a88eaec29e0f0b73d4bfaf82c33139387f95543b8f0e7bf6b877429d9977ecea9c9a236e372d41b3d46dddaf45c4ecac16a4cd095dcf5 SHA512 0fe5be63c36eeb4e1ff9569e67c18e2cf2aef378256920851a83e22fde799c9d4328cc3dccbe58450e58d1807e111e62248143b11811f4d97fa4cf6c0ccba89d MISC metadata.xml 1276 BLAKE2B 64acb1928c14c6129ebba32dd004021a472bbcb9a00625fec7ac06a3f12d8a0d084e43f2deeabd72c0bb3f73b853cb7c133318b50d86b7bbc81be72ffe200f91 SHA512 d8ebcfb8df0eb80ade7bf55170fdc9a20062981fd82793a60984b6eaa04639e6bc86cb8a9f7cc2ab2d18fc6da70f2570ddd535b64a6754d322f055c01144afc8 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." +} |