summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/dracut/dracut-004.ebuild')
-rw-r--r--sys-kernel/dracut/dracut-004.ebuild77
1 files changed, 77 insertions, 0 deletions
diff --git a/sys-kernel/dracut/dracut-004.ebuild b/sys-kernel/dracut/dracut-004.ebuild
new file mode 100644
index 000000000000..29cb3b975f5e
--- /dev/null
+++ b/sys-kernel/dracut/dracut-004.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/dracut-004.ebuild,v 1.1 2010/02/02 16:32:32 ramereth Exp $
+
+EAPI=2
+
+inherit mount-boot
+
+DESCRIPTION="Generic initramfs generation tool"
+HOMEPAGE="http://sourceforge.net/projects/dracut/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="crypt dmraid iscsi lvm nbd nfs md selinux"
+
+# common networking deps
+NETWORK_DEPS="sys-apps/iproute2 net-misc/dhcp net-misc/bridge-utils"
+
+RDEPEND="app-shells/dash
+ >=sys-apps/module-init-tools-3.6
+ >=sys-apps/util-linux-2.16
+ crypt? ( sys-fs/cryptsetup )
+ dmraid? ( sys-fs/dmraid )
+ lvm? ( >=sys-fs/lvm2-2.02.33 )
+ md? ( sys-fs/mdadm )
+ nfs? ( net-fs/nfs-utils net-nds/rpcbind ${NETWORK_DEPS} )
+ iscsi? ( sys-block/open-iscsi[utils] ${NETWORK_DEPS} )
+ nbd? ( sys-block/nbd ${NETWORK_DEPS} )
+ selinux? ( sys-libs/libselinux sys-libs/libsepol )"
+DEPEND="${RDEPEND}"
+
+src_compile() {
+ emake WITH_SWITCH_ROOT=0 prefix=/usr sysconfdir=/etc || die "emake failed"
+}
+
+src_install() {
+ local modules_dir="${D}/usr/share/dracut/modules.d"
+
+ emake WITH_SWITCH_ROOT=0 \
+ prefix=/usr sysconfdir=/etc \
+ DESTDIR="${D}" install || die "emake install failed"
+ echo "${PF}" > "${modules_dir}"/10rpmversion/dracut-version
+ dodir /boot/dracut /var/lib/dracut/overlay
+ dodoc HACKING TODO AUTHORS NEWS README*
+ # disable modules not enabled by use flags
+ for module in crypt dmraid lvm md ; do
+ ! use ${module} && rm -rf ${modules_dir}/90${module}
+ done
+ # disable all network modules
+ for module in iscsi nbd nfs ; do
+ ! use ${module} && rm -rf ${modules_dir}/95${module}
+ done
+ # if no networking at all, disable the rest
+ if ! use iscsi && ! use nbd && ! use nfs ; then
+ rm -rf ${modules_dir}/40network
+ rm -rf ${modules_dir}/95fcoe
+ fi
+}
+
+pkg_postinst() {
+ elog 'To generate the initramfs:'
+ elog ' # mount /boot (if necessary)'
+ elog ' # dracut "" <kernel-version>'
+ elog ''
+ elog 'For command line documentation, see:'
+ elog 'http://sourceforge.net/apps/trac/dracut/wiki/commandline'
+ elog ''
+ elog 'Simple example to select root and resume partition:'
+ elog ' root=/dev/???? resume=/dev/????'
+ elog ''
+ elog 'Configuration is in /etc/dracut.conf.'
+ elog 'The default config is very minimal and is highly recommended you'
+ elog 'adjust based on your needs. To include only drivers for this system,'
+ elog 'use the "-H" option.'
+}