Permalink
Browse files

FL-194: add support for mdadm in binary kernels, masked for testing

  • Loading branch information...
1 parent 7d02f28 commit 0f708e3805d91fa89fd3e0573dc4ef508e5c1aea @angryvincent angryvincent committed Dec 18, 2012
@@ -1,5 +1,12 @@
# Keep the most recent masks in a reverse chrono order
# newest on top
+# Oleg Vinichenko (18 Dec 2012)
+# FL-194, add mdadm support to binary kernels
+# maksed for testing genkernel and debians-ources, openvz-rhel6-stable kernels
+
+=sys-kernel/genkernel-3.4.40-r2
+=sys-kernel/debian-sources-3.2.29-r1
+=sys-kernel/openvz-rhel6-stable-2.6.32.042.065.3
# Oleg Vinichenko (5 Nov 2012)
# FL-213: avx fixes to glibc, test mask
@@ -0,0 +1,163 @@
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=3
+
+inherit eutils mount-boot
+
+SLOT=$PVR
+CKV=3.2.29
+KV_FULL=${PN}-${PVR}
+EXTRAVERSION=-1
+KERNEL_ARCHIVE="linux_${PV}.orig.tar.xz"
+PATCH_ARCHIVE="linux_${PV}${EXTRAVERSION}.debian.tar.xz"
+RESTRICT="binchecks strip mirror"
+# based on : http://packages.ubuntu.com/maverick/linux-image-2.6.35-22-server
+LICENSE="GPL-2"
+KEYWORDS="~*"
+IUSE="binary rt"
+DEPEND="binary? ( >=sys-kernel/genkernel-3.4.40-r2 )"
+RDEPEND="binary? ( >=sys-fs/udev-160 )"
+DESCRIPTION="Debian Sources (and optional binary kernel)"
+HOMEPAGE="http://www.debian.org"
+MAINPATCH="linux-2.6_${PV}${EXTRAVERSION}.diff.gz"
+SRC_URI="http://www.funtoo.org/distfiles/${PN}/${KERNEL_ARCHIVE}
+ http://www.funtoo.org/distfiles/${PN}//${PATCH_ARCHIVE}"
+S="$WORKDIR/linux-${CKV}"
+
+apply() {
+ p=$1; shift
+ case "${p##*.}" in
+ gz)
+ ca="gzip -dc"
+ ;;
+ bz2)
+ ca="bzip2 -dc"
+ ;;
+ xz)
+ ca="xz -dc"
+ ;;
+ *)
+ ca="cat"
+ ;;
+ esac
+ [ ! -e $p ] && die "patch $p not found"
+ echo "Applying patch $p"; $ca $p | patch $* || die "patch $p failed"
+}
+
+get_patch_list() {
+ [[ -z "${1}" ]] && die "No patch series file specified"
+ local patch_series="${1}"
+ while read line ; do
+ if [[ "${line:0:1}" != "#" ]] ; then
+ echo "${line}"
+ fi
+ done < "${patch_series}"
+}
+
+pkg_setup() {
+ export REAL_ARCH="$ARCH"
+ unset ARCH; unset LDFLAGS #will interfere with Makefile if set
+}
+
+src_prepare() {
+
+ cd ${S}
+ for debpatch in $( get_patch_list "${WORKDIR}/debian/patches/series" ); do
+ epatch -p1 "${WORKDIR}/debian/patches/${debpatch}"
+ done
+
+ if use rt ; then
+ for rtpatch in $( get_patch_list "${WORKDIR}/debian/patches/series-rt" ) ; do
+ epatch -p1 "${WORKDIR}/debian/patches/${rtpatch}"
+ done
+ fi
+
+ # end of debian-specific stuff...
+
+ sed -i -e "s:^\(EXTRAVERSION =\).*:\1 ${EXTRAVERSION}:" Makefile || die
+ sed -i -e 's:#export\tINSTALL_PATH:export\tINSTALL_PATH:' Makefile || die
+ rm -f .config >/dev/null
+ cp -a "${WORKDIR}"/debian "${T}"
+ make -s mrproper || die "make mrproper failed"
+ make -s include/linux/version.h || die "make include/linux/version.h failed"
+ cd ${S}
+ cp -aR "${WORKDIR}"/debian "${S}"/debian
+ local opts
+ use rt && opts="rt" || opts="standard"
+ local myarch="amd64"
+ [ "$REAL_ARCH" = "x86" ] && myarch="i386" && opts="$opts 686-pae"
+ cp ${FILESDIR}/config-extract . || die
+ chmod +x config-extract || die
+ ./config-extract ${myarch} ${opts} || die
+ cp .config ${T}/config || die
+ make -s mrproper || die "make mrproper failed"
+ make -s include/linux/version.h || die "make include/linux/version.h failed"
+}
+
+src_compile() {
+ ! use binary && return
+ install -d ${WORKDIR}/out/{lib,boot}
+ install -d ${T}/{cache,twork}
+ install -d $WORKDIR/build $WORKDIR/out/lib/firmware
+ genkernel \
+ --no-save-config \
+ --kernel-config="$T/config" \
+ --kernname="${PN}" \
+ --build-src="$S" \
+ --build-dst=${WORKDIR}/build \
+ --makeopts="${MAKEOPTS}" \
+ --firmware-dst=${WORKDIR}/out/lib/firmware \
+ --cachedir="${T}/cache" \
+ --tempdir="${T}/twork" \
+ --logfile="${WORKDIR}/genkernel.log" \
+ --bootdir="${WORKDIR}/out/boot" \
+ --lvm \
+ --luks \
+ --mdadm \
+ --iscsi \
+ --module-prefix="${WORKDIR}/out" \
+ all || die "genkernel failed"
+}
+
+src_install() {
+ # copy sources into place:
+ dodir /usr/src
+ cp -a ${S} ${D}/usr/src/linux-${P} || die
+ cd ${D}/usr/src/linux-${P}
+ # prepare for real-world use and 3rd-party module building:
+ make mrproper || die
+ cp ${T}/config .config || die
+ cp -a ${T}/debian debian || die
+ yes "" | make oldconfig || die
+ # if we didn't use genkernel, we're done. The kernel source tree is left in
+ # an unconfigured state - you can't compile 3rd-party modules against it yet.
+ use binary || return
+ make prepare || die
+ make scripts || die
+ # OK, now the source tree is configured to allow 3rd-party modules to be
+ # built against it, since we want that to work since we have a binary kernel
+ # built.
+ cp -a ${WORKDIR}/out/* ${D}/ || die "couldn't copy output files into place"
+ # module symlink fixup:
+ rm -f ${D}/lib/modules/*/source || die
+ rm -f ${D}/lib/modules/*/build || die
+ cd ${D}/lib/modules
+ # module strip:
+ find -iname *.ko -exec strip --strip-debug {} \;
+ # back to the symlink fixup:
+ local moddir="$(ls -d [23]*)"
+ ln -s /usr/src/linux-${P} ${D}/lib/modules/${moddir}/source || die
+ ln -s /usr/src/linux-${P} ${D}/lib/modules/${moddir}/build || die
+
+ # Fixes FL-14
+ cp "${WORKDIR}/build/System.map" "${D}/usr/src/linux-${P}/" || die
+ cp "${WORKDIR}/build/Module.symvers" "${D}/usr/src/linux-${P}/" || die
+
+}
+
+pkg_postinst() {
+ if [ ! -e ${ROOT}usr/src/linux ]
+ then
+ ln -s linux-${P} ${ROOT}usr/src/linux
+ fi
+}
@@ -17,6 +17,7 @@ DIST genkernel-v3.4.30_beta2-funtoo.tar.gz 290774 SHA256 130e3e6a257dc46fd8d09d1
DIST genkernel-v3.4.30_beta3-funtoo.tar.gz 290814 SHA256 11ad9d851cb5d0a4a00e2984b7ce157fdf442031a7611b746b7e391a488fff5f
DIST genkernel-v3.4.40-funtoo.tar.gz 292973 SHA256 c94b4df5d9dd8809a9098a23669e9220882c5559bffa575c990f89991135ad00
DIST genkernel-v3.4.40-r1-funtoo.tar.gz 292978 SHA256 a5e6f851e492d62045f534973e045f21fa6fd02c7e0d959b43a014b28f1b944b SHA512 97f97be0a800fab5491956fc3b36ebc67f2967e115c06992117286b4408219b81cd5823790ba483f88b6344dca207463b3fea413245c849cd5f473dafd640a36 WHIRLPOOL 1c90a58fadd78d79617f23fb11c62ac9331189ba340d3d9fb4cd9929ffa388a3c7ab6a679b49341be9a5177dca11dd4e792a0e503e87efbbf06e1c19ada44787
+DIST genkernel-v3.4.40-r2-funtoo.tar.gz 293109 SHA256 b261234e6072603e11e7bfeaea8820c8d06fc7f0fa9ce29b5ebc2df69ef88cf0 SHA512 2053f5b41d03a555eaa7f38109a0baa3283b081c573d58d70f2bd0d3af34d6fdbd6615a6bf455f1639da91aa3e7ce6e7324ca000ab00cff242b963b1f6565162 WHIRLPOOL 9617d17e684e8ae66cd7a4975b755ce0e6e9d2d0b6f8498ca8cf15c4091a0106a0e4dc462933e32f7e64b25800b660ad07b569a1e580939bb1b2aa68035b0ff5
DIST gnupg-1.4.11.tar.bz2 3407075 SHA256 d18ceeac16e554a501170b9bfde611625252d0fe9448685a69c93bf149ee6ef6 SHA512 97e7b8b0f972cc2f7cabdb0e013cbee1c33e7d48407d040cca5c2037e32abe1c2100194be7d3b569d4f05eb16b24c205a5b83f06718f0241f8d4ee174f1c37ae WHIRLPOOL 6f914627e2f527f6616e1f99d2ae06942b734f839d03a45ffa45bf67516a81d58f89e6a85612cf8e5fd83be04ab0b6bc2da8f81114143dad7523e5fcea62366b
DIST mdadm-3.1.4.tar.bz2 288578 SHA256 849ad0ad4ad3c1d2d8806a16b30e1f59ab2daf313cb103807207f7cba889ea63
DIST mdadm-3.1.5.tar.bz2 292709 SHA256 1d547d0b36a88968e9fc9fb08b0e64de54a53f3d1cfa3656a9f319180f0727d3 SHA512 6fcf426d63ede01f99ebeee9be686857a04f9b601b37f76722c091ae2999b3ff66fdba52d47323f27900553125a897fc1815fe7be850aa9cc991dd5fa91a5d5d WHIRLPOOL 003595a1338b3a95ccc176b07a31f26dd5fda9460f2c4d3513b9ca09cdab1c91dab05f8914f2354047fccff42c4dcfc6131a383c84467c2838ac7b1af2f9bef8
@@ -0,0 +1,163 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.40.ebuild,v 1.1 2012/07/27 23:41:01 sping Exp $
+
+# genkernel-9999 -> latest Git branch "master"
+# genkernel-VERSION -> normal genkernel release
+
+EAPI="3"
+
+VERSION_BUSYBOX='1.20.1'
+VERSION_DMRAID='1.0.0.rc16-3'
+VERSION_MDADM='3.1.5'
+VERSION_E2FSPROGS='1.42'
+VERSION_FUSE='2.8.6'
+VERSION_ISCSI='2.0-872'
+VERSION_UNIONFS_FUSE='0.24'
+VERSION_GPG='1.4.11'
+
+MY_HOME="http://www.funtoo.org/archive/${PN}"
+RH_HOME="ftp://sources.redhat.com/pub"
+DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src"
+BB_HOME="http://www.busybox.net/downloads"
+
+COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2
+ ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2
+ mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2
+ ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2
+ http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz
+ mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz
+ mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz
+ http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2
+ mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2"
+
+GITHUB_REPO="${PN}"
+GITHUB_USER="funtoo"
+GITHUB_TAG="v${PVR}-funtoo"
+
+if [[ ${PV} == 9999* ]]
+then
+ EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/${PN}.git
+ http://git.overlays.gentoo.org/gitroot/proj/${PN}.git"
+ inherit git-2 bash-completion-r1 eutils
+ S="${WORKDIR}/${PN}"
+ SRC_URI="${COMMON_URI}"
+ KEYWORDS=""
+else
+ inherit bash-completion-r1 eutils
+ SRC_URI="https://www.github.com/${GITHUB_USER}/${GITHUB_REPO}/tarball/${GITHUB_TAG} -> ${PN}-${GITHUB_TAG}.tar.gz
+ ${COMMON_URI}"
+ KEYWORDS="*"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="+cryptsetup ibm selinux"
+
+DEPEND="sys-fs/e2fsprogs
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+ cryptsetup? ( sys-fs/cryptsetup )
+ sys-fs/lvm2
+ sys-fs/mdadm
+ >=app-misc/pax-utils-0.2.1
+ !<sys-apps/openrc-0.9.9"
+# pax-utils is used for lddtree
+# cpio is part of Funtoo @system set
+
+if [[ ${PV} == 9999* ]]; then
+ DEPEND="${DEPEND} app-text/asciidoc"
+fi
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ git-2_src_unpack
+ else
+ default
+ fi
+}
+
+src_prepare() {
+ cd "${WORKDIR}"/${GITHUB_USER}-${PN}-*
+ S="$(pwd)"
+ use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh
+}
+
+src_compile() {
+ return
+}
+
+src_compile() {
+ if [[ ${PV} == 9999* ]]; then
+ emake || die
+ fi
+}
+
+src_install() {
+ # This block updates genkernel.conf
+ sed \
+ -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+ -e "s:VERSION_MDADM:$VERSION_MDADM:" \
+ -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \
+ -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \
+ -e "s:VERSION_FUSE:$VERSION_FUSE:" \
+ -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \
+ -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \
+ -e "s:VERSION_GPG:$VERSION_GPG:" \
+ "${S}"/genkernel.conf > "${T}"/genkernel.conf \
+ || die "Could not adjust versions"
+ insinto /etc
+ doins "${T}"/genkernel.conf || die "doins genkernel.conf"
+
+ doman genkernel.8 || die "doman"
+ dodoc AUTHORS ChangeLog README TODO || die "dodoc"
+
+ dobin genkernel || die "dobin genkernel"
+
+ rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
+
+ insinto /usr/share/genkernel
+ doins -r "${S}"/* || die "doins"
+ use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \
+ cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6
+
+ # Copy files to /var/cache/genkernel/src
+ elog "Copying files to /var/cache/genkernel/src..."
+ mkdir -p "${D}"/var/cache/genkernel/src
+ cp -f \
+ "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \
+ "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \
+ "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \
+ "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \
+ "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \
+ "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \
+ "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \
+ "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \
+ "${D}"/var/cache/genkernel/src || die "Copying distfiles..."
+
+ newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+ insinto /etc
+ doins "${FILESDIR}"/initramfs.mounts
+}
+
+pkg_postinst() {
+ echo
+ elog 'Documentation is available in the genkernel manual page'
+ elog 'as well as the following URL:'
+ echo
+ elog 'http://www.gentoo.org/doc/en/genkernel.xml'
+ echo
+ ewarn "This package is known to not work with reiser4. If you are running"
+ ewarn "reiser4 and have a problem, do not file a bug. We know it does not"
+ ewarn "work and we don't plan on fixing it since reiser4 is the one that is"
+ ewarn "broken in this regard. Try using a sane filesystem like ext3 or"
+ ewarn "even reiser3."
+ echo
+ ewarn "The LUKS support has changed from versions prior to 3.4.4. Now,"
+ ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah."
+ echo
+}
Oops, something went wrong.

0 comments on commit 0f708e3

Please sign in to comment.