On recent installations of Ubuntu, the zzzz-installer-unattended-upgrade
file ended up in the etc/apt/apt.conf.d directory of the target system.
It is supposed to be a temporary file intended for one time invocation
of unattended-upgrade at the end of the installation.
Let's remove the file after unattended-upgrades finishes using a
try ... finally construct.
The previous implementation was doing the call to UU inside the
with open(...) block, after a manual call to .close(). This is
unnecessary, the file is automatically closed at the end of the with
block.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
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
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).
Adds support for AutoinstallValidation errors, the first class
of non-reportable errors. Includes a separate error overaly to
display a warning to the user about the issue.
Changes to the server to allow restarting the installer before all
of the controllers are loaded, since the error means the controllers
won't ever be loaded. Adds special handling to the ProgressView to
change the Reboot (the machine) button to a Restart (the installer) button
for this case.
Currently, installations of Ubuntu Server and Ubuntu Desktop both fail
on UEFI-based systems because of a grub2 bug. This is a workaround to
avoid failing installs until grub2 migrates to the release pocket.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Now that curtin more or less supports NVMe over TCP with the rootfs on
remote storage, relax the contraints set by subiquity.
We still need the /boot (and /boot/efi) partitions on local storage
though.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Change when the server discovers if the install is interactive or not.
This allows clients to display autoinstall errors in an interactive
way, if applicable. This also enables accessing the ssh_info endpoint
before all of the controllers are loaded. Autoinstall loading happens
after the loading cloudinit stage, so this should be accessible by then.
If a failure happens during/before cloudinit is finished, `interactive`
will still be set to `None` and clients should default to the
non-interactive case.
Adds a field to the ApplicationStatus struct, nonreportable_error,
to be filled when the server enters an error state due to a
non-reportable error/exception type.