1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # genkernel-9999 -> latest Git branch "master"
6 # genkernel-VERSION -> normal genkernel release
10 VERSION_BUSYBOX='1.20.2'
11 VERSION_DMRAID='1.0.0.rc16-3'
14 VERSION_ISCSI='2.0-872'
16 VERSION_UNIONFS_FUSE='0.24'
19 RH_HOME="ftp://sources.redhat.com/pub"
20 DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src"
21 BB_HOME="http://www.busybox.net/downloads"
23 COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
24 ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
25 mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2
26 ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz
27 ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz
28 ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
29 http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
30 mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
31 http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
32 mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
34 if [[ ${PV} == 9999* ]]
36 EGIT_REPO_URI="git://anongit.gentoo.org/proj/${PN}.git
37 http://anongit.gentoo.org/git/proj/${PN}.git"
38 inherit git-2 bash-completion-r1 eutils
40 SRC_URI="${COMMON_URI}"
41 KEYWORDS="alpha arm hppa ia64 ppc ppc64 s390 sh sparc"
43 inherit bash-completion-r1 eutils
44 SRC_URI="mirror://gentoo/${P}.tar.bz2
46 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
49 DESCRIPTION="Gentoo automatic kernel building scripts"
50 HOMEPAGE="https://www.gentoo.org"
55 IUSE="crypt cryptsetup ibm selinux" # Keep 'crypt' in to keep 'use crypt' below working!
57 DEPEND="sys-fs/e2fsprogs
58 selinux? ( sys-libs/libselinux )"
60 cryptsetup? ( sys-fs/cryptsetup )
62 >=app-misc/pax-utils-0.2.1
63 !<sys-apps/openrc-0.9.9"
64 # pax-utils is used for lddtree
66 if [[ ${PV} == 9999* ]]; then
67 DEPEND="${DEPEND} app-text/asciidoc"
71 if [[ ${PV} == 9999* ]] ; then
79 if [[ ${PV} == 9999* ]] ; then
80 einfo "Producing ChangeLog from Git history..."
81 pushd "${S}/.git" >/dev/null || die
82 git log > "${S}"/ChangeLog || die
83 popd >/dev/null || die
85 use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh
89 -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
90 -e "s:VERSION_MDADM:$VERSION_MDADM:" \
91 -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
92 -e "s:VERSION_FUSE:$VERSION_FUSE:" \
93 -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
94 -e "s:VERSION_LVM:$VERSION_LVM:" \
95 -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
96 -e "s:VERSION_GPG:$VERSION_GPG:" \
97 "${S}"/defaults/software.sh \
98 || die "Could not adjust versions"
100 # sparc doesn't need crosscompiler anymore
101 # remove this after >3.4.51.2
102 sed -i -e "s:^DEFAULT_KERNEL_CC:#DEFAULT_KERNEL_CC:g" \
103 "${S}"/arch/sparc64/config.sh \
104 || die "Could not remove sparc64 crosscompiler config"
110 if [[ ${PV} == 9999* ]]; then
117 doins "${S}"/genkernel.conf || die "doins genkernel.conf"
119 doman genkernel.8 || die "doman"
120 dodoc AUTHORS ChangeLog README TODO || die "dodoc"
122 dobin genkernel || die "dobin genkernel"
124 rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
126 insinto /usr/share/genkernel
127 doins -r "${S}"/* || die "doins"
128 use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \
129 cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6
131 # Copy files to /var/cache/genkernel/src
132 elog "Copying files to /var/cache/genkernel/src..."
133 mkdir -p "${D}"/var/cache/genkernel/src
135 "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \
136 "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \
137 "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \
138 "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \
139 "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \
140 "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \
141 "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \
142 "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \
143 "${D}"/var/cache/genkernel/src || die "Copying distfiles..."
145 newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
147 doins "${FILESDIR}"/initramfs.mounts
152 elog 'Documentation is available in the genkernel manual page'
153 elog 'as well as the following URL:'
155 elog 'https://www.gentoo.org/doc/en/genkernel.xml'
157 ewarn "This package is known to not work with reiser4. If you are running"
158 ewarn "reiser4 and have a problem, do not file a bug. We know it does not"
159 ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
160 ewarn "broken in this regard. Try using a sane filesystem like ext3 or"
161 ewarn "even reiser3."
163 ewarn "The LUKS support has changed from versions prior to 3.4.4. Now,"
164 ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
166 if use crypt && ! use cryptsetup ; then
167 ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
168 ewarn "Please set flag 'cryptsetup' for this very package if you would like"
169 ewarn "to have genkernel create an initramfs with LUKS support."
170 ewarn "Sorry for the inconvenience."