Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/dracut/
Date: Mon, 26 Aug 2019 20:49:59
Message-Id: 1566852531.f8104fa4f56b6e85e0ae20ffe885338c18db63bb.gyakovlev@gentoo
1 commit: f8104fa4f56b6e85e0ae20ffe885338c18db63bb
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 26 19:01:48 2019 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 26 20:48:51 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8104fa4
7
8 sys-kernel/dracut: revbump to allow installation without sysvinit
9
10 openrc-0.42.1 gained sysv-utils useflag, use it in dracut.
11 tested dracut initrd generated on sysvinit-less system, boots fine.
12
13 Reviewed-by: Patrick McLean <chutzpah <AT> gentoo.org>
14 Package-Manager: Portage-2.3.73, Repoman-2.3.17
15 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
16
17 sys-kernel/dracut/dracut-049-r2.ebuild | 157 +++++++++++++++++++++++++++++++++
18 1 file changed, 157 insertions(+)
19
20 diff --git a/sys-kernel/dracut/dracut-049-r2.ebuild b/sys-kernel/dracut/dracut-049-r2.ebuild
21 new file mode 100644
22 index 00000000000..872f2ff3a24
23 --- /dev/null
24 +++ b/sys-kernel/dracut/dracut-049-r2.ebuild
25 @@ -0,0 +1,157 @@
26 +# Copyright 1999-2019 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +
31 +inherit bash-completion-r1 eutils linux-info systemd toolchain-funcs
32 +
33 +if [[ ${PV} == 9999 ]] ; then
34 + inherit git-r3
35 + EGIT_REPO_URI="https://github.com/dracutdevs/dracut"
36 +else
37 + [[ "${PV}" = *_rc* ]] || \
38 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
39 + SRC_URI="https://github.com/dracutdevs/dracut/archive/${PV}.tar.gz -> ${P}.tar.gz"
40 +fi
41 +
42 +DESCRIPTION="Generic initramfs generation tool"
43 +HOMEPAGE="https://dracut.wiki.kernel.org"
44 +
45 +LICENSE="GPL-2"
46 +SLOT="0"
47 +IUSE="selinux"
48 +
49 +# Tests need root privileges, bug #298014
50 +RESTRICT="test"
51 +
52 +RDEPEND="
53 + app-arch/cpio
54 + >=app-shells/bash-4.0:0
55 + sys-apps/coreutils[xattr(-)]
56 + >=sys-apps/kmod-23[tools]
57 + || (
58 + >=sys-apps/sysvinit-2.87-r3
59 + sys-apps/openrc[sysv-utils,selinux?]
60 + sys-apps/systemd[sysv-utils]
61 + )
62 + >=sys-apps/util-linux-2.21
63 + virtual/pkgconfig
64 + virtual/udev
65 +
66 + selinux? (
67 + sec-policy/selinux-dracut
68 + sys-libs/libselinux
69 + sys-libs/libsepol
70 + )
71 + "
72 +DEPEND=">=sys-apps/kmod-23"
73 +
74 +BDEPEND="
75 + app-text/asciidoc
76 + app-text/docbook-xml-dtd:4.5
77 + >=app-text/docbook-xsl-stylesheets-1.75.2
78 + >=dev-libs/libxslt-1.1.26
79 + virtual/pkgconfig
80 + "
81 +
82 +DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
83 + README.testsuite TODO )
84 +
85 +QA_MULTILIB_PATHS="usr/lib/dracut/.*"
86 +
87 +PATCHES=(
88 + "${FILESDIR}"/048-dracut-install-simplify-ldd-parsing-logic.patch
89 + "${FILESDIR}"/049-40network-Don-t-include-40network-by-default.patch
90 + "${FILESDIR}"/049-remove-bashism-in-various-boot-scripts.patch
91 +)
92 +
93 +src_configure() {
94 + local myconf=(
95 + --prefix="${EPREFIX}/usr"
96 + --sysconfdir="${EPREFIX}/etc"
97 + --bashcompletiondir="$(get_bashcompdir)"
98 + --systemdsystemunitdir="$(systemd_get_systemunitdir)"
99 + )
100 +
101 + tc-export CC PKG_CONFIG
102 +
103 + echo ./configure "${myconf[@]}"
104 + ./configure "${myconf[@]}" || die
105 +
106 + if [[ ${PV} != 9999 ]] ; then
107 + # Source tarball from github doesn't include this file
108 + echo "DRACUT_VERSION=${PV}" > dracut-version.sh || die
109 + fi
110 +}
111 +
112 +src_install() {
113 + default
114 +
115 + insinto /etc/logrotate.d
116 + newins dracut.logrotate dracut
117 +
118 + docinto html
119 + dodoc dracut.html
120 +}
121 +
122 +pkg_postinst() {
123 + if linux-info_get_any_version && linux_config_exists; then
124 + ewarn ""
125 + ewarn "If the following test report contains a missing kernel"
126 + ewarn "configuration option, you should reconfigure and rebuild your"
127 + ewarn "kernel before booting image generated with this Dracut version."
128 + ewarn ""
129 +
130 + local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
131 +
132 + # Kernel configuration options descriptions:
133 + local ERROR_DEVTMPFS='CONFIG_DEVTMPFS: "Maintain a devtmpfs filesystem to mount at /dev" '
134 + ERROR_DEVTMPFS+='is missing and REQUIRED'
135 + local ERROR_BLK_DEV_INITRD='CONFIG_BLK_DEV_INITRD: "Initial RAM filesystem and RAM disk '
136 + ERROR_BLK_DEV_INITRD+='(initramfs/initrd) support" is missing and REQUIRED'
137 +
138 + check_extra_config
139 + echo
140 + else
141 + ewarn ""
142 + ewarn "Your kernel configuration couldn't be checked."
143 + ewarn "Please check manually if following options are enabled:"
144 + ewarn ""
145 + ewarn " CONFIG_BLK_DEV_INITRD"
146 + ewarn " CONFIG_DEVTMPFS"
147 + ewarn ""
148 + fi
149 +
150 + elog "To get additional features, a number of optional runtime"
151 + elog "dependencies may be installed:"
152 + elog ""
153 + optfeature "Networking support" net-misc/networkmanager
154 + optfeature "Legacy networking support" net-misc/curl "net-misc/dhcp[client]" \
155 + sys-apps/iproute2 "net-misc/iputils[arping]"
156 + optfeature \
157 + "Measure performance of the boot process for later visualisation" \
158 + app-benchmarks/bootchart2 app-admin/killproc sys-process/acct
159 + optfeature "Scan for Btrfs on block devices" sys-fs/btrfs-progs
160 + optfeature "Load kernel modules and drop this privilege for real init" \
161 + sys-libs/libcap
162 + optfeature "Support CIFS" net-fs/cifs-utils
163 + optfeature "Decrypt devices encrypted with cryptsetup/LUKS" \
164 + "sys-fs/cryptsetup[-static-libs]"
165 + optfeature "Support for GPG-encrypted keys for crypt module" \
166 + app-crypt/gnupg
167 + optfeature \
168 + "Allows use of dash instead of default bash (on your own risk)" \
169 + app-shells/dash
170 + optfeature "Support iSCSI" sys-block/open-iscsi
171 + optfeature "Support Logical Volume Manager" sys-fs/lvm2
172 + optfeature "Support MD devices, also known as software RAID devices" \
173 + sys-fs/mdadm
174 + optfeature "Support Device Mapper multipathing" sys-fs/multipath-tools
175 + optfeature "Plymouth boot splash" '>=sys-boot/plymouth-0.8.5-r5'
176 + optfeature "Support network block devices" sys-block/nbd
177 + optfeature "Support NFS" net-fs/nfs-utils net-nds/rpcbind
178 + optfeature \
179 + "Install ssh and scp along with config files and specified keys" \
180 + net-misc/openssh
181 + optfeature "Enable logging with rsyslog" app-admin/rsyslog
182 +}