summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Erculiani <lxnay@gentoo.org>2013-05-08 05:54:55 +0000
committerFabio Erculiani <lxnay@gentoo.org>2013-05-08 05:54:55 +0000
commit46106b1a23d73b7ca0057b419581068d04f48963 (patch)
treebaa91997465a03463aaa84f00895828d786890fa /sys-kernel
parentFix stupid mistake, causing the ebuild to die if the host doesn't provide /us... (diff)
downloadgentoo-2-46106b1a23d73b7ca0057b419581068d04f48963.tar.gz
gentoo-2-46106b1a23d73b7ca0057b419581068d04f48963.tar.bz2
gentoo-2-46106b1a23d73b7ca0057b419581068d04f48963.zip
new ebuild, ported from systemd-love
(Portage version: 2.2.0_alpha166/cvs/Linux x86_64, signed Manifest commit with key ADC916E5)
Diffstat (limited to 'sys-kernel')
-rw-r--r--sys-kernel/genkernel-next/ChangeLog10
-rw-r--r--sys-kernel/genkernel-next/files/genkernel.bash73
-rw-r--r--sys-kernel/genkernel-next/files/initramfs.mounts23
-rw-r--r--sys-kernel/genkernel-next/genkernel-next-7.ebuild105
-rw-r--r--sys-kernel/genkernel-next/metadata.xml11
5 files changed, 222 insertions, 0 deletions
diff --git a/sys-kernel/genkernel-next/ChangeLog b/sys-kernel/genkernel-next/ChangeLog
new file mode 100644
index 000000000000..9a66172b1fea
--- /dev/null
+++ b/sys-kernel/genkernel-next/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for sys-kernel/genkernel-next
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel-next/ChangeLog,v 1.1 2013/05/08 05:54:54 lxnay Exp $
+
+*genkernel-next-7 (08 May 2013)
+
+ 08 May 2013; Fabio Erculiani <lxnay@gentoo.org> +genkernel-next-7.ebuild,
+ +files/genkernel.bash, +files/initramfs.mounts, +metadata.xml:
+ new ebuild, ported from systemd-love
+
diff --git a/sys-kernel/genkernel-next/files/genkernel.bash b/sys-kernel/genkernel-next/files/genkernel.bash
new file mode 100644
index 000000000000..965ec2257f19
--- /dev/null
+++ b/sys-kernel/genkernel-next/files/genkernel.bash
@@ -0,0 +1,73 @@
+# genkernel (8) completion
+# Copyright 2006-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Written by Aron Griffis <agriffis@gentoo.org>
+
+_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)
+ 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" ;;
+ ('<outfile>'|'<file>') compgen -A file -o plusdirs -- "$rhs" ;;
+ ('<dir>') compgen -A directory -S / -- "$rhs" ;;
+ ('<tbz2>') compgen -G '*.tbz2' -G '*.tar.bz2' -o plusdirs -- "$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-next/files/initramfs.mounts b/sys-kernel/genkernel-next/files/initramfs.mounts
new file mode 100644
index 000000000000..b34c67502307
--- /dev/null
+++ b/sys-kernel/genkernel-next/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-next/genkernel-next-7.ebuild b/sys-kernel/genkernel-next/genkernel-next-7.ebuild
new file mode 100644
index 000000000000..c3f2b705c68f
--- /dev/null
+++ b/sys-kernel/genkernel-next/genkernel-next-7.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel-next/genkernel-next-7.ebuild,v 1.1 2013/05/08 05:54:54 lxnay Exp $
+
+EAPI=5
+
+if [[ "${PV}" != "9999" ]]; then
+ SRC_URI="http://dev.gentoo.org/~lxnay/genkernel-next/${P}.tar.xz"
+else
+ EGIT_COMMIT="v${PV}"
+ EGIT_REPO_URI="git://github.com/Sabayon/genkernel-next.git"
+ inherit git-2
+fi
+inherit bash-completion-r1 eutils
+
+VERSION_BUSYBOX="1.20.2"
+
+SRC_URI="${SRC_URI} http://www.busybox.net/downloads/busybox-${VERSION_BUSYBOX}.tar.bz2"
+if [[ "${PV}" == "9999" ]]; then
+ KEYWORDS=""
+else
+ KEYWORDS="~amd64 ~arm ~x86"
+fi
+
+DESCRIPTION="Gentoo automatic kernel building scripts ('next' branch)"
+HOMEPAGE="http://www.gentoo.org"
+
+LICENSE="GPL-2"
+SLOT="0"
+RESTRICT=""
+IUSE="crypt cryptsetup ibm selinux" # Keep 'crypt' in to keep 'use crypt' below working!
+
+DEPEND="app-text/asciidoc
+ sys-fs/e2fsprogs
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="${DEPEND}
+ !sys-kernel/genkernel
+ cryptsetup? ( sys-fs/cryptsetup )
+ app-portage/portage-utils
+ app-arch/cpio
+ >=app-misc/pax-utils-0.2.1
+ !<sys-apps/openrc-0.9.9"
+
+src_prepare() {
+ use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh
+
+ # Update software.sh
+ sed -i \
+ -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \
+ "${S}"/defaults/software.sh \
+ || die "Could not adjust versions"
+
+ sed -i "/^GK_V=/ s:GK_V=.*:GK_V=${PV}:g" "${S}/genkernel" || \
+ die "Could not setup release"
+}
+
+src_install() {
+ insinto /etc
+ doins "${S}"/genkernel.conf || die "doins genkernel.conf"
+
+ doman genkernel.8 || die "doman"
+ dodoc AUTHORS 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}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \
+ "${D}"/var/cache/genkernel/src || die "Copying distfiles..."
+
+ newbashcomp "${FILESDIR}"/genkernel.bash "${PN}"
+ insinto /etc
+ doins "${FILESDIR}"/initramfs.mounts
+}
+
+pkg_postinst() {
+ elog 'You are using an EXPERIMENTAL version of genkernel called genkernel-next'
+ elog 'Actually, it is supposed to be more polished and reliable'
+ 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
+ if use crypt && ! use cryptsetup ; then
+ ewarn "Local use flag 'crypt' has been renamed to 'cryptsetup' (bug #414523)."
+ ewarn "Please set flag 'cryptsetup' for this very package if you would like"
+ ewarn "to have genkernel create an initramfs with LUKS support."
+ echo
+ fi
+
+ elog "Genkernel-Next depends on the following optional packages:"
+ elog "- app-crypt/gnupg: when called with --gpg"
+ elog "- sys-block/open-iscsi: when called with --iscsi"
+ elog "- sys-boot/plymouth: when called with --plymouth"
+ elog "- sys-fs/dmraid: when called with --dmraid"
+ elog "- sys-fs/lvm2: when called with --lvm"
+}
diff --git a/sys-kernel/genkernel-next/metadata.xml b/sys-kernel/genkernel-next/metadata.xml
new file mode 100644
index 000000000000..a7cc5acc9f8a
--- /dev/null
+++ b/sys-kernel/genkernel-next/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+
+<pkgmetadata>
+<maintainer>
+ <email>lxnay@gentoo.org</email>
+</maintainer>
+<use>
+ <flag name='cryptsetup'>Enable support for Luks disk enrcyption using <pkg>sys-fs/cryptsetup</pkg></flag>
+</use>
+</pkgmetadata>