[users] Add "transient" for hostname-location
This commit is contained in:
parent
3b0aa69ad3
commit
3524d4a0d0
@ -84,7 +84,9 @@ hostNameActionNames()
|
||||
static const NamedEnumTable< HostNameAction > names {
|
||||
{ QStringLiteral( "none" ), HostNameAction::None },
|
||||
{ QStringLiteral( "etcfile" ), HostNameAction::EtcHostname },
|
||||
{ QStringLiteral( "hostnamed" ), HostNameAction::SystemdHostname }
|
||||
{ QStringLiteral( "etc" ), HostNameAction::EtcHostname },
|
||||
{ QStringLiteral( "hostnamed" ), HostNameAction::SystemdHostname },
|
||||
{ QStringLiteral( "transient" ), HostNameAction::Transient },
|
||||
};
|
||||
// clang-format on
|
||||
// *INDENT-ON*
|
||||
|
@ -25,6 +25,7 @@ enum class HostNameAction
|
||||
None,
|
||||
EtcHostname, // Write to /etc/hostname directly
|
||||
SystemdHostname, // Set via hostnamed(1)
|
||||
Transient, // Force target system transient, remove /etc/hostname
|
||||
};
|
||||
|
||||
const NamedEnumTable< HostNameAction >& hostNameActionNames();
|
||||
|
@ -146,6 +146,9 @@ SetHostNameJob::exec()
|
||||
// Does its own logging
|
||||
setSystemdHostname( m_config->hostName() );
|
||||
break;
|
||||
case HostNameAction::Transient:
|
||||
CalamaresUtils::System::instance()->removeTargetFile( QStringLiteral( "/etc/hostname" ) );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( m_config->writeEtcHosts() )
|
||||
|
@ -161,7 +161,9 @@ userShell: /bin/bash
|
||||
# - *location* How the hostname is set in the target system:
|
||||
# - *None*, to not set the hostname at all
|
||||
# - *EtcFile*, to write to `/etc/hostname` directly
|
||||
# - *Etc*, identical to above
|
||||
# - *Hostnamed*, to use systemd hostnamed(1) over DBus
|
||||
# - *Transient*, to remove `/etc/hostname` from the target
|
||||
# The default is *EtcFile*. Setting this to *None* will
|
||||
# hide the hostname field.
|
||||
# - *writeHostsFile* Should /etc/hosts be written with a hostname for
|
||||
|
Loading…
Reference in New Issue
Block a user