Commit 33ad28ef authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Allow microcode configuration by user

parent 243e2d93
......@@ -115,6 +115,10 @@ class Ili:
for device_name in self.state.network_interface_mappings:
# Get users choice to install microcode or not
if self.state.install_microcode is None:
# Set hostname
if not self.state.hostname:
......@@ -597,6 +601,38 @@ class Ili:
except ValueError:
self._error('ERROR', f'The DNS2 address "{dns2address_raw}" is not valid!')
def _get_install_microcode(self):
"""Get the users choice to install microcode."""
install_microcode = None
# Loop while no disk layout strategy was selected
while install_microcode is None:
# Display a radiolist with the network addressing types
code, install_microcode = self._dialog.radiolist(
f'Install CPU microcode updates?',
height=20, width=50, list_height=10,
title='Install Microcode',
('YES', 'Install CPU microcode updates', False),
('NO', 'Do not install CPU microcode', False),
# If the user selected cancel, we need to abort
if code == self._dialog.DIALOG_CANCEL:
# If no option was chosen, display a warning
if not install_microcode:
self._error('ERROR', 'No option was selected regarding microcode install!')
# Set the install_microcode attribute
if install_microcode == 'YES':
self.state.install_microcode = True
self.state.install_microcode = False
def _get_hostname(self):
"""Get hostname from user."""
......@@ -49,7 +49,7 @@ class IliState:
# Mirrorlist
_mirrorlist: Optional[str]
# Install microcode
_install_microcode: bool
_install_microcode: Optional[bool]
# Root password
_root_password: Optional[str]
# Extra user username
......@@ -122,7 +122,7 @@ class IliState:
self._timezone = 'UTC'
self._mirrorlist = None
self._packages = []
self._install_microcode = True
self._install_microcode = None
self._root_password = None
self._user_username = None
self._user_password = None
......@@ -325,6 +325,11 @@ class IliState:
"""Return if we should install microcode or not."""
return self._install_microcode
def install_microcode(self, value: bool):
"""Set the install_microcode property."""
self._install_microcode = value
# Users
def root_password(self):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment