1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 # genkernel-9999 -> latest Git branch "master"
5 # genkernel-VERSION -> normal genkernel release
7 EAPI=5 # approved 2012.09.11, required by all profiles since 2014.03.12
9 inherit bash-completion-r1 epatch
11 VERSION_BUSYBOX='1.27.2' # warning, be sure to bump patches
12 VERSION_DMRAID='1.0.0.rc16-3' # warning, be sure to bump patches
13 VERSION_MDADM='4.0' # warning, be sure to bump patches
14 VERSION_FUSE='2.8.6' # warning, be sure to bump patches
15 VERSION_ISCSI='2.0-872' # warning, be sure to bump patches
16 VERSION_LVM='2.02.173' # warning, be sure to bump patches
17 VERSION_UNIONFS_FUSE='0.24'
20 RH_HOME="ftp://sourceware.org/pub"
21 DM_HOME="https://people.redhat.com/~heinzm/sw/dmraid/src"
22 BB_HOME="https://busybox.net/downloads"
24 COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
25 ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
26 https://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
27 ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
28 ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
29 ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
30 http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
31 mirror://gentoo/open-iscsi-${VERSION_ISCSI}.tar.gz
32 mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
33 http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
34 mirror://gentoo/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
35 mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
37 if [[ ${PV} == 9999* ]]
39 EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
42 SRC_URI="${COMMON_URI}"
44 SRC_URI="mirror://gentoo/${P}.tar.xz
46 KEYWORDS="~alpha amd64 arm arm64 ~hppa ia64 ~mips ppc ppc64 s390 sparc x86"
49 DESCRIPTION="Gentoo automatic kernel building scripts"
50 HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
55 IUSE="cryptsetup ibm +firmware selinux"
57 DEPEND="sys-fs/e2fsprogs
58 selinux? ( sys-libs/libselinux )"
60 cryptsetup? ( sys-fs/cryptsetup )
62 >=app-misc/pax-utils-1.2.2
63 sys-apps/util-linux[static-libs(+)]
64 firmware? ( sys-kernel/linux-firmware )
65 !<sys-apps/openrc-0.9.9"
66 # pax-utils is used for lddtree
68 if [[ ${PV} == 9999* ]]; then
69 DEPEND="${DEPEND} app-text/asciidoc"
73 if ! use cryptsetup && has_version "sys-kernel/genkernel[crypt]"; then
74 ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
75 ewarn "Please set flag 'cryptsetup' for this very package if you would like"
76 ewarn "to have genkernel create an initramfs with LUKS support."
77 ewarn "Sorry for the inconvenience."
83 if [[ ${PV} == 9999* ]] ; then
84 einfo "Updating version tag"
85 GK_V="$(git describe --tags | sed 's:^v::')-git"
86 sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
87 einfo "Producing ChangeLog from Git history..."
88 pushd "${S}/.git" >/dev/null || die
89 git log > "${S}"/ChangeLog || die
90 popd >/dev/null || die
93 sed -i 's/###//g' "${S}"/gen_compile.sh || die
98 -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
99 -e "s:VERSION_MDADM:$VERSION_MDADM:" \
100 -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
101 -e "s:VERSION_FUSE:$VERSION_FUSE:" \
102 -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
103 -e "s:VERSION_LVM:$VERSION_LVM:" \
104 -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
105 -e "s:VERSION_GPG:$VERSION_GPG:" \
106 "${S}"/defaults/software.sh \
107 || die "Could not adjust versions"
113 if [[ ${PV} == 9999* ]]; then
120 doins "${S}"/genkernel.conf
123 dodoc AUTHORS ChangeLog README TODO
125 rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
128 cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
130 cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
132 insinto /usr/share/genkernel
135 newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
137 doins "${FILESDIR}"/initramfs.mounts
140 insinto /usr/share/genkernel/distfiles
141 doins ${A/${P}.tar.xz/}
146 elog 'Documentation is available in the genkernel manual page'
147 elog 'as well as the following URL:'
149 elog 'https://wiki.gentoo.org/wiki/Genkernel'
151 ewarn "This package is known to not work with reiser4. If you are running"
152 ewarn "reiser4 and have a problem, do not file a bug. We know it does not"
153 ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
154 ewarn "broken in this regard. Try using a sane filesystem like ext4."
156 ewarn "The LUKS support has changed from versions prior to 3.4.4. Now,"
157 ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."