[users] Add .conf entries for hostname settings
- Set hostname not-at-all, or via one of two mechanisms - Write /etc/hosts or not
This commit is contained in:
parent
61d096c9ec
commit
e74831fcb4
@ -141,8 +141,7 @@ UsersViewStep::onLeave()
|
|||||||
j = new SetPasswordJob( "root", m_widget->getRootPassword() );
|
j = new SetPasswordJob( "root", m_widget->getRootPassword() );
|
||||||
m_jobs.append( Calamares::job_ptr( j ) );
|
m_jobs.append( Calamares::job_ptr( j ) );
|
||||||
|
|
||||||
j = new SetHostNameJob( m_widget->getHostname(),
|
j = new SetHostNameJob( m_widget->getHostname(), m_actions );
|
||||||
SetHostNameJob::Action::EtcHostname | SetHostNameJob::Action::EtcHosts );
|
|
||||||
m_jobs.append( Calamares::job_ptr( j ) );
|
m_jobs.append( Calamares::job_ptr( j ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,4 +205,21 @@ UsersViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
// Now it might be explicitly set to empty, which is ok
|
// Now it might be explicitly set to empty, which is ok
|
||||||
|
|
||||||
Calamares::JobQueue::instance()->globalStorage()->insert( "userShell", shell );
|
Calamares::JobQueue::instance()->globalStorage()->insert( "userShell", shell );
|
||||||
|
|
||||||
|
using Action = SetHostNameJob::Action;
|
||||||
|
|
||||||
|
QString hostnameActionString = CalamaresUtils::getString( configurationMap, "setHostname" );
|
||||||
|
if ( hostnameActionString.isEmpty() )
|
||||||
|
{
|
||||||
|
hostnameActionString = QStringLiteral( "EtcFile" );
|
||||||
|
}
|
||||||
|
bool ok = false;
|
||||||
|
auto hostnameAction = hostnameActions().find( hostnameActionString, ok );
|
||||||
|
if ( !ok )
|
||||||
|
{
|
||||||
|
hostnameAction = Action::EtcHostname;
|
||||||
|
}
|
||||||
|
|
||||||
|
Action hostsfileAction = getBool( configurationMap, "writeHostsFile", true ) ? Action::EtcHosts : Action::None;
|
||||||
|
m_actions = hostsfileAction | hostnameAction;
|
||||||
}
|
}
|
||||||
|
@ -28,13 +28,13 @@ defaultGroups:
|
|||||||
# Disable when your Distribution does not require such a group.
|
# Disable when your Distribution does not require such a group.
|
||||||
autologinGroup: autologin
|
autologinGroup: autologin
|
||||||
# You can control the initial state for the 'autologin checkbox' here.
|
# You can control the initial state for the 'autologin checkbox' here.
|
||||||
# Possible values are:
|
# Possible values are:
|
||||||
# - true to check or
|
# - true to check or
|
||||||
# - false to uncheck
|
# - false to uncheck
|
||||||
# These set the **initial** state of the checkbox.
|
# These set the **initial** state of the checkbox.
|
||||||
doAutologin: true
|
doAutologin: true
|
||||||
|
|
||||||
# When *sudoersGroup* is set to a non-empty string, Calamares creates a
|
# When *sudoersGroup* is set to a non-empty string, Calamares creates a
|
||||||
# sudoers file for the user. This file is located at:
|
# sudoers file for the user. This file is located at:
|
||||||
# `/etc/sudoers.d/10-installer`
|
# `/etc/sudoers.d/10-installer`
|
||||||
# Remember to add the (value of) *sudoersGroup* to *defaultGroups*.
|
# Remember to add the (value of) *sudoersGroup* to *defaultGroups*.
|
||||||
@ -48,8 +48,8 @@ sudoersGroup: wheel
|
|||||||
# Setting this to false , causes the root account to be disabled.
|
# Setting this to false , causes the root account to be disabled.
|
||||||
setRootPassword: true
|
setRootPassword: true
|
||||||
# You can control the initial state for the 'reuse password for root'
|
# You can control the initial state for the 'reuse password for root'
|
||||||
# checkbox here. Possible values are:
|
# checkbox here. Possible values are:
|
||||||
# - true to check or
|
# - true to check or
|
||||||
# - false to uncheck
|
# - false to uncheck
|
||||||
#
|
#
|
||||||
# When checked, the user password is used for the root account too.
|
# When checked, the user password is used for the root account too.
|
||||||
@ -96,18 +96,18 @@ passwordRequirements:
|
|||||||
libpwquality:
|
libpwquality:
|
||||||
- minlen=0
|
- minlen=0
|
||||||
- minclass=0
|
- minclass=0
|
||||||
|
|
||||||
# You can control the visibility of the 'strong passwords' checkbox here.
|
# You can control the visibility of the 'strong passwords' checkbox here.
|
||||||
# Possible values are:
|
# Possible values are:
|
||||||
# - true to show or
|
# - true to show or
|
||||||
# - false to hide (default)
|
# - false to hide (default)
|
||||||
# the checkbox. This checkbox allows the user to choose to disable
|
# the checkbox. This checkbox allows the user to choose to disable
|
||||||
# password-strength-checks. By default the box is **hidden**, so
|
# password-strength-checks. By default the box is **hidden**, so
|
||||||
# that you have to pick a password that satisfies the checks.
|
# that you have to pick a password that satisfies the checks.
|
||||||
allowWeakPasswords: false
|
allowWeakPasswords: false
|
||||||
# You can control the initial state for the 'strong passwords' checkbox here.
|
# You can control the initial state for the 'strong passwords' checkbox here.
|
||||||
# Possible values are:
|
# Possible values are:
|
||||||
# - true to uncheck or
|
# - true to uncheck or
|
||||||
# - false to check (default)
|
# - false to check (default)
|
||||||
# the checkbox by default. Since the box is labeled to enforce strong
|
# the checkbox by default. Since the box is labeled to enforce strong
|
||||||
# passwords, in order to **allow** weak ones by default, the box needs
|
# passwords, in order to **allow** weak ones by default, the box needs
|
||||||
@ -122,3 +122,17 @@ allowWeakPasswordsDefault: false
|
|||||||
# - set, non-empty, use that path as shell. No validation is done
|
# - set, non-empty, use that path as shell. No validation is done
|
||||||
# that the shell actually exists or is executable.
|
# that the shell actually exists or is executable.
|
||||||
# userShell: /bin/bash
|
# userShell: /bin/bash
|
||||||
|
|
||||||
|
# Hostname setting
|
||||||
|
#
|
||||||
|
# The user can enter a hostname; this is configured into the system
|
||||||
|
# in some way; pick one of:
|
||||||
|
# - *None*, to not set the hostname at all
|
||||||
|
# - *EtcFile*, to write to `/etc/hostname` directly
|
||||||
|
# - *Hostnamed*, to use systemd hostnamed(1) over DBus
|
||||||
|
# The default is *EtcFile*.
|
||||||
|
setHostname: EtcFile
|
||||||
|
|
||||||
|
# Should /etc/hosts be written with a hostname for this machine
|
||||||
|
# (also adds localhost and some ipv6 standard entries).
|
||||||
|
writeHostsFile: true
|
||||||
|
Loading…
Reference in New Issue
Block a user