machineid: pass around enum for style

This commit is contained in:
Adriaan de Groot 2023-11-02 21:22:35 +01:00
parent 083b0fb1e5
commit 44d12379bd
4 changed files with 21 additions and 9 deletions

View File

@ -96,7 +96,7 @@ MachineIdJob::exec()
{
cWarning() << "Could not create systemd data-directory.";
}
auto r = MachineId::createSystemdMachineId( root, target_systemd_machineid_file );
auto r = MachineId::createSystemdMachineId( m_systemd_style, root, target_systemd_machineid_file );
if ( !r )
{
return r;

View File

@ -10,16 +10,16 @@
#ifndef MACHINEIDJOB_H
#define MACHINEIDJOB_H
#include "Workers.h"
#include "CppJob.h"
#include "DllMacro.h"
#include "utils/PluginFactory.h"
#include <QObject>
#include <QStringList>
#include <QVariantMap>
#include "CppJob.h"
#include "utils/PluginFactory.h"
#include "DllMacro.h"
/** @brief Write 'random' data: machine id, entropy, UUIDs
*
*/
@ -48,6 +48,8 @@ public:
private:
bool m_systemd = false; ///< write systemd's files
MachineId::SystemdMachineIdStyle m_systemd_style = MachineId::SystemdMachineIdStyle::Blank;
bool m_dbus = false; ///< write dbus files
bool m_dbus_symlink = false; ///< .. or just symlink to systemd

View File

@ -153,8 +153,9 @@ runCmd( const QStringList& cmd )
}
Calamares::JobResult
createSystemdMachineId( const QString& rootMountPoint, const QString& fileName )
createSystemdMachineId( SystemdMachineIdStyle style, const QString& rootMountPoint, const QString& fileName )
{
Q_UNUSED( style )
Q_UNUSED( rootMountPoint )
Q_UNUSED( fileName )
return runCmd( QStringList { QStringLiteral( "systemd-machine-id-setup" ) } );

View File

@ -52,6 +52,7 @@ createEntropy( const EntropyGeneration kind, const QString& rootMountPoint, cons
* Creating UUIDs for DBUS and SystemD.
*/
/// @brief Create a new DBus UUID file
Calamares::JobResult createDBusMachineId( const QString& rootMountPoint, const QString& fileName );
@ -59,7 +60,15 @@ Calamares::JobResult createDBusMachineId( const QString& rootMountPoint, const Q
Calamares::JobResult
createDBusLink( const QString& rootMountPoint, const QString& fileName, const QString& systemdFileName );
Calamares::JobResult createSystemdMachineId( const QString& rootMountPoint, const QString& fileName );
enum class SystemdMachineIdStyle
{
Uuid,
Blank,
Uninitialized
};
Calamares::JobResult
createSystemdMachineId( SystemdMachineIdStyle style, const QString& rootMountPoint, const QString& fileName );
} // namespace MachineId