The /mirror GET and POST endpoints now include a boolean field named
"use_during_installation".
* if set to True, the mirror information will be used during
installation to fetch packages online.
* if set to False, we will only fetch packages from the pool.
In either case, the mirror information will still be used to build the
etc/apt/ directory in the target system.
Currently, the way use_during_installation is implemented is coupled
with the force_offline property of the network model. This means that
Ubuntu Pro and other stuff will be disabled too if we're skipping the
use of the archive.
NOTE: the default value for "use_during_installation" in the POST
endpoint is `null` ; which means that we should not change the current
value of force_offline.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
In cda6c54b87, we introduced the accurate
size vs human readable size for the size form fields. Unfortunately, we
also introduced a regression when the size gets capped (when it exceeds
the maximum size defined on the form). Currently, specifying a size that
is beyond the maximum value fails when submitting the form with:
[...]
File "urwid/wimp.py", line 543, in keypress
self._emit('click')
File "urwid/widget.py", line 461, in _emit
signals.emit_signal(self, name, self, *args)
File "urwid/signals.py", line 265, in emit
result |= self._call_callback(callback, user_arg, user_args, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "urwid/signals.py", line 295, in _call_callback
return bool(callback(*args_to_pass))
^^^^^^^^^^^^^^^^^^^^^^^
File "subiquitycore/ui/form.py", line 486, in _click_done
emit_signal(self, "submit", self)
File "urwid/signals.py", line 265, in emit
result |= self._call_callback(callback, user_arg, user_args, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "urwid/signals.py", line 295, in _call_callback
return bool(callback(*args_to_pass))
^^^^^^^^^^^^^^^^^^^^^^^
File "subiquity/ui/views/filesystem/partition.py", line 636, in done
handler(self.disk, spec, partition=self.partition, gap=self.gap)
File "subiquity/common/filesystem/manipulator.py", line 334, in logical_volume_handler
lv.size = align_up(spec["size"])
^^^^^^^^^^^^^^^^^^^^^^
File "subiquity/models/filesystem.py", line 1382, in align_up
return (size + block_size - 1) & ~(block_size - 1)
~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'BoundFormField' and 'int'
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Also deletes a note to users about not needing the autoinstall keyword
in non cloud-config delivery methods. We should keep a hint in the reference
that this is available, but generally let's always suggest to use the
top-level autoinstall keyword.
Users attempting to do autoinstall may incorrectly send autoinstall
directives as cloud-config, which will result in cloud-init
schema validation errors. When loading autoinstall from cloud-config,
we now check to see if there are any cloud-init schema validation errors
and warn the user. Additionally, if the source of the error is from
a known autoinstall error, we inform the user and halt the installation
with a nonreportable AutoinstallError.
When a partition is mounted in the live environment (either by casper or
another process) and is selected for resize, curtin will fail when
running e2fsck (or equivalent) with an error such as:
Resize requested for format ext4
Resizing /dev/sdb4 of type ext4 down to 12546211840
Running command ['e2fsck', '-p', '-f', '/dev/sdb4'] with allowed return codes [0] (capture=False)
/dev/sdb4 is mounted.
e2fsck: Cannot continue, aborting.
An error occured handling 'disk-sdb': ProcessExecutionError - Unexpected error while running command.
Command: ['e2fsck', '-p', '-f', '/dev/sdb4']
Exit code: 8
This is what happens when casper creates a partition on the installer
media to store /var/log and /var/crash. Usually the partition is large
enough to install Ubuntu so a GuidedStorageTargetResize scenario gets
emitted.
This patch prevents the emission of a GuidedStorageTargetResize scenario
if the partition is marked as mounted already.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
To workaround a grub2 bug (LP: #2055294) causing 24.04 installations to
fail, we added a default debconf-selection in Subiquity.
grub2 2.12-1ubuntu4 fixes the issue and migrated to the noble release
pocket on 2024-03-06.
We can now drop the workaround.
https://launchpad.net/ubuntu/+source/grub2/2.12-1ubuntu4
This reverts commit cffce32305.
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.
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
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>