From b62004aae9039b44fd9d2c8e6eb9d74f5c88d863 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 7 Feb 2020 16:10:13 +0100 Subject: [PATCH] [machineid] Create the DBus data directory - before running dbus-uuidgen or linking to systemd's UUID, create /var/lib/dbus; some distro's don't create that beforehand. FIXES #1314 --- src/modules/machineid/MachineIdJob.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/machineid/MachineIdJob.cpp b/src/modules/machineid/MachineIdJob.cpp index af3a68d90..fc535e356 100644 --- a/src/modules/machineid/MachineIdJob.cpp +++ b/src/modules/machineid/MachineIdJob.cpp @@ -68,7 +68,7 @@ MachineIdJob::exec() QString target_dbus_machineid_file = QStringLiteral( "/var/lib/dbus/machine-id" ); QString target_entropy_file = QStringLiteral( "/var/lib/urandom/random-seed" ); - const auto* system = CalamaresUtils::System::instance(); + const CalamaresUtils::System* system = CalamaresUtils::System::instance(); // Clear existing files if ( m_entropy ) @@ -106,6 +106,10 @@ MachineIdJob::exec() } if ( m_dbus ) { + if ( !system->createTargetParentDirs( target_dbus_machineid_file ) ) + { + cWarning() << "Could not create DBus data-directory."; + } if ( m_dbus_symlink && QFile::exists( root + target_systemd_machineid_file ) ) { auto r = MachineId::createDBusLink( root, target_dbus_machineid_file, target_systemd_machineid_file );