gentoo-ebuilds/eclass
Nowa Ammerlaan 123b8e97f3
kernel-build.eclass: replace cert with pubkey in generic-uki .pcrpkey
This is the final piece in the Measured Boot puzzle, we have been
putting the full certificate in the pcrpkey section. But though the
certificate does contain the public key, the tools downstream get
confused by the incorrect format. We now resolve the problem by
extracting the public key from the certificate and using that instead.

See-also: https://github.com/systemd/systemd/issues/38833
Closes: https://bugs.gentoo.org/960276
Signed-off-by: Nowa Ammerlaan <nowa@gentoo.org>
2025-09-11 22:18:47 +02:00
..
tests Revert "eclass/tests: tweak dot-a.sh tests for binutils" 2025-08-15 06:17:05 +01:00
acct-group.eclass acct-{group,user}.eclass: destable hppa and sparc 2025-09-08 21:15:00 +03:00
acct-user.eclass acct-{group,user}.eclass: destable hppa and sparc 2025-09-08 21:15:00 +03:00
ada.eclass
alternatives.eclass
apache-2.eclass apache-2.eclass: spell 'GNU Binutils' consistently 2025-09-06 21:01:50 +01:00
apache-module.eclass
app-alternatives.eclass
aspell-dict-r1.eclass
autotools.eclass
bash-completion-r1.eclass
cargo.eclass cargo.eclass: fix RUST_MIN_VER typo in error 2025-09-11 10:51:13 +01:00
cdrom.eclass
check-reqs.eclass
chromium-2.eclass chromium-2.eclass: Handle non-standard _ suffixes in locale .pak files 2025-08-26 23:03:11 +01:00
cmake-multilib.eclass cmake-multilib.eclass: Drop EAPI-7 support 2025-08-18 19:57:49 +02:00
cmake.eclass cmake.eclass: Avoid false positives by ensuring we find a function call 2025-06-24 21:44:05 +02:00
common-lisp-3.eclass
cron.eclass
crossdev.eclass
cuda.eclass cuda.eclass: add sandbox exclusion for /proc/self/task 2025-07-25 14:46:54 +02:00
cvs.eclass
db-use.eclass
db.eclass
depend.apache.eclass
desktop.eclass
dist-kernel-utils.eclass dist-kernel-utils.eclass: reinstall_initramfs() zboot support 2025-07-25 10:21:16 +02:00
distutils-r1.eclass distutils-r1.eclass: Update scikit-build-core options 2025-08-09 18:44:58 +02:00
docs.eclass
dot-a.eclass dot-a.eclass: make strip-lto remember if guarantee-fat ran 2025-07-03 23:20:45 -04:00
dotnet-pkg-base.eclass
dotnet-pkg.eclass
dotnet.eclass
dune.eclass
eapi8-dosym.eclass
eapi9-pipestatus.eclass
eapi9-ver.eclass
ecm-common.eclass
ecm.eclass ecm.eclass: Move dev-qt/qttools:6[assistant] behind IUSE doc again 2025-07-02 19:38:20 +02:00
edo.eclass
edos2unix.eclass
elisp-common.eclass
elisp.eclass
emboss-r3.eclass
estack.eclass
fcaps.eclass fcaps.eclass: do not set suid bit as a fallback 2025-08-14 12:27:44 -04:00
ffmpeg-compat.eclass
findlib.eclass
fixheadtails.eclass
flag-o-matic.eclass flag-o-matic.eclass: Add functions for testing/stipping HIPFLAGS 2025-07-05 08:14:13 +01:00
font-ebdftopcf.eclass
font.eclass
fortran-2.eclass
frameworks.kde.org.eclass frameworks.kde.org.eclass: Drop SRC_URI support for KF5 PortingAids 2025-06-15 19:26:36 +02:00
freedict.eclass
gap-pkg.eclass
gear.kde.org.eclass kde-apps/umbrello: Add KF6-based 25.11.70_pre20250817 snapshot 2025-08-17 18:51:45 +02:00
ghc-package.eclass
git-r3.eclass
gkrellm-plugin.eclass
gnome.org.eclass
gnome2-utils.eclass
gnome2.eclass
gnuconfig.eclass
gnustep-2.eclass
gnustep-base.eclass
go-env.eclass
go-module.eclass go-module.eclass: drop RESTRICT=strip 2025-07-13 06:05:29 +01:00
golang-base.eclass golang-base.eclass: drop RESTRICT=strip 2025-07-13 06:06:34 +01:00
golang-build.eclass
golang-vcs-snapshot.eclass
golang-vcs.eclass
greadme.eclass greadme.eclass: drop "file exists" check on append 2025-07-27 14:39:41 +02:00
gstreamer-meson.eclass gstreamer-meson.eclass: drop unversioned virtual Perl dep 2025-07-27 02:50:38 +01:00
guile-single.eclass
guile-utils.eclass
guile.eclass
haskell-cabal.eclass
java-osgi.eclass
java-pkg-2.eclass
java-pkg-opt-2.eclass java-pkg-opt-2.eclass: drop EAPI 7 2025-08-13 13:02:57 +01:00
java-pkg-simple.eclass
java-utils-2.eclass java-utils-2.eclass: drop EAPI 7 2025-08-13 13:02:57 +01:00
java-vm-2.eclass
junit5.eclass junit5.eclass: drop -x 2025-08-14 09:08:04 +01:00
kde.org.eclass
kernel-2.eclass
kernel-build.eclass kernel-build.eclass: replace cert with pubkey in generic-uki .pcrpkey 2025-09-11 22:18:47 +02:00
kernel-install.eclass kernel-install.eclass: verify against SECUREBOOT_SIGN_CERT 2025-09-11 22:18:46 +02:00
latex-package.eclass
libretro-core.eclass
libtool.eclass
linux-info.eclass linux-info.eclass: Fix building modules when /lib/modules is locked down 2025-06-09 21:27:51 +01:00
linux-mod-r1.eclass linux-mod-r1.eclass: silence spurious warning with _p* kernels 2025-09-06 16:43:35 -04:00
linux-mod.eclass
llvm-r1.eclass llvm-r1.eclass: update _LLVM_NEWEST_STABLE to 20 2025-06-14 15:26:18 +01:00
llvm-r2.eclass llvm-r2.eclass: update _LLVM_NEWEST_STABLE to 20 2025-06-14 15:26:07 +01:00
llvm-utils.eclass
llvm.eclass
llvm.org.eclass llvm.org.eclass: Add 22.0.0_pre20250910 snapshot 2025-09-10 13:46:45 +02:00
lua-single.eclass
lua-utils.eclass
lua.eclass
mate-desktop.org.eclass
mate.eclass
mercurial.eclass
meson-multilib.eclass
meson.eclass
mono-env.eclass
mount-boot-utils.eclass
mount-boot.eclass
mozcoreconf-v6.eclass
mozextension.eclass
mozlinguas-v2.eclass
multibuild.eclass
multilib-build.eclass
multilib-minimal.eclass
multilib.eclass multilib.eclass: respect SYSROOT when overriding PKG_CONFIG_* vars 2025-08-20 23:26:47 +01:00
multiprocessing.eclass
myspell-r2.eclass
netsurf.eclass
nginx-module.eclass nginx{,-module}.eclass: do not fail if econf_ngx --help is called 2025-07-07 23:24:31 +01:00
nginx.eclass eclass/nginx.eclass: Install *_params files to /etc/nginx 2025-07-27 01:46:15 +01:00
ninja-utils.eclass
nuget.eclass
office-ext-r1.eclass
opam.eclass
optfeature.eclass
out-of-source-utils.eclass
out-of-source.eclass
pam.eclass
pax-utils.eclass
perl-functions.eclass
perl-module.eclass perl-module.eclass: move DIST_MAKE setting into perl-module_src_configure 2025-06-29 23:55:55 +01:00
php-ext-pecl-r3.eclass
php-ext-source-r3.eclass
php-pear-r2.eclass
plasma.kde.org.eclass
plocale.eclass
portability.eclass
postgres-multi.eclass
postgres.eclass
prefix.eclass
preserve-libs.eclass
pypi.eclass pypi.eclass: Introduce provenance verification API 2025-09-06 09:00:51 +02:00
python-any-r1.eclass
python-r1.eclass
python-single-r1.eclass
python-utils-r1.eclass python-utils-r1.eclass: replace 2to3 with "unsupported" wrapper for 3.13+ 2025-09-06 09:00:53 +02:00
qmail.eclass
qmake-utils.eclass
qt5-build.eclass qt5-build.eclass: Drop support for old versions 2025-06-09 22:47:16 +02:00
qt6-build.eclass qt6-build.eclass: ignore qtwayland for the dependency assert 2025-07-05 18:33:27 -04:00
readme.gentoo-r1.eclass
rebar-utils.eclass
rebar.eclass
rebar3.eclass
rocm.eclass rocm.eclass: update targets for rocm >= 6.4.3 libraries 2025-09-06 16:12:49 +01:00
rpm.eclass
ruby-fakegem.eclass
ruby-ng-gnome2.eclass
ruby-ng.eclass
ruby-single.eclass
ruby-utils.eclass
rust-toolchain.eclass
rust.eclass eclass: rust: add 1.89.0 to available slots 2025-07-29 18:19:58 +10:00
s6.eclass
savedconfig.eclass
scons-utils.eclass
sec-keys.eclass sec-keys.eclass: for SLOT= packages, add slot to filename 2025-08-11 01:35:27 -04:00
secureboot.eclass
selinux-policy-2.eclass selinux-policy-2.eclass: Document PATCHBUNDLE var 2025-09-03 09:47:54 -07:00
sgml-catalog-r1.eclass sgml-catalog-r1.eclass: add EAPI 8 support 2025-07-23 13:53:52 +02:00
shell-completion.eclass
ssl-cert.eclass
stardict.eclass
strip-linguas.eclass
subversion.eclass
sysroot.eclass sysroot.eclass: Add sysroot_run_prefixed convenience function 2025-07-09 12:21:58 +01:00
systemd.eclass
texlive-common.eclass
texlive-module.eclass
tmpfiles.eclass
toolchain-autoconf.eclass
toolchain-funcs.eclass toolchain{,-funcs}.eclass: Ensure hf/sf detection works for t64 CHOSTs 2025-07-14 20:49:54 +02:00
toolchain.eclass toolchain.eclass: drop support EAPI 7 2025-09-06 22:29:14 +01:00
tree-sitter-grammar.eclass
udev.eclass
unpacker.eclass
user-info.eclass user-info.eclass: fix egetgroups when ROOT is not empty 2025-06-13 19:07:34 -04:00
usr-ldscript.eclass usr-ldscript.eclass: spell 'GNU Binutils' consistently 2025-09-06 21:01:51 +01:00
vala.eclass
vcs-clean.eclass
vcs-snapshot.eclass
vdr-plugin-2.eclass
verify-sig.eclass verify-sig.eclass: Fix multi-file verify-sig_verify_signed_checksums 2025-07-02 10:12:17 +02:00
vim-doc.eclass
vim-plugin.eclass
vim-spell.eclass
virtualx.eclass
waf-utils.eclass
webapp.eclass
wine.eclass wine.eclass: fix spacing further 2025-09-02 21:32:07 -04:00
wrapper.eclass
wxwidgets.eclass wxwidgets.eclass: remove EAPI 7 support 2025-06-21 12:07:35 +02:00
xdg-utils.eclass
xdg.eclass
xemacs-packages.eclass
xorg-3.eclass
xorg-meson.eclass
zig-utils.eclass zig-utils.eclass: add 0.15 to the list of supported versions 2025-09-01 11:31:15 +01:00
zig.eclass zig.eclass: fix typos 2025-06-11 02:47:46 +01:00

# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: readme.gentoo-r1.eclass
# @MAINTAINER:
# Pacho Ramos <pacho@gentoo.org>
# @AUTHOR:
# Author: Pacho Ramos <pacho@gentoo.org>
# @SUPPORTED_EAPIS: 7 8
# @BLURB: install a doc file shown via elog messages
# @DESCRIPTION:
# An eclass for installing a README.gentoo doc file recording tips
# shown via elog messages.  With this eclass, those elog messages will only be
# shown at first package installation and a file for later reviewing will be
# installed under /usr/share/doc/${PF}
#
# You need to call readme.gentoo_create_doc in src_install phase and
# readme.gentoo_print_elog in pkg_postinst

if [[ -z ${_README_GENTOO_ECLASS} ]]; then
_README_GENTOO_ECLASS=1

case ${EAPI} in
	7|8) ;;
	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac

# @ECLASS_VARIABLE: DOC_CONTENTS
# @DEFAULT_UNSET
# @DESCRIPTION:
# The information that is used to create the README.gentoo file.

# @ECLASS_VARIABLE: DISABLE_AUTOFORMATTING
# @DEFAULT_UNSET
# @DESCRIPTION:
# If non-empty, DOC_CONTENTS information will be strictly respected,
# not getting it automatically formatted by fold.  If empty, it will
# rely on fold for formatting and 'echo -e' options to tweak lines a bit.

# @ECLASS_VARIABLE: FORCE_PRINT_ELOG
# @DEFAULT_UNSET
# @DESCRIPTION:
# If non-empty this variable forces elog messages to be printed.

# @ECLASS_VARIABLE: README_GENTOO_SUFFIX
# @DESCRIPTION:
# If you want to specify a suffix for README.gentoo file please export it.
: "${README_GENTOO_SUFFIX:=""}"

# @FUNCTION: readme.gentoo_create_doc
# @DESCRIPTION:
# Create doc file with ${DOC_CONTENTS} variable (preferred) and, if not set,
# look for "${FILESDIR}/README.gentoo" contents.  You can use
# ${FILESDIR}/README.gentoo-${SLOT} also.
# Usually called at src_install phase.
readme.gentoo_create_doc() {
	debug-print-function ${FUNCNAME} "$@"

	if [[ -n "${DOC_CONTENTS}" ]]; then
		if [[ -n "${DISABLE_AUTOFORMATTING}" ]]; then
			echo "${DOC_CONTENTS}" > "${T}"/README.gentoo || die
		else
			local saved_flags=$-
			set -f				# disable filename expansion in echo arguments
			echo -e ${DOC_CONTENTS} | fold -s -w 70 \
				| sed 's/[[:space:]]*$//' > "${T}"/README.gentoo
			assert
			set +f -${saved_flags}
		fi
	elif [[ -f "${FILESDIR}/README.gentoo-${SLOT%/*}" ]]; then
		cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo || die
	elif [[ -f "${FILESDIR}/README.gentoo${README_GENTOO_SUFFIX}" ]]; then
		cp "${FILESDIR}/README.gentoo${README_GENTOO_SUFFIX}" "${T}"/README.gentoo || die
	else
		die "You are not specifying README.gentoo contents!"
	fi

	( # subshell to avoid pollution of calling environment
		docinto .
		dodoc "${T}"/README.gentoo
	)
	README_GENTOO_DOC_VALUE=$(< "${T}/README.gentoo")
}

# @FUNCTION: readme.gentoo_print_elog
# @DESCRIPTION:
# Print elog messages with "${T}"/README.gentoo contents.  They will be
# shown only when package is installed at first time.
# Usually called at pkg_postinst phase.
#
# If you want to show them always, please set FORCE_PRINT_ELOG to a non empty
# value in your ebuild before this function is called.
# This can be useful when, for example, DOC_CONTENTS is modified, then, you can
# rely on specific REPLACING_VERSIONS handling in your ebuild to print messages
# when people update from versions still providing old message.
readme.gentoo_print_elog() {
	debug-print-function ${FUNCNAME} "$@"

	if [[ -z "${README_GENTOO_DOC_VALUE}" ]]; then
		die "readme.gentoo_print_elog invoked without matching readme.gentoo_create_doc call!"
	elif ! [[ -n "${REPLACING_VERSIONS}" ]] || [[ -n "${FORCE_PRINT_ELOG}" ]]; then
		echo -e "${README_GENTOO_DOC_VALUE}" | while read -r ELINE; do elog "${ELINE}"; done
		elog ""
		elog "(Note: Above message is only printed the first time package is"
		elog "installed. Please look at ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
		elog "for future reference)"
	fi
}

fi