Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 2/2] kernel-install.eclass: Warn about linux-firmware in pkg_pretend()
Date: Wed, 17 Jun 2020 10:27:45
Message-Id: 20200617102641.448098-2-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/2] kernel-install.eclass: Add pkg_config() to reinstall by "Michał Górny"
1 Signed-off-by: Michał Górny <mgorny@g.o>
2 ---
3 eclass/kernel-install.eclass | 25 ++++++++++++++++++++++++-
4 1 file changed, 24 insertions(+), 1 deletion(-)
5
6 diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
7 index b3ef186a74eb..8065a8f5638e 100644
8 --- a/eclass/kernel-install.eclass
9 +++ b/eclass/kernel-install.eclass
10 @@ -260,6 +260,29 @@ kernel-install_test() {
11 EOF
12 }
13
14 +# @FUNCTION: kernel-install_pkg_pretend
15 +# @DESCRIPTION:
16 +# Check for missing optional dependencies and output warnings.
17 +kernel-install_pkg_pretend() {
18 + debug-print-function ${FUNCNAME} "${@}"
19 +
20 + if ! has_version -d sys-kernel/linux-firmware; then
21 + ewarn "sys-kernel/linux-firmware not found installed on your system."
22 + ewarn "This package provides various firmware files that may be needed"
23 + ewarn "for your hardware to work. If in doubt, it is recommended"
24 + ewarn "to pause or abort the build process and install it before"
25 + ewarn "resuming."
26 +
27 + if use initramfs; then
28 + elog
29 + elog "If you decide to install linux-firmware later, you can rebuild"
30 + elog "the initramfs via issuing a command equivalent to:"
31 + elog
32 + elog " emerge --config ${CATEGORY}/${PN}"
33 + fi
34 + fi
35 +}
36 +
37 # @FUNCTION: kernel-install_src_test
38 # @DESCRIPTION:
39 # Boilerplate function to remind people to call the tests.
40 @@ -356,4 +379,4 @@ _KERNEL_INSTALL_ECLASS=1
41 fi
42
43 EXPORT_FUNCTIONS src_test pkg_preinst pkg_postinst pkg_prerm pkg_postrm
44 -EXPORT_FUNCTIONS pkg_config
45 +EXPORT_FUNCTIONS pkg_config pkg_pretend
46 --
47 2.27.0

Replies