sys-apps/dbus: Apply Flatcar modifications

This commit is contained in:
Krzesimir Nowak 2022-04-08 20:46:02 +02:00
parent 0d9aaf7b05
commit f3a354c8d1
2 changed files with 37 additions and 13 deletions

View File

@ -0,0 +1,15 @@
Modifications done in this fork:
- Disable user sessions. We don't need them in Flatcar. At some point
Gentoo dropped the dedicated USE flag for it and enables user
sessions with systemd USE flag.
- Drop the dependency on sec-policy/selinux-dbus which is brought by
the selinux USE flag. We enable the flag because we still want DBus
to be selinux-aware, but for some reason we didn't want to pull in
the `sec-policy/selinux-dbus` package. We may want to revisit this
with our SELinux work.
- Drop /etc/machine-id generation. We do it elsewhere (bootengine?).
- Mark it as stable for amd64 and arm64.

View File

@ -17,7 +17,8 @@ SRC_URI="https://dbus.freedesktop.org/releases/dbus/${P}.tar.xz"
LICENSE="|| ( AFL-2.1 GPL-2 )" LICENSE="|| ( AFL-2.1 GPL-2 )"
SLOT="0" SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" # Flatcar: Mark it as stable for amd64 and arm64.
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="debug doc elogind selinux static-libs systemd test X" IUSE="debug doc elogind selinux static-libs systemd test X"
RESTRICT="!test? ( test )" RESTRICT="!test? ( test )"
@ -51,9 +52,14 @@ DEPEND="${COMMON_DEPEND}
>=dev-libs/glib-2.40:2 >=dev-libs/glib-2.40:2
) )
" "
# Flatcar: Drop the following dependency to avoid pulling in
# unnecessary ebuilds into rootfs:
#
# selinux? ( sec-policy/selinux-dbus )
#
# We may want to revisit that, actually.
RDEPEND="${COMMON_DEPEND} RDEPEND="${COMMON_DEPEND}
acct-user/messagebus acct-user/messagebus
selinux? ( sec-policy/selinux-dbus )
systemd? ( virtual/tmpfiles ) systemd? ( virtual/tmpfiles )
" "
@ -131,7 +137,9 @@ multilib_src_configure() {
--disable-kqueue --disable-kqueue
$(use_enable elogind) $(use_enable elogind)
$(use_enable systemd) $(use_enable systemd)
$(use_enable systemd user-session) # Flatcar: disable user sessions
# $(use_enable systemd user-session)
--disable-user-session
--disable-embedded-tests --disable-embedded-tests
--disable-modular-tests --disable-modular-tests
$(use_enable debug stats) $(use_enable debug stats)
@ -256,16 +264,17 @@ multilib_src_install_all() {
pkg_postinst() { pkg_postinst() {
readme.gentoo_print_elog readme.gentoo_print_elog
if use systemd; then # Flatcar: Drop machine-id generation.
tmpfiles_process dbus.conf # if use systemd; then
fi # tmpfiles_process dbus.conf
# fi
# Ensure unique id is generated and put it in /etc wrt bug #370451 but symlink #
# for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse # # Ensure unique id is generated and put it in /etc bug wrt #370451 but symlink
# dependencies with hardcoded paths (although the known ones got fixed already) # # for DBUS_MACHINE_UUID_FILE (see tools/dbus-launch.c) and reverse
# TODO: should be safe to remove at least the ln because of the above tmpfiles_process? # # dependencies with hardcoded paths (although the known ones got fixed already)
dbus-uuidgen --ensure="${EROOT}"/etc/machine-id # # TODO: should be safe to remove at least the ln because of the above tmpfiles_process?
ln -sf "${EPREFIX}"/etc/machine-id "${EROOT}"/var/lib/dbus/machine-id # dbus-uuidgen --ensure="${EROOT}"/etc/machine-id
# ln -sf "${EPREFIX}"/etc/machine-id "${EROOT}"/var/lib/dbus/machine-id
if [[ ${CHOST} == *-darwin* ]]; then if [[ ${CHOST} == *-darwin* ]]; then
local plist="org.freedesktop.dbus-session.plist" local plist="org.freedesktop.dbus-session.plist"