Before starting the actual installation, we make changes to etc/apt
directory in an overlay so that the packages are pulled from the media
instead of the network.
At the end of installation, we need to revert these changes. We used to
replace the etc/apt directory on the target by the etc/apt directory
from the configured overlay.
This is a simple way to revert the temporary changes. Unfortunately, it
also removes configuration files that extra packages may have installed
in etc/apt. For instance, when installing an OEM meta-package, a
etc/apt/sources.list.d/<oem-meta-package>.list gets installed.
If we reset etc/apt to its content from the configured overlay, we lose
this file.
Fixed by selectively discarding changes to the files that subiquity
modified.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
When running subiquity in dry-run mode with SUBIQUITY_DEBUG=run-drivers,
we now support using a YAML file describing the hardware in a
umockdev-compatible way. This allows to give some control on what
ubuntu-drivers list will reply.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
These errors are really errors in how the ISO is constructed, so logging
and ignoring seems more appropriate, compared to say encryption being
unavailable because the TPM is in lockout mode.
We only search for drivers if search_drivers is enabled in the source
screen. When testing in dry-run mode, we need to check the
search_drivers checkbox AND remember to pass the has-drivers debug flag.
I think it makes sense to consider drivers available by default in
dry-run mode.
This also means that OEM meta-packages are available by default (and
_should_ be installed automatically) in dry-run now.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The ubuntu_drivers.list_drivers() method currently returns names of
drivers + name of OEM meta-packages.
We now define a new method to be used for the OEM meta-packages only.
For now, the has-drivers, no-drivers, run-drivers debug flags affect the
presence of the OEM meta-packages as well. Going forward, we should
define dry-run directives controlling drivers & OEM independently.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The /drivers GET endpoint is supposed to have {"drivers": null} when the
list of drivers has not (yes) been retrieved.
However, this behavior got broken by the following patch:
66c82b322 drivers: query again list of drivers if the source variant changes
.. which resets the drivers variable to an empty list when querying the
list of drivers (this happens automatically when the user submits on the
source screen).
Therefore, instead of getting {"drivers": null}, we would get
{"drivers": []} which has a different meaning.
The patch also incorrectly declared the drivers variable in the
initializer (not taking None into account). The variable was actually
already declared as a class variable with the right type.
Fixed by resetting the variable to None when re-querying the list of
drivers and dropped the class variable in favor of the instance variable
(with the right type this time).
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>