Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/genkernel/, sys-kernel/genkernel/files/
Date: Tue, 17 May 2022 20:16:27
Message-Id: 1652818574.32835a1e91593000cc89140c51e1833a80dae760.dilfridge@gentoo
1 commit: 32835a1e91593000cc89140c51e1833a80dae760
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 17 20:15:46 2022 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Tue May 17 20:16:14 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32835a1e
7
8 sys-kernel/genkernel: Revbump only for ia64, so we get an iso again
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
12
13 .../files/genkernel-4.2.6-devicemanager.patch | 72 +++++
14 sys-kernel/genkernel/genkernel-4.2.6-r3.ebuild | 319 +++++++++++++++++++++
15 2 files changed, 391 insertions(+)
16
17 diff --git a/sys-kernel/genkernel/files/genkernel-4.2.6-devicemanager.patch b/sys-kernel/genkernel/files/genkernel-4.2.6-devicemanager.patch
18 new file mode 100644
19 index 000000000000..f1c5787ed657
20 --- /dev/null
21 +++ b/sys-kernel/genkernel/files/genkernel-4.2.6-devicemanager.patch
22 @@ -0,0 +1,72 @@
23 +From 110cffbf0a10a6dabe902eecb9c139663ad737af Mon Sep 17 00:00:00 2001
24 +From: Mike Gilbert <floppym@g.o>
25 +Date: Sun, 15 May 2022 12:37:51 -0400
26 +Subject: [PATCH] gen_initramfs.sh: append devicemanager only for specific
27 + modules
28 +
29 +dmraid
30 +luks
31 +lvm
32 +multipath
33 +
34 +Bug: https://bugs.gentoo.org/749957
35 +Signed-off-by: Mike Gilbert <floppym@g.o>
36 +---
37 + gen_funcs.sh | 9 +++++++++
38 + gen_initramfs.sh | 11 +++++++----
39 + 2 files changed, 16 insertions(+), 4 deletions(-)
40 +
41 +diff --git a/gen_funcs.sh b/gen_funcs.sh
42 +index 500caf2..db396e3 100755
43 +--- a/gen_funcs.sh
44 ++++ b/gen_funcs.sh
45 +@@ -22,6 +22,15 @@ isTrue() {
46 + return 1
47 + }
48 +
49 ++anyTrue() {
50 ++ local x
51 ++ for x
52 ++ do
53 ++ isTrue "${x}" && return 0
54 ++ done
55 ++ return 1
56 ++}
57 ++
58 + set_color_vars() {
59 + if ! isTrue "${NOCOLOR}"
60 + then
61 +diff --git a/gen_initramfs.sh b/gen_initramfs.sh
62 +index 4ec296e..0b74f4c 100755
63 +--- a/gen_initramfs.sh
64 ++++ b/gen_initramfs.sh
65 +@@ -2007,11 +2007,14 @@ append_auxiliary() {
66 + }
67 +
68 + append_data() {
69 +- local name=$1 var=$2
70 ++ [ $# -eq 0 ] && gen_die "append_data() called with zero arguments"
71 ++
72 ++ local name=$1
73 + local func="append_${name}"
74 +
75 +- [ $# -eq 0 ] && gen_die "append_data() called with zero arguments"
76 +- if [ $# -eq 1 ] || isTrue "${var}"
77 ++ shift
78 ++
79 ++ if [ $# -eq 0 ] || anyTrue "$@"
80 + then
81 + print_info 1 "$(get_indent 1)>> Appending ${name} cpio data ..."
82 + ${func} || gen_die "${func}() failed!"
83 +@@ -2037,7 +2040,7 @@ create_initramfs() {
84 + append_data 'base_layout'
85 + append_data 'util-linux'
86 + append_data 'eudev'
87 +- append_data 'devicemanager'
88 ++ append_data 'devicemanager' "${DMRAID}" "${LVM}" "${LUKS}" "${MULTIPATH}"
89 + append_data 'auxiliary' "${BUSYBOX}"
90 + append_data 'busybox' "${BUSYBOX}"
91 + append_data 'b2sum' "${B2SUM}"
92 +--
93 +2.35.1
94 +
95
96 diff --git a/sys-kernel/genkernel/genkernel-4.2.6-r3.ebuild b/sys-kernel/genkernel/genkernel-4.2.6-r3.ebuild
97 new file mode 100644
98 index 000000000000..1c4c56cc5a82
99 --- /dev/null
100 +++ b/sys-kernel/genkernel/genkernel-4.2.6-r3.ebuild
101 @@ -0,0 +1,319 @@
102 +# Copyright 1999-2022 Gentoo Authors
103 +# Distributed under the terms of the GNU General Public License v2
104 +
105 +# genkernel-9999 -> latest Git branch "master"
106 +# genkernel-VERSION -> normal genkernel release
107 +
108 +EAPI="7"
109 +
110 +PYTHON_COMPAT=( python3_{7..10} )
111 +
112 +inherit bash-completion-r1 python-single-r1
113 +
114 +# Whenever you bump a GKPKG, check if you have to move
115 +# or add new patches!
116 +VERSION_BCACHE_TOOLS="1.0.8_p20141204"
117 +VERSION_BOOST="1.76.0"
118 +VERSION_BTRFS_PROGS="5.15"
119 +VERSION_BUSYBOX="1.34.1"
120 +VERSION_COREUTILS="8.32"
121 +VERSION_CRYPTSETUP="2.4.1"
122 +VERSION_DMRAID="1.0.0.rc16-3"
123 +VERSION_DROPBEAR="2020.81"
124 +VERSION_EUDEV="3.2.10"
125 +VERSION_EXPAT="2.4.1"
126 +VERSION_E2FSPROGS="1.46.4"
127 +VERSION_FUSE="2.9.9"
128 +VERSION_GPG="1.4.23"
129 +VERSION_HWIDS="20210613"
130 +VERSION_ISCSI="2.0.878"
131 +VERSION_JSON_C="0.13.1"
132 +VERSION_KMOD="29"
133 +VERSION_LIBAIO="0.3.112"
134 +VERSION_LIBGCRYPT="1.9.4"
135 +VERSION_LIBGPGERROR="1.43"
136 +VERSION_LIBXCRYPT="4.4.26"
137 +VERSION_LVM="2.02.188"
138 +VERSION_LZO="2.10"
139 +VERSION_MDADM="4.1"
140 +VERSION_POPT="1.18"
141 +VERSION_STRACE="5.14"
142 +VERSION_THIN_PROVISIONING_TOOLS="0.9.0"
143 +VERSION_UNIONFS_FUSE="2.0"
144 +VERSION_UTIL_LINUX="2.37.2"
145 +VERSION_XFSPROGS="5.13.0"
146 +VERSION_XZ="5.2.5"
147 +VERSION_ZLIB="1.2.11"
148 +VERSION_ZSTD="1.5.0"
149 +
150 +COMMON_URI="
151 + https://github.com/g2p/bcache-tools/archive/399021549984ad27bf4a13ae85e458833fe003d7.tar.gz -> bcache-tools-${VERSION_BCACHE_TOOLS}.tar.gz
152 + https://boostorg.jfrog.io/artifactory/main/release/${VERSION_BOOST}/source/boost_${VERSION_BOOST//./_}.tar.bz2
153 + https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${VERSION_BTRFS_PROGS}.tar.xz
154 + https://www.busybox.net/downloads/busybox-${VERSION_BUSYBOX}.tar.bz2
155 + mirror://gnu/coreutils/coreutils-${VERSION_COREUTILS}.tar.xz
156 + https://www.kernel.org/pub/linux/utils/cryptsetup/v$(ver_cut 1-2 ${VERSION_CRYPTSETUP})/cryptsetup-${VERSION_CRYPTSETUP}.tar.xz
157 + https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-${VERSION_DMRAID}.tar.bz2
158 + https://matt.ucc.asn.au/dropbear/releases/dropbear-${VERSION_DROPBEAR}.tar.bz2
159 + https://dev.gentoo.org/~blueness/eudev/eudev-${VERSION_EUDEV}.tar.gz
160 + https://github.com/libexpat/libexpat/releases/download/R_${VERSION_EXPAT//\./_}/expat-${VERSION_EXPAT}.tar.xz
161 + https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v${VERSION_E2FSPROGS}/e2fsprogs-${VERSION_E2FSPROGS}.tar.xz
162 + https://github.com/libfuse/libfuse/releases/download/fuse-${VERSION_FUSE}/fuse-${VERSION_FUSE}.tar.gz
163 + mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2
164 + https://github.com/gentoo/hwids/archive/hwids-${VERSION_HWIDS}.tar.gz
165 + https://github.com/open-iscsi/open-iscsi/archive/${VERSION_ISCSI}.tar.gz -> open-iscsi-${VERSION_ISCSI}.tar.gz
166 + https://s3.amazonaws.com/json-c_releases/releases/json-c-${VERSION_JSON_C}.tar.gz
167 + https://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-${VERSION_KMOD}.tar.xz
168 + https://releases.pagure.org/libaio/libaio-${VERSION_LIBAIO}.tar.gz
169 + mirror://gnupg/libgcrypt/libgcrypt-${VERSION_LIBGCRYPT}.tar.bz2
170 + mirror://gnupg/libgpg-error/libgpg-error-${VERSION_LIBGPGERROR}.tar.bz2
171 + https://github.com/besser82/libxcrypt/archive/v${VERSION_LIBXCRYPT}.tar.gz -> libxcrypt-${VERSION_LIBXCRYPT}.tar.gz
172 + https://mirrors.kernel.org/sourceware/lvm2/LVM2.${VERSION_LVM}.tgz
173 + https://www.oberhumer.com/opensource/lzo/download/lzo-${VERSION_LZO}.tar.gz
174 + https://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.xz
175 + http://ftp.rpm.org/popt/releases/popt-1.x/popt-${VERSION_POPT}.tar.gz
176 + https://github.com/strace/strace/releases/download/v${VERSION_STRACE}/strace-${VERSION_STRACE}.tar.xz
177 + https://github.com/jthornber/thin-provisioning-tools/archive/v${VERSION_THIN_PROVISIONING_TOOLS}.tar.gz -> thin-provisioning-tools-${VERSION_THIN_PROVISIONING_TOOLS}.tar.gz
178 + https://github.com/rpodgorny/unionfs-fuse/archive/v${VERSION_UNIONFS_FUSE}.tar.gz -> unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.gz
179 + https://www.kernel.org/pub/linux/utils/util-linux/v${VERSION_UTIL_LINUX:0:4}/util-linux-${VERSION_UTIL_LINUX}.tar.xz
180 + https://www.kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-${VERSION_XFSPROGS}.tar.xz
181 + https://tukaani.org/xz/xz-${VERSION_XZ}.tar.gz
182 + https://zlib.net/zlib-${VERSION_ZLIB}.tar.gz
183 + https://github.com/facebook/zstd/archive/v${VERSION_ZSTD}.tar.gz -> zstd-${VERSION_ZSTD}.tar.gz
184 +"
185 +
186 +if [[ ${PV} == 9999* ]] ; then
187 + EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git"
188 + inherit git-r3
189 + S="${WORKDIR}/${P}"
190 + SRC_URI="${COMMON_URI}"
191 +else
192 + SRC_URI="https://dev.gentoo.org/~whissi/dist/genkernel/${P}.tar.xz
193 + ${COMMON_URI}"
194 + KEYWORDS="~ia64"
195 +fi
196 +
197 +DESCRIPTION="Gentoo automatic kernel building scripts"
198 +HOMEPAGE="https://wiki.gentoo.org/wiki/Genkernel https://gitweb.gentoo.org/proj/genkernel.git/"
199 +
200 +LICENSE="GPL-2"
201 +SLOT="0"
202 +RESTRICT=""
203 +IUSE="ibm +firmware"
204 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
205 +
206 +# Note:
207 +# We need sys-devel/* deps like autoconf or automake at _runtime_
208 +# because genkernel will usually build things like LVM2, cryptsetup,
209 +# mdadm... during initramfs generation which will require these
210 +# things.
211 +DEPEND=""
212 +RDEPEND="${PYTHON_DEPS}
213 + app-arch/cpio
214 + >=app-misc/pax-utils-1.2.2
215 + app-portage/elt-patches
216 + dev-util/gperf
217 + sys-apps/sandbox
218 + sys-devel/autoconf
219 + sys-devel/autoconf-archive
220 + sys-devel/automake
221 + sys-devel/libtool
222 + virtual/pkgconfig
223 + elibc_glibc? ( sys-libs/glibc[static-libs(+)] )
224 + firmware? ( sys-kernel/linux-firmware )"
225 +
226 +if [[ ${PV} == 9999* ]]; then
227 + DEPEND="${DEPEND} app-text/asciidoc"
228 +fi
229 +
230 +PATCHES=(
231 + "${FILESDIR}"/${P}-devicemanager.patch
232 + "${FILESDIR}"/${P}-fix-btrfs-progs-deps.patch
233 + "${FILESDIR}"/${P}-fuse-glibc-2.34.patch
234 +)
235 +
236 +src_unpack() {
237 + if [[ ${PV} == 9999* ]]; then
238 + git-r3_src_unpack
239 + else
240 + local gk_src_file
241 + for gk_src_file in ${A} ; do
242 + if [[ ${gk_src_file} == genkernel-* ]] ; then
243 + unpack "${gk_src_file}"
244 + fi
245 + done
246 + fi
247 +}
248 +
249 +src_prepare() {
250 + default
251 +
252 + if [[ ${PV} == 9999* ]] ; then
253 + einfo "Updating version tag"
254 + GK_V="$(git describe --tags | sed 's:^v::')-git"
255 + sed "/^GK_V/s,=.*,='${GK_V}',g" -i "${S}"/genkernel
256 + einfo "Producing ChangeLog from Git history..."
257 + pushd "${S}/.git" >/dev/null || die
258 + git log > "${S}"/ChangeLog || die
259 + popd >/dev/null || die
260 + fi
261 +
262 + # Update software.sh
263 + sed -i \
264 + -e "s:VERSION_BCACHE_TOOLS:${VERSION_BCACHE_TOOLS}:"\
265 + -e "s:VERSION_BOOST:${VERSION_BOOST}:"\
266 + -e "s:VERSION_BTRFS_PROGS:${VERSION_BTRFS_PROGS}:"\
267 + -e "s:VERSION_BUSYBOX:${VERSION_BUSYBOX}:"\
268 + -e "s:VERSION_COREUTILS:${VERSION_COREUTILS}:"\
269 + -e "s:VERSION_CRYPTSETUP:${VERSION_CRYPTSETUP}:"\
270 + -e "s:VERSION_DMRAID:${VERSION_DMRAID}:"\
271 + -e "s:VERSION_DROPBEAR:${VERSION_DROPBEAR}:"\
272 + -e "s:VERSION_EUDEV:${VERSION_EUDEV}:"\
273 + -e "s:VERSION_EXPAT:${VERSION_EXPAT}:"\
274 + -e "s:VERSION_E2FSPROGS:${VERSION_E2FSPROGS}:"\
275 + -e "s:VERSION_FUSE:${VERSION_FUSE}:"\
276 + -e "s:VERSION_GPG:${VERSION_GPG}:"\
277 + -e "s:VERSION_HWIDS:${VERSION_HWIDS}:"\
278 + -e "s:VERSION_ISCSI:${VERSION_ISCSI}:"\
279 + -e "s:VERSION_JSON_C:${VERSION_JSON_C}:"\
280 + -e "s:VERSION_KMOD:${VERSION_KMOD}:"\
281 + -e "s:VERSION_LIBAIO:${VERSION_LIBAIO}:"\
282 + -e "s:VERSION_LIBGCRYPT:${VERSION_LIBGCRYPT}:"\
283 + -e "s:VERSION_LIBGPGERROR:${VERSION_LIBGPGERROR}:"\
284 + -e "s:VERSION_LIBXCRYPT:${VERSION_LIBXCRYPT}:"\
285 + -e "s:VERSION_LVM:${VERSION_LVM}:"\
286 + -e "s:VERSION_LZO:${VERSION_LZO}:"\
287 + -e "s:VERSION_MDADM:${VERSION_MDADM}:"\
288 + -e "s:VERSION_MULTIPATH_TOOLS:${VERSION_MULTIPATH_TOOLS}:"\
289 + -e "s:VERSION_POPT:${VERSION_POPT}:"\
290 + -e "s:VERSION_STRACE:${VERSION_STRACE}:"\
291 + -e "s:VERSION_THIN_PROVISIONING_TOOLS:${VERSION_THIN_PROVISIONING_TOOLS}:"\
292 + -e "s:VERSION_UNIONFS_FUSE:${VERSION_UNIONFS_FUSE}:"\
293 + -e "s:VERSION_USERSPACE_RCU:${VERSION_USERSPACE_RCU}:"\
294 + -e "s:VERSION_UTIL_LINUX:${VERSION_UTIL_LINUX}:"\
295 + -e "s:VERSION_XFSPROGS:${VERSION_XFSPROGS}:"\
296 + -e "s:VERSION_XZ:${VERSION_XZ}:"\
297 + -e "s:VERSION_ZLIB:${VERSION_ZLIB}:"\
298 + -e "s:VERSION_ZSTD:${VERSION_ZSTD}:"\
299 + "${S}"/defaults/software.sh \
300 + || die "Could not adjust versions"
301 +}
302 +
303 +src_compile() {
304 + if [[ ${PV} == 9999* ]] ; then
305 + emake
306 + fi
307 +}
308 +
309 +src_install() {
310 + insinto /etc
311 + doins "${S}"/genkernel.conf
312 +
313 + doman genkernel.8
314 + dodoc AUTHORS ChangeLog README TODO
315 + dobin genkernel
316 + rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf
317 +
318 + if use ibm ; then
319 + cp "${S}"/arch/ppc64/kernel-2.6{-pSeries,} || die
320 + else
321 + cp "${S}"/arch/ppc64/kernel-2.6{.g5,} || die
322 + fi
323 +
324 + insinto /usr/share/genkernel
325 + doins -r "${S}"/*
326 +
327 + fperms +x /usr/share/genkernel/gen_worker.sh
328 + fperms +x /usr/share/genkernel/path_expander.py
329 +
330 + python_fix_shebang "${ED}"/usr/share/genkernel/path_expander.py
331 +
332 + newbashcomp "${FILESDIR}"/genkernel-4.bash "${PN}"
333 + insinto /etc
334 + doins "${FILESDIR}"/initramfs.mounts
335 +
336 + pushd "${DISTDIR}" &>/dev/null || die
337 + insinto /usr/share/genkernel/distfiles
338 + doins ${A/${P}.tar.xz/}
339 + popd &>/dev/null || die
340 +}
341 +
342 +pkg_postinst() {
343 + # Wiki is out of date
344 + #echo
345 + #elog 'Documentation is available in the genkernel manual page'
346 + #elog 'as well as the following URL:'
347 + #echo
348 + #elog 'https://wiki.gentoo.org/wiki/Genkernel'
349 + #echo
350 +
351 + local replacing_version
352 + for replacing_version in ${REPLACING_VERSIONS} ; do
353 + if ver_test "${replacing_version}" -lt 4 ; then
354 + # This is an upgrade which requires user review
355 +
356 + ewarn ""
357 + ewarn "Genkernel v4.x is a new major release which touches"
358 + ewarn "nearly everything. Be careful, read updated manpage"
359 + ewarn "and pay special attention to program output regarding"
360 + ewarn "changed kernel command-line parameters!"
361 +
362 + # Show this elog only once
363 + break
364 + fi
365 + done
366 +
367 + if [[ $(find /boot -name 'kernel-genkernel-*' 2>/dev/null | wc -l) -gt 0 ]] ; then
368 + ewarn ''
369 + ewarn 'Default kernel filename was changed from "kernel-genkernel-<ARCH>-<KV>"'
370 + ewarn 'to "vmlinuz-<KV>". Please be aware that due to lexical ordering the'
371 + ewarn '*default* boot entry in your boot manager could still point to last kernel'
372 + ewarn 'built with genkernel before that name change, resulting in booting old'
373 + ewarn 'kernel when not paying attention on boot.'
374 + fi
375 +
376 + # Show special warning for users depending on remote unlock capabilities
377 + local gk_config="${EROOT}/etc/genkernel.conf"
378 + if [[ -f "${gk_config}" ]] ; then
379 + if grep -q -E "^SSH=[\"\']?yes" "${gk_config}" 2>/dev/null ; then
380 + if ! grep -q dosshd /proc/cmdline 2>/dev/null ; then
381 + ewarn ""
382 + ewarn "IMPORTANT: SSH is currently enabled in your genkernel config"
383 + ewarn "file (${gk_config}). However, 'dosshd' is missing from current"
384 + ewarn "kernel command-line. You MUST add 'dosshd' to keep sshd enabled"
385 + ewarn "in genkernel v4+ initramfs!"
386 + fi
387 + fi
388 +
389 + if grep -q -E "^CMD_CALLBACK=.*emerge.*@module-rebuild" "${gk_config}" 2>/dev/null ; then
390 + elog ""
391 + elog "Please remove 'emerge @module-rebuild' from genkernel config"
392 + elog "file (${gk_config}) and make use of new MODULEREBUILD option"
393 + elog "instead."
394 + fi
395 + fi
396 +
397 + local n_root_args=$(grep -o -- '\<root=' /proc/cmdline 2>/dev/null | wc -l)
398 + if [[ ${n_root_args} -gt 1 ]] ; then
399 + ewarn "WARNING: Multiple root arguments (root=) on kernel command-line detected!"
400 + ewarn "If you are appending non-persistent device names to kernel command-line,"
401 + ewarn "next reboot could fail in case running system and initramfs do not agree"
402 + ewarn "on detected root device name!"
403 + fi
404 +
405 + if [[ -d /run ]] ; then
406 + local permission_run_expected="drwxr-xr-x"
407 + local permission_run=$(stat -c "%A" /run)
408 + if [[ "${permission_run}" != "${permission_run_expected}" ]] ; then
409 + ewarn "Found the following problematic permissions:"
410 + ewarn ""
411 + ewarn " ${permission_run} /run"
412 + ewarn ""
413 + ewarn "Expected:"
414 + ewarn ""
415 + ewarn " ${permission_run_expected} /run"
416 + ewarn ""
417 + ewarn "This is known to be causing problems for any UDEV-enabled service."
418 + fi
419 + fi
420 +}