From 5672cc1c65eacc8d02c58dbd6e5fae7a12306352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20G=C3=A9rczei?= Date: Sat, 29 Aug 2020 20:46:13 +0200 Subject: [PATCH] hacked live ebuild for genkernel to resurrect 4.0.0-beta8 --- sys-kernel/genkernel/Manifest | 29 +++ sys-kernel/genkernel/files/genkernel-4.bash | 74 ++++++ sys-kernel/genkernel/files/initramfs.mounts | 23 ++ sys-kernel/genkernel/genkernel-9999.ebuild | 254 ++++++++++++++++++++ 4 files changed, 380 insertions(+) create mode 100644 sys-kernel/genkernel/Manifest create mode 100644 sys-kernel/genkernel/files/genkernel-4.bash create mode 100644 sys-kernel/genkernel/files/initramfs.mounts create mode 100644 sys-kernel/genkernel/genkernel-9999.ebuild diff --git a/sys-kernel/genkernel/Manifest b/sys-kernel/genkernel/Manifest new file mode 100644 index 0000000..03bbea7 --- /dev/null +++ b/sys-kernel/genkernel/Manifest @@ -0,0 +1,29 @@ +AUX genkernel-4.bash 2479 BLAKE2B e5504698ab49bb62623fcdfdd4a54b19ee6d88f96a682f08dc282e46ec26bd22d9c54bcdc9b2bdcc6a96295de1ab96351d35b304eb176f5d177c221cd8d82180 SHA512 6a5709a410c5c07b7a343ecc141aa72de73d3b4acd0a69c05c61c801835a59dd17d9a528f6b68f12ac00ff4b6e5954b03237472501383aa390eb1365dd69c281 +AUX initramfs.mounts 816 BLAKE2B 4f36e51fef78435369d43647db853c7bfde217cc93002fc010900692f67171512366e6599f08c5f2093490713aa7715e903b7e06528e3f2c6d8468f506938ed5 SHA512 97e5f92d135cff3911a68c7f1afd0f781ec1c1b794cdc824d74f8c119104ecb40bd7180be8414dc72f3a5a811143d6b4bf443ac1d3ff7a71b1e88cbf7c179665 +DIST LVM2.2.02.185.tgz 2386328 BLAKE2B d2e31de3eedd7518ea2d239cb9b36b38e351d7fc070097a1fc4e7934e3636195da3247fba57d684bb0b31b7f3dbdfe29161bd121b2962b2c35c8c9d7914b4506 SHA512 f421505551aec2a09bc862f2fcc1ee825bc4d94c53a01d13265631e99308d60fbca40112be5bc7824cce3ef223c0775d2f6c345f6a3f227229a0566c903841bf +DIST btrfs-progs-v5.1.1.tar.xz 1969248 BLAKE2B 3adca8014fca34f7698edb3f062535e55e61609a838d8d980100af92562e133eab723e389ac61ffcd0594a2a46092d247ade418243074d36de73cbc74c49e56f SHA512 fe0546b7a4cd22783b86d4c4848735f843bf1b4c893e32014d075318fa12ee5e5b05a04afcadca9d4de75287f06c494cebf98dfb710ee08666c380453b5b0ff0 +DIST busybox-1.32.0.tar.bz2 2439463 BLAKE2B 75937ae6e1401d7ab947d80f4b206112023ff2b7d04257ffa2c254cadabb92282ba04d5d608659b6c98fade1ccd0b0f6b204c8758263d59dea6508a3157a7c69 SHA512 1b1227af69a97e820e28f5f1c62413e4e179202ab525725ea0b1afe9b9f9a5f00e5e32f4603e804ba1596b0fedd60d60457a6d2b8fcedfab45b6e049caeb319b +DIST cryptsetup-2.3.2.tar.xz 11037076 BLAKE2B b0f8a1a274e6b95b12aa7172dbdd41e512aea2c87a98d62b8b4d4cbb898b2d4b82e250368e385c4d4acc8e77046ea4b4f7be730750587569572c4b9490815bc1 SHA512 c5eb41751ca64ff906187f40805705570c261816b014dfcdbf2777f42e53668e32966197092a2235b8f6a7a4e7f9c3f301d82f17c45cfbcff96b9818631d7e5f +DIST dmraid-1.0.0.rc16-3.tar.bz2 232743 BLAKE2B 290c5bb7f1b12ac48627d8afcc346327b2fcce31b1015d5974c956d94f607b297e383158cd8741f03a770cdeb3f42c3e6341ebfcbc2220e122d89c2603eee512 SHA512 7c45e5117adc52fc2094b1b2bad4f4c518a46317a2196611966d72085ba3587c4ac8d1080f9d934888c01788f2b2d3d621c6f0d3e2a023c0fb1f9f3fa7fc127e +DIST dropbear-2019.78.tar.bz2 2708659 BLAKE2B 212b173cfea8655b43a8d93422dd4d3e0d669a67681cb17d6494b6083e6e4c58d21d52850c0cdf414617ee3dcaa071e376d0b5b156b6856cee2e4fe111550f7d SHA512 f667ba8dae17ea89c118642b566f2c134c71bfd0b8bacea5cf7ec87d75ac79bd7cd1864a8788367a89d30ee35427d389ef6416375adff6e83caae30ff3e0549f +DIST e2fsprogs-1.45.3.tar.xz 5592080 BLAKE2B a0be9e797ff9c74c4c108b522c054804cb9031cf3ea530f8ab2730837dca1d6366629b2d9a5c47341528b93f06c74f892b48fae5c5b7eb153ae542d37f834762 SHA512 857714aaabd0f5c7a9972d72e46920bbef669125ff357b2eb361a25584bfdc7e0e4b001a5cba3b9cf4b6023c173fd013b0c1bc471e3902a667e27beed3eea154 +DIST eudev-3.2.8.tar.gz 1894193 BLAKE2B 8709a13031744d5dd2f57853375b920bdaa6ea028624111dc96be9d46748de8423ac749f27183c668336701c16735d7ca2db4566621e0e741a2604785c14c64f SHA512 13221e6f9696a8630d867eb7d73f3bf5dd1bc2dfd80d62af00342be4cbf39a862e644ea3776fa4d91463e594ca50c5deecbeb7e05d161097e889ea58a66ccc42 +DIST fuse-2.9.9.tar.gz 1813177 BLAKE2B 9e9141380bda46eb0bcce325c6fd293fe3844fe884a4952bb38d4b89dc48b728ffcc891038b3a7a861f05acfacce9dd7bb0e11d600609f3ad0ab278ccbe98847 SHA512 3d82fafd04f2924299bb09d2bb144935fa004a43fb9a6568e2e1cc5a60fded2efa1711029a0d7f12b3e6e4501f7217f2ee3545646d89da8dece083cb390f23e2 +DIST gnupg-1.4.23.tar.bz2 3749353 BLAKE2B ec5e6bef0c7bb2a65813d7852cebeaa24c4855f9d9d9e802070da50b89fff56b747682933aa766dd130f849efcfe28f7aa74f3153405429bcf3845ef29c6dd6e SHA512 78dc52a2010202a4afc8814b29fda657a6c9fe230d5e7db11ae040edd2b0ca819e1baa4dbd6c0d04d36cd353df484e83f52d17759d2891c2cf7025c0b5d36612 +DIST json-c-0.13.1.tar.gz 639425 BLAKE2B 1da310309f9ce03306a9fd4a161670e460cf0b2222348df7c006902390f74a4cf100aab1ce6ac8a361a278dd917c114a278de5b3445817f3a40ae287478add46 SHA512 e984db2a42b9c95b52c798b2e8dd1b79951a8dcba27370af30c43b9549fbb00008dbcf052a535c528209aaee38e6d1f760168b706905ae72f3e704ed20f8a1a1 +DIST libaio-0.3.112.tar.gz 46977 BLAKE2B 088f3b195a65bdc97ae2318e47af17c65259ed3208dca7bfef93c81a800602085e5b2078dbd436c740be316d0ebd923a1b3b7c0808257e2e7c7fb0f7ae1e0dba SHA512 5f984529c9f747a6c82f1e4457fc0832bb1fc299ae6e700f2ac5a8ea7b9bfc6ea1e75809728cc115a020cff6685ed1f4e38c6aeacc1ea98dfccce04dd19dafaa +DIST libgcrypt-1.8.4.tar.bz2 2990108 BLAKE2B 97a1f9382adf23cd4ac491a392882f2e712fddd4f0d95a4fafb9cc70aa41ffa7b7b6a371b8368e9c99e3e1849b9d38078abc55703d4d8b25289f3c662e6ba8a1 SHA512 b831fc337eb14806897e224b0d1e78d1f8e9db91dffa818a015a4aa104144e2d971e5a855904907ee2bb9990a9d526de32d6787e1cae98e28a65c3258b2b1ea1 +DIST libgpg-error-1.36.tar.bz2 920542 BLAKE2B 81684f6e47192c50cfa408977d53dc3812befca28733b531d51dffa0a6799a47366a50f64755557a7b3111a179ac4aba9e6a527418461cdbcccea80ae6bed4fa SHA512 6e5f853f77dc04f0091d94b224cab8e669042450f271b78d0ea0219658d059c9cab1ab0eaa020a4227f451520b417fc340b85971a6f5e144fa69be57e15df346 +DIST lzo-2.10.tar.gz 600622 BLAKE2B 124b6645a2cb7f01f153c9fa6e1976378bdfb224841a7b45ab19c584c6ef704c20719ae87640b8d83f3f9269a57d9cc2e870a914124dac03a2ef1336e9feb9c9 SHA512 a3dae5e4a6b93b1f5bf7435e8ab114a9be57252e9efc5dd444947d7a2d031b0819f34bcaeb35f60b5629a01b1238d738735a64db8f672be9690d3c80094511a4 +DIST mdadm-4.1.tar.xz 440756 BLAKE2B df0506d937c2aa309d7c68804f66f7dcd51783288594bf746832311c64b8cf82004af4af5f246c5f9753f1de324ff7d49b5ee752d6a00ec03864f7885389706e SHA512 0859c5d3e786345d93ff2c3b291ca8866ba60f1375479e5b4d343124f6824140a8268d42b8ae603b069edba761aa30aaf20d49e9ec54dfcbad34bad3bea0e433 +DIST multipath-tools-0.8.0.tar.gz 447076 BLAKE2B 10a93a2654decd2377414188013d2141e34288fe119fa7c54047d95b825ef9ae64b20de1067d3f37a904b58be587997842f7a62088701fe1c1e6a078283b56e4 SHA512 8b6081109e535d0e392233bcedda930bc6d4b529ebe23bc45b276026311bc997e3cf8b39c1a86e4962c464faa69512202c0f6fb3d1f06c6445f8141853ad1bc4 +DIST open-iscsi-2.0.875.tar.gz 635121 BLAKE2B 34a7083087c53ed0e59d293d26efe166b09c5ea18b6022869cc9ff3d2edb2fb8b69e2c1ce6c9011bd20fc590b02dafd6d7c13d8bfa1eae6408c4bace13992e5e SHA512 1709011d7d12d3dd9278a0d775af064d5f7da37357f35d6d5c5b3aa8ec16385c28b201b1261f4581dbbbbca3d815015ed8696e1694aa19f3231132f90d1e5b36 +DIST popt-1.16.tar.gz 702769 BLAKE2B 37767ec50118f3675e8bfa780dca7989e092ea71c3ea1e1ab80d7cc13bf20a3b5f0681df2a7e0b1e3404404a0952f7b7f0135083d4166026dc26880a5a17ab3f SHA512 bae2dd4e5d682ef023fdc77ae60c4aad01a3a576d45af9d78d22490c11e410e60edda37ede171920746d4ae0d5de3c060d15cecfd41ba75b727a811be828d694 +DIST strace-5.2.tar.xz 1515544 BLAKE2B 919a689741eabd843a43fdb557953ee6095a4d1abea808d7c35049b93afd338e0df7c69014486dfb88d22dd7cdb2f74b939ed55f08e85cdb9793d8150d08bde0 SHA512 41bea20215fa80ad90a5d49c41944e02774e715efda5e563b3714e5800933a5fca4a2392634193cf49c0752321a39e0c185bdbc9cfb8ee053b09a6bd5723da35 +DIST unionfs-fuse-2.0.tar.gz 46537 BLAKE2B 2f5a0da5adb15c408e7b9d0c3658e389a1aea4a9a5f2f3809fc724af43cf2a4b309e4220e46647e3f3fc9b19d48c8d62692e190cf8536182abfe551bfacfcc24 SHA512 5b60204632f498931fff7671cc9f40b1800d34cb8c0d0de0773626e2653eb0a36647566c92c1d0cf79543e01b934602ef5603a06508407f352e48ef27a7ee758 +DIST userspace-rcu-0.10.2.tar.bz2 503833 BLAKE2B 17e2102e096903f301d1a08d606cf98e28a413ef26a3dc8fa6f400ba74aa14aabdef5e28d4fed5fb01cee33b0bd5de9fb0682523aaa50c6053fd3471711a02e7 SHA512 47413b4a593d19185ee3d455e5744042c060cb50008dac25e9135c5cd2250ef5129a419258b18c665c8c794ad3b09234fdd70a106c72d8fc64631172b13d0e22 +DIST util-linux-2.34.tar.xz 4974812 BLAKE2B d26b2f74d490eaee0a40d4c75a1a351ba165b4a52f9bbf6cf9d1afd7ae1382a3a3dfe41180584e97e9aaad6950f604cad928f30747590e3e1e669c8797689758 SHA512 2d0b76f63d32e7afb7acf61a83fabbfd58baa34ab78b3a331ce87f9c676a5fd71c56a493ded95039540d2c46b6048caaa38d7fb4491eb3d52d7b09dc54655cd7 +DIST xfsprogs-5.1.0.tar.xz 1027076 BLAKE2B e110e2d8b310829f520d0fd28ab93bd399a49b25cff73e40c7e17011eebfd1d9bda0b8b50ff99185b4aeec3b82cf27bc549ae805bb55159471533a421e417931 SHA512 53df4b89adcbabdf09f621bfd9ecebfe744de65eb79f6535be36db58598a9ddb05b4d048893f75691ba3ccbda5cb08a4281577236360b877728237845c4c7b2b +DIST zlib-1.2.11.tar.gz 607698 BLAKE2B 6bfc4bca5dcadba8a0d4121a2b3ed0bfe440c261003521862c8e6381f1a6f0a72d3fc037351d30afd7ef321e8e8d2ec817c046ac749f2ca0c97fbdc2f7e840b7 SHA512 73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae +DIST zstd-1.4.0.tar.gz 1898741 BLAKE2B 1b92a055712bb47c3d56c51f3ddddeaba00f9b746f7e47a2fa1a0afdf9798ff90f0ec734880a5d03644d47deb0e55f75c2cd3cbdab1a146dba5f49d4efeb2ae0 SHA512 8614934e25eb1e82b554c483bc9d2d055f51344697295e83b22a8d726321b12068cfa7f7d2a9fe28a2de7c9edda59733826277efc7046e13674d6f7f02af5671 +EBUILD genkernel-9999.ebuild 8692 BLAKE2B 619d6e69ac756619df64db02a187f8d7bc7b49a0985389f142a3d46993de81a2958715601e17aefdec872d241514df90ef79c89da75693918885ef59806ce2b0 SHA512 7ac4911dacc9beeac499b3aab3f2e080737e208d9e5256d7477d5cb7293c3ba0f4d23ec9a5088fb6f3a30ac0858d9341728f2c486390cd770e0f579b7680e5c5 diff --git a/sys-kernel/genkernel/files/genkernel-4.bash b/sys-kernel/genkernel/files/genkernel-4.bash new file mode 100644 index 0000000..f72aa7a --- /dev/null +++ b/sys-kernel/genkernel/files/genkernel-4.bash @@ -0,0 +1,74 @@ +# genkernel (8) completion +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 +# Written by Aron Griffis + +_genkernel() +{ + declare cur prev genkernel_help actions params + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + # extract initial list of params/actions from genkernel --help + genkernel_help=$(command genkernel --help 2>/dev/null) + actions=( $(<<<"$genkernel_help" sed -n \ + '/^Available Actions:/,/^$/s/^[[:space:]]\+\([^[:space:]]\+\).*/\1/p') ) + params=( $(<<<"$genkernel_help" egrep -oe '--[^[:space:]]{2,}') ) + + # attempt to complete the current parameter based on the list + COMPREPLY=($(compgen -W "${params[*]/=*/=} ${actions[*]}" -- "$cur")) + + # if we don't have a rhs to complete + if [[ ${#COMPREPLY[@]} -gt 1 ]]; then + return + elif [[ ${#COMPREPLY[@]} -eq 0 && $cur != --*=* ]]; then + return + elif [[ ${#COMPREPLY[@]} -eq 1 && $COMPREPLY != --*= ]]; then + # using nospace completion, add an explicit space + COMPREPLY="${COMPREPLY} " + return + fi + + # we have a unique lhs and need to complete the rhs + declare args lhs rhs + if [[ ${#COMPREPLY[@]} -eq 1 ]]; then + lhs=$COMPREPLY + else + lhs=${cur%%=*}= + rhs=${cur#*=} + fi + + # genkernel's help gives clues as to what belongs on the rhs. + # extract the clue for the current parameter + args=" ${params[*]} " + args="${args##* $lhs}" + args="${args%% *}" + + # generate a list of completions for the argument; this replaces args with + # an array of results + args=( $(case $args in + ('<0-5>') compgen -W "$(echo {1..5})" -- "$rhs" ;; + (''|'') compgen -A file -o plusdirs -- "$rhs" ;; + ('') compgen -G '*.tar.xz' -G '*.tbz2' -G '*.tar.bz2' -o plusdirs -- "$rhs" ;; + (''|'') compgen -A directory -S / -- "$rhs" ;; + + (*) compgen -o bashdefault -- "$rhs" ;; # punt + esac) ) + + # we're using nospace completion to prevent spaces after paths that aren't + # "done" yet. So do some hacking to the args to add spaces after + # non-directories. + declare slash=/ + args=( "${args[@]/%/ }" ) # add space to all + args=( "${args[@]/%$slash /$slash}" ) # remove space from dirs + + # recreate COMPREPLY + if [[ $cur == "$lhs"* ]]; then + COMPREPLY=( "${args[@]}" ) + elif [[ ${#args[@]} -gt 0 ]]; then + COMPREPLY=( "${args[@]/#/$lhs}" ) + fi +} + +complete -o nospace -F _genkernel genkernel diff --git a/sys-kernel/genkernel/files/initramfs.mounts b/sys-kernel/genkernel/files/initramfs.mounts new file mode 100644 index 0000000..b34c675 --- /dev/null +++ b/sys-kernel/genkernel/files/initramfs.mounts @@ -0,0 +1,23 @@ +# This specifies which mounts from your fstab should be mounted before +# switching to the real root. If this file is missing, genkernel's code will +# default to just "/usr", which will suffice on most systems with a seperate +# /usr mount. +# +# If you have a complex configuration with a bindmount or symlink at /usr, or +# need some other mountpoints at boot, you should update this file such that +# /usr and anything else needed will be available after the switch into the +# real root. +# +# The lines without comments in this file are used as exact matches against the +# second column of your /etc/fstab and the device, fstype and mount options are +# taken from that line in fstab. If no line matches, the line from this file +# will be ignored. +# + +/usr + +# If you had some need of these: +#/usr/local +#/opt +#/var +#/home diff --git a/sys-kernel/genkernel/genkernel-9999.ebuild b/sys-kernel/genkernel/genkernel-9999.ebuild new file mode 100644 index 0000000..4c91865 --- /dev/null +++ b/sys-kernel/genkernel/genkernel-9999.ebuild @@ -0,0 +1,254 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# genkernel-9999 -> latest Git branch "master" +# genkernel-VERSION -> normal genkernel release + +EAPI="7" + +inherit bash-completion-r1 + +# Whenever you bump a GKPKG, check if you have to move +# or add new patches! +VERSION_BTRFS_PROGS="5.1.1" +VERSION_BUSYBOX="1.32.0" # bumped from 1.30.0 in order to build with a newer toolchain +VERSION_CRYPTSETUP="2.3.2" # bumped from 2.1.0 in order to locate a suitable source archive +VERSION_DMRAID="1.0.0.rc16-3" +VERSION_DROPBEAR="2019.78" +VERSION_EUDEV="3.2.8" +VERSION_E2FSPROGS="1.45.3" +VERSION_FUSE="2.9.9" +VERSION_GPG="1.4.23" +VERSION_ISCSI="2.0.875" +VERSION_JSON_C="0.13.1" +VERSION_LIBAIO="0.3.112" +VERSION_LIBGCRYPT="1.8.4" +VERSION_LIBGPGERROR="1.36" +VERSION_LVM="2.02.185" +VERSION_LZO="2.10" +VERSION_MDADM="4.1" +VERSION_MULTIPATH_TOOLS="0.8.0" +VERSION_POPT="1.16" +VERSION_STRACE="5.2" +VERSION_UNIONFS_FUSE="2.0" +VERSION_USERSPACE_RCU="0.10.2" +VERSION_UTIL_LINUX="2.34" +VERSION_XFSPROGS="5.1.0" +VERSION_ZLIB="1.2.11" +VERSION_ZSTD="1.4.0" + +RH_HOME="ftp://sourceware.org/pub" +DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src" +BB_HOME="https://busybox.net/downloads" + +COMMON_URI=" + mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${VERSION_BTRFS_PROGS}.tar.xz + https://www.busybox.net/downloads/busybox-${VERSION_BUSYBOX}.tar.bz2 + mirror://kernel/linux/utils/cryptsetup/v$(ver_cut 1-2 ${VERSION_CRYPTSETUP})/cryptsetup-${VERSION_CRYPTSETUP}.tar.xz + https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-${VERSION_DMRAID}.tar.bz2 + https://matt.ucc.asn.au/dropbear/releases/dropbear-${VERSION_DROPBEAR}.tar.bz2 + https://dev.gentoo.org/~blueness/eudev/eudev-${VERSION_EUDEV}.tar.gz + mirror://kernel/linux/kernel/people/tytso/e2fsprogs/v${VERSION_E2FSPROGS}/e2fsprogs-${VERSION_E2FSPROGS}.tar.xz + https://github.com/libfuse/libfuse/releases/download/fuse-${VERSION_FUSE}/fuse-${VERSION_FUSE}.tar.gz + mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2 + https://github.com/open-iscsi/open-iscsi/archive/${VERSION_ISCSI}.tar.gz -> open-iscsi-${VERSION_ISCSI}.tar.gz + https://s3.amazonaws.com/json-c_releases/releases/json-c-${VERSION_JSON_C}.tar.gz + https://releases.pagure.org/libaio/libaio-${VERSION_LIBAIO}.tar.gz + mirror://gnupg/libgcrypt/libgcrypt-${VERSION_LIBGCRYPT}.tar.bz2 + mirror://gnupg/libgpg-error/libgpg-error-${VERSION_LIBGPGERROR}.tar.bz2 + https://mirrors.kernel.org/sourceware/lvm2/LVM2.${VERSION_LVM}.tgz + https://www.oberhumer.com/opensource/lzo/download/lzo-${VERSION_LZO}.tar.gz + mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz + https://git.opensvc.com/?p=multipath-tools/.git;a=snapshot;h=${VERSION_MULTIPATH_TOOLS};sf=tgz -> multipath-tools-${VERSION_MULTIPATH_TOOLS}.tar.gz + http://ftp.rpm.org/mirror/popt/popt-${VERSION_POPT}.tar.gz + https://github.com/strace/strace/releases/download/v${VERSION_STRACE}/strace-${VERSION_STRACE}.tar.xz + https://github.com/rpodgorny/unionfs-fuse/archive/v${VERSION_UNIONFS_FUSE}.tar.gz -> unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.gz + https://lttng.org/files/urcu/userspace-rcu-${VERSION_USERSPACE_RCU}.tar.bz2 + mirror://kernel/linux/utils/util-linux/v${VERSION_UTIL_LINUX:0:4}/util-linux-${VERSION_UTIL_LINUX}.tar.xz + mirror://kernel/linux/utils/fs/xfs/xfsprogs/xfsprogs-${VERSION_XFSPROGS}.tar.xz + https://zlib.net/zlib-${VERSION_ZLIB}.tar.gz + https://github.com/facebook/zstd/archive/v${VERSION_ZSTD}.tar.gz -> zstd-${VERSION_ZSTD}.tar.gz +" + +if [[ ${PV} == 9999* ]] ; then + EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git" + inherit git-r3 + S="${WORKDIR}/${P}" + SRC_URI="${COMMON_URI}" +else + SRC_URI="mirror://gentoo/${P}.tar.xz + ${COMMON_URI}" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +fi + +DESCRIPTION="Gentoo automatic kernel building scripts" +HOMEPAGE="https://www.gentoo.org" + +LICENSE="GPL-2" +SLOT="0" +RESTRICT="" +IUSE="ibm +firmware" + +# Note: +# We need sys-devel/* deps like autoconf or automake at _runtime_ +# because genkernel will usually build things like LVM2, cryptsetup, +# mdadm... during initramfs generation which will require these +# things. +DEPEND="" +RDEPEND="${DEPEND} + app-arch/cpio + >=app-misc/pax-utils-1.2.2 + app-portage/elt-patches + sys-apps/sandbox + sys-devel/autoconf + sys-devel/autoconf-archive + sys-devel/automake + sys-devel/libtool + virtual/pkgconfig + firmware? ( sys-kernel/linux-firmware ) + !/dev/null || die + git log > "${S}"/ChangeLog || die + popd >/dev/null || die + fi + + # Update software.sh + sed -i \ + -e "s:VERSION_BTRFS_PROGS:${VERSION_BTRFS_PROGS}:"\ + -e "s:VERSION_BUSYBOX:${VERSION_BUSYBOX}:"\ + -e "s:VERSION_CRYPTSETUP:${VERSION_CRYPTSETUP}:"\ + -e "s:VERSION_DMRAID:${VERSION_DMRAID}:"\ + -e "s:VERSION_DROPBEAR:${VERSION_DROPBEAR}:"\ + -e "s:VERSION_EUDEV:${VERSION_EUDEV}:"\ + -e "s:VERSION_E2FSPROGS:${VERSION_E2FSPROGS}:"\ + -e "s:VERSION_FUSE:${VERSION_FUSE}:"\ + -e "s:VERSION_GPG:${VERSION_GPG}:"\ + -e "s:VERSION_ISCSI:${VERSION_ISCSI}:"\ + -e "s:VERSION_JSON_C:${VERSION_JSON_C}:"\ + -e "s:VERSION_LIBAIO:${VERSION_LIBAIO}:"\ + -e "s:VERSION_LIBGCRYPT:${VERSION_LIBGCRYPT}:"\ + -e "s:VERSION_LIBGPGERROR:${VERSION_LIBGPGERROR}:"\ + -e "s:VERSION_LVM:${VERSION_LVM}:"\ + -e "s:VERSION_LZO:${VERSION_LZO}:"\ + -e "s:VERSION_MDADM:${VERSION_MDADM}:"\ + -e "s:VERSION_MULTIPATH_TOOLS:${VERSION_MULTIPATH_TOOLS}:"\ + -e "s:VERSION_POPT:${VERSION_POPT}:"\ + -e "s:VERSION_STRACE:${VERSION_STRACE}:"\ + -e "s:VERSION_UNIONFS_FUSE:${VERSION_UNIONFS_FUSE}:"\ + -e "s:VERSION_USERSPACE_RCU:${VERSION_USERSPACE_RCU}:"\ + -e "s:VERSION_UTIL_LINUX:${VERSION_UTIL_LINUX}:"\ + -e "s:VERSION_XFSPROGS:${VERSION_XFSPROGS}:"\ + -e "s:VERSION_ZLIB:${VERSION_ZLIB}:"\ + -e "s:VERSION_ZSTD:${VERSION_ZSTD}:"\ + "${S}"/defaults/software.sh \ + || die "Could not adjust versions" +} + +src_compile() { + if [[ ${PV} == 9999* ]] ; then + emake + fi +} + +src_install() { + insinto /etc + doins "${S}"/genkernel.conf + + doman genkernel.8 + dodoc AUTHORS ChangeLog README TODO + dobin genkernel + rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf + + if use ibm ; then + cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die + else + cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die + fi + + insinto /usr/share/genkernel + doins -r "${S}"/* + + fperms +x /usr/share/genkernel/gen_worker.sh + + newbashcomp "${FILESDIR}"/genkernel-4.bash "${PN}" + insinto /etc + doins "${FILESDIR}"/initramfs.mounts + + pushd "${DISTDIR}" &>/dev/null || die + insinto /usr/share/genkernel/distfiles + doins ${A/${P}.tar.xz/} + popd &>/dev/null || die +} + +pkg_postinst() { + # Wiki is out of date + #echo + #elog 'Documentation is available in the genkernel manual page' + #elog 'as well as the following URL:' + #echo + #elog 'https://wiki.gentoo.org/wiki/Genkernel' + #echo + + local replacing_version + for replacing_version in ${REPLACING_VERSIONS} ; do + if ver_test "${replacing_version}" -lt 4 ; then + # This is an upgrade which requires user review + + ewarn "" + ewarn "Genkernel v4.x is a new major release which touches" + ewarn "nearly everything. Be careful, read updated manpage" + ewarn "and pay special attention to program output regarding" + ewarn "changed kernel command-line parameters!" + + # Show this elog only once + break + fi + done + + # Show special warning for users depending on remote unlock capabilities + local gk_config="${EROOT%/}/etc/genkernel.conf" + if [[ -f "${gk_config}" ]] ; then + if grep -q -E "^SSH=[\"\']?yes" "${gk_config}" 2>/dev/null ; then + if ! grep -q dosshd /proc/cmdline 2>/dev/null ; then + ewarn "" + ewarn "IMPORTANT: SSH is currently enabled in your genkernel config" + ewarn "file (${gk_config}). However, 'dosshd' is missing from current" + ewarn "kernel command-line. You MUST add 'dosshd' to keep sshd enabled" + ewarn "in genkernel v4+ initramfs!" + fi + fi + + if grep -q -E "^CMD_CALLBACK=.*emerge.*@module-rebuild" "${gk_config}" 2>/dev/null ; then + elog "" + elog "Please remove 'emerge @module-rebuild' from genkernel config" + elog "file (${gk_config}) and make use of new MODULEREBUILD option" + elog "instead." + fi + fi +}