From da9c911588c90be94dea023523d2dddaf17a925e Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Thu, 3 Apr 2025 15:12:11 +0200 Subject: [PATCH] overlay coreos/config: Add Flatcar modifications for sys-apps/dbus --- .../coreos/config/env/sys-apps/dbus | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-apps/dbus diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-apps/dbus b/sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-apps/dbus new file mode 100644 index 0000000000..111df2d45c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/config/env/sys-apps/dbus @@ -0,0 +1,41 @@ +# A hack to ignore processing of dbus.conf tmpfiles config file. +if [[ -z ${flatcar_hacked_systemd_tmpfiles:-} ]]; then + flatcar_hacked_systemd_tmpfiles=$(command -v systemd-tmpfiles) +fi +systemd-tmpfiles() { + local -a args=() + local f has_config_file='' + for f; do + if [[ ${f} != dbus.conf ]]; then + args+=( "${f}" ) + if [[ ${f} = *.conf ]]; then + has_config_file=x + fi + fi + done + if [[ -n ${has_config_file} ]]; then + "${flatcar_hacked_systemd_tmpfiles}" "${args[@]}" + fi +} + +# Hacks to avoid generating /etc/machine-id - we do it elsewhere, on +# our own. +if [[ -z ${flatcar_hacked_dbus_uuidgen:-} ]]; then + flatcar_hacked_dbus_uuidgen=$(command -v dbus-uuidgen) +fi +dbus-uuidgen() { + if [[ ${1:-} = "--ensure=${EROOT}/etc/machine-id" ]]; then + return 0 + fi + "${flatcar_hacked_dbus_uuidgen}" "${@}" +} + +if [[ -z ${flatcar_hacked_ln:-} ]]; then + flatcar_hacked_ln=$(command -v ln) +fi +ln() { + if [[ ${1:-} = '-sf' && ${2:-} = "${EPREFIX}"/etc/machine-id && ${3:-} = "${EROOT}"/var/lib/dbus/machine-id ]]; then + return 0 + fi + "${flatcar_hacked_ln}" "${@}" +}