[machineid] Read systemd-style from config
This commit is contained in:
parent
89348910c3
commit
1b37eb1262
@ -14,6 +14,7 @@
|
|||||||
#include "Workers.h"
|
#include "Workers.h"
|
||||||
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
#include "utils/NamedEnum.h"
|
||||||
#include "utils/System.h"
|
#include "utils/System.h"
|
||||||
#include "utils/Variant.h"
|
#include "utils/Variant.h"
|
||||||
|
|
||||||
@ -22,6 +23,25 @@
|
|||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
|
const NamedEnumTable< MachineId::SystemdMachineIdStyle >&
|
||||||
|
styleNames()
|
||||||
|
{
|
||||||
|
using T = MachineId::SystemdMachineIdStyle;
|
||||||
|
// *INDENT-OFF*
|
||||||
|
// clang-format off
|
||||||
|
static const NamedEnumTable< MachineId::SystemdMachineIdStyle > names {
|
||||||
|
{ QStringLiteral( "none" ), T::Blank },
|
||||||
|
{ QStringLiteral( "blank" ), T::Blank },
|
||||||
|
{ QStringLiteral( "uuid" ), T::Uuid },
|
||||||
|
{ QStringLiteral( "systemd" ), T::Uuid },
|
||||||
|
{ QStringLiteral( "literal-uninitialized" ), T::Uninitialized },
|
||||||
|
};
|
||||||
|
// clang-format on
|
||||||
|
// *INDENT-ON*
|
||||||
|
|
||||||
|
return names;
|
||||||
|
}
|
||||||
|
|
||||||
MachineIdJob::MachineIdJob( QObject* parent )
|
MachineIdJob::MachineIdJob( QObject* parent )
|
||||||
: Calamares::CppJob( parent )
|
: Calamares::CppJob( parent )
|
||||||
{
|
{
|
||||||
@ -134,6 +154,12 @@ MachineIdJob::setConfigurationMap( const QVariantMap& map )
|
|||||||
{
|
{
|
||||||
m_systemd = Calamares::getBool( map, "systemd", false );
|
m_systemd = Calamares::getBool( map, "systemd", false );
|
||||||
|
|
||||||
|
const auto style = Calamares::getString( map, "systemd-style", QString() );
|
||||||
|
if ( !style.isEmpty() )
|
||||||
|
{
|
||||||
|
m_systemd_style = styleNames().find( style, MachineId::SystemdMachineIdStyle::Uuid );
|
||||||
|
}
|
||||||
|
|
||||||
m_dbus = Calamares::getBool( map, "dbus", false );
|
m_dbus = Calamares::getBool( map, "dbus", false );
|
||||||
if ( map.contains( "dbus-symlink" ) )
|
if ( map.contains( "dbus-symlink" ) )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user