# Copyright 2010 Alex Elsayed # Copyright 2010 Brett Witherspoon # Distributed under the terms of the GNU General Public License v2 require systemd-service DOWNLOADS="mirror://kernel/linux/utils/boot/${PN}/${PNV}.tar.gz" export_exlib_phases src_prepare src_install SUMMARY="Dracut is a modular initramfs infrastructure." DESCRIPTION=" Unlike existing initramfs's, this is an attempt at having as little as possible hard-coded into the initramfs as possible. The initramfs has (basically) one purpose in life -- getting the rootfs mounted so that we can transition to the real rootfs. This is all driven off of device availability. Therefore, instead of scripts hard-coded to do various things, we depend on udev to create device nodes for us and then when we have the rootfs's device node, we mount and carry on. This helps to keep the time required in the initramfs as little as possible so that things like a 5 second boot aren't made impossible as a result of the very existence of an initramfs. It's likely that we'll grow some hooks for running arbitrary commands in the flow of the script, but it's worth trying to resist the urge as much as we can as hooks are guaranteed to be the path to slow-down. Also, there is an attempt to keep things as distribution-agnostic as possible. " HOMEPAGE="https://dracut.wiki.kernel.org/" UPSTREAM_DOCUMENTATION=" https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html [[ description = [ Manual ] lang = en ]] " LICENCES="GPL-2" SLOT="0" MYOPTIONS="" DEPENDENCIES=" build: app-doc/asciidoc app-text/docbook-xml-dtd:4.5 dev-libs/libxslt dev-util/elfutils sys-apps/kmod[>=23] run: app-shells/bash[>=4.0] virtual/pkg-config sys-apps/coreutils[xattr] sys-apps/util-linux[>=2.21] test: app-shells/dash recommendation: sys-boot/dracut-config-redcore [[ description = [ Redcore Linux Project dracut config ] ]] sys-process/procps [[ description = [ Required by the base module for pidof if not using busybox ] ]] suggestion: app-arch/pigz [[ description = [ Support parallel (de)compression via pigz ] ]] app-crypt/gnupg [[ description = [ Add support for GPG-encrypted keys to the crypt module ] ]] app-shells/dash [[ description = [ Support for dash as the initramfs shell ] ]] net-fs/cifs-utils [[ description = [ Required by the CIFS module for rootfs on CIFS ] ]] net-fs/nfs-utils [[ description = [ Required by the NFS module for rootfs on NFS ] group-name = [ dracut-nfs-module ] ]] net-misc/open-iscsi [[ description = [ Support for rootfs on iSCSI ] ]] net-nds/rpcbind [[ description = [ Reguired by the NFS module for rootfs on NFS ] group-name = [ dracut-nfs-module ] ]] sys-boot/plymouth [[ description = [ Provides boot splash support ] ]] sys-fs/btrfs-progs [[ description = [ Support for multi-device btrfs filesystems ] ]] sys-fs/cryptsetup [[ description = [ Support for an encrypted rootfs using dmcrypt ] ]] sys-fs/lvm2 [[ description = [ Support for LVM volumes and device-mapper partitions for various modules ] ]] sys-fs/multipath-tools [[ description = [ Support for rootfs on multipath devices ] ]] net-misc/bridge-utils [[ description = [ Required by the network boot module for brctl ] group-name = [ dracut-network-module ] ]] net-misc/dhcp [[ description = [ Required by the network boot module for dhclient ] group-name = [ dracut-network-module ] ]] net-misc/iputils [[ description = [ Required by the network boot and debug module for arping and ping ] group-name = [ dracut-network-module ] ]] sys-apps/iproute2 [[ description = [ Required by the network boot module for ip ] group-name = [ dracut-network-module ] ]] sys-apps/keyutils [[ description = [ Required by the masterkey, ecryptfs and integrity modules to decrypt keys ] ]] sys-apps/net-tools [[ description = [ Required by the iSCSI and debug module for hostname and netstat ] ]] sys-libs/libcap [[ description = [ Required by the caps module for initramfs which drops capabilities ] ]] virtual/syslog [[ description = [ Support for logging to a remote server with the syslog module ] ]] " # As broken as it gets - the tests even signal failure when they're just checking # for the file system type RESTRICT="test" # TODO # - Some modules need additional/unpackaged dependencies and testing. # See module-info.sh or module-setup.sh in the module directory, DEFAULT_SRC_PREPARE_PATCHES=( "${FILES}"/0001-base-dracut-lib.sh-dev_unit_name-guard-against-dev-b.patch "${FILES}"/0002-systemd-initrd-add-initrd-root-device.target.patch "${FILES}"/0003-50-dracut.install-use-bin-bash-shebang.patch "${FILES}"/0004-redcore-change-default-initramfs-name.patch "${FILES}"/0005-dracut-044-bash-4.4.patch "${FILES}"/0006-dracut-044-preserve-xattrs-when-copying.patch "${FILES}"/0007-dracut-044-backport-fix-for-microcode-loading.patch "${FILES}"/0008-dracut-044-ext4-and-f2fs-need-crc32X-too.patch "${FILES}"/0009-sort-fixup-creating-early-microcode.patch ) DEFAULT_SRC_CONFIGURE_PARAMS=( --bashcompletiondir=/usr/share/bash-completion/completions --systemdsystemunitdir="${SYSTEMDSYSTEMUNITDIR}" ) DEFAULT_SRC_INSTALL_PARAMS=( prefix=/usr libdir=/usr/$(exhost --target)/lib sysconfdir=/etc ) dracut_src_prepare() { default edo sed -i -e "s:HOST-\(strip\):$(exhost --target)-\1:g" dracut.sh # Dracut's "Test Matrix" requires root privileges and are excessive. # This disables them and only runs the syntax check with dash. edo sed -i -e '/$(MAKE) -C test check/d' Makefile # Fix libdir. edo sed -i -e "s:/lib\(/kernel/install.d\):/$(exhost --target)/lib\1:" Makefile # Remove modules that are not compatible with Exherbo. edo rm -r modules.d/45ifcfg } dracut_src_install() { export systemdsystemunitdir="${SYSTEMDSYSTEMUNITDIR}" default insinto /usr/share/doc/${PNVR}/html/ doins dracut.html dracut.png keepdir /etc/dracut.conf.d keepdir /usr/$(exhost --target)/lib/dracut/dracut.conf.d insinto /etc/logrotate.d/ newins dracut.logrotate dracut }