Subiquity currently ignores invalid top-level keys, but this has likely
been a major source of confusion of autoinstall capabilities.
In future versions, the following autoinstall config will throw an
AutoinstallValidationError:
version: 2
interactive-sections:
- identity
literally-anything: lmao
This patch adds warnings for version 1 and will begin to throw
an AutoinstallValidationError on these instances in version 2 once
it has been enabled.
This should not result in a format object being created, which curtin
doesn't like. Normalize to None as the fstype to skip format object
creation.
LP: #2058394
This changes the journal listener callback in the non-interactive
scenario to support all types of events, not just start and finish
events.
This also modifies the journal listener in the non-interactive scenario
to not seek all the way to the newest entry. In non-interactive installs,
the server can get pretty far into the installation by the time the client
can connect, so any important warnings/errors that the server reports
before then wouldn't be printed to the console by the client otherwise.
Adds new reporting type events "INFO", "WARNING", and "ERROR" to be
used for context logging. These can be invoked with the new `.info`,
`.warning`, and `.error` methods on the context object accordingly.
Useful for things like warning/errors on autoinstall configuartions.
When ensuring that the system-setup process can only be connected to
on the loopback interface, we spawn a bunch of `curl --interface ...`
processes. If the connection times out (which is the expectation in most
scenarios), the curl processes ended up not being terminated. Not only
this is small waste of resources, this is also causing errors on noble:
Exception ignored in: <function BaseSubprocessTransport.__del__ at 0x745692661300>
Traceback (most recent call last):
File "/usr/lib/python3.12/asyncio/base_subprocess.py", line 126, in __del__
self.close()
File "/usr/lib/python3.12/asyncio/base_subprocess.py", line 104, in close
proto.pipe.close()
File "/usr/lib/python3.12/asyncio/unix_events.py", line 568, in close
self._close(None)
File "/usr/lib/python3.12/asyncio/unix_events.py", line 592, in _close
self._loop.call_soon(self._call_connection_lost, exc)
File "/usr/lib/python3.12/asyncio/base_events.py", line 793, in call_soon
self._check_closed()
File "/usr/lib/python3.12/asyncio/base_events.py", line 540, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Fixed by terminating the curl processes (and waiting for them to
terminate) before exiting the script.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
By default, warnings emitted by warnings.warn() will show on stderr. For
a TUI application, this is a problem because they will be displayed over
the UI and create visual glitches.
For parts of the UI that are regularly redrawn, the text of the warning
will eventually go away (sometimes instantly, making the warning
impossible to read).
For parts of the screen that are *not* regularly redrawn, the text of
the warning will stay until the user sends a Ctrl-L sequence.
We now make use of logging.captureWarnings() to redirect the warnings to
the log files. This prevents the UI glitches and if any warning is
emitted, we can actually find it in the logs.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Adds an option to configure the VM to load SecureBoot enabled firmware.
SecureBoot is a feature of UEFI, which means --boot (for legacy BIOS
boot) is incompatible with this flag. Providing both will result
in an error.
This will be useful for testing MOK enrollment behavior, as on reboot
you can confirm if you are presented with mokmanager or regular first
boot.
The local disk that scripts/kvm-test.py creates unconditionally uses the
virtio interface. Recently in Subiquity, we did some work more closely
related to NVMe drives but kvm-test.py did not support that type of
interface.
We now add the possibility to specify the interface using the
--disk-interface option. It can only take two options:
* --disk-interface nvme
* --disk-interface virtio (the default)
This should allow us to spot regressions (such as in LP: #2056730) with
more ease.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
A new builtin curthook was introduced to address copying over
common metadata from /cdrom/.disk/ at install time. This addressed
copying /cdrom/.disk/info and /cdrom/.disk/ubuntu_dist_channel
(LP: #2037038).