Gentoo Archives: gentoo-commits

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