installer: install the pre-installable drivers

Let's download and install the pre-installable drivers, if they're
available.

The reason we're only dealing with pre-installable drivers here is that
post-installable drivers would have to keep the unattended is available
accross reboots, resulting in a file that can't be cleaned up at this
point.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
Fabiano Fidêncio 2019-07-30 18:31:23 +02:00 committed by Cole Robinson
parent ef8c772be7
commit e32e609243

View File

@ -219,7 +219,7 @@ class Installer(object):
# Internal API overrides #
##########################
def _prepare_unattended_data(self, guest, scripts):
def _prepare_unattended_data(self, guest, meter, scripts):
injections = []
for script in scripts:
expected_filename = script.get_expected_filename()
@ -230,6 +230,13 @@ class Installer(object):
self._tmpfiles.append(scriptpath)
injections.append((scriptpath, expected_filename))
drivers_location = guest.osinfo.get_pre_installable_drivers_location(
guest.os.arch)
drivers = unattended.download_drivers(drivers_location,
InstallerTreeMedia.make_scratchdir(guest), meter)
if drivers:
injections.extend(drivers)
iso = perform_cdrom_injections(injections,
InstallerTreeMedia.make_scratchdir(guest))
self._tmpfiles.append(iso)
@ -270,7 +277,7 @@ class Installer(object):
unattended_scripts)
elif unattended_scripts:
self._prepare_unattended_data(guest, unattended_scripts)
self._prepare_unattended_data(guest, meter, unattended_scripts)
def _cleanup(self, guest):
if self._treemedia: