We now have the view display the user-code fetched via u-a-c and
automatically validate the contract token when the contract selection
succeeds.
If the magic token expires (i.e., u-a-c times out), a new contract
selection is initiated.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
We now add the interaction between u-a-c and Subiquity for the
magic-attach / contract selection.
This depends on an unreleased version of u-a-c.
A dry-run implementation is provided but does not allow the user to do
the actual contract selection so the contract selection will timeout
unconditionally.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
We now invoke curtin install in a step-by-step mode. Before, we would
perform a single invocation of curtin install for the following stages:
* early (but no early_commands configured)
* partitioning
* extract
* curthooks
* hook
* late (but no late_commands configured)
We now run multiple invocations of curtin install, in 5 different steps:
* initial: does not run any stage per se but prepares curtin
for the next invocations (this invocation is not strictly necessary
and could be merged with the next step but having it separate makes
the flow easier to understand, I think)
* partitioning: runs the partitioning stage
* extract: runs the extract stage
* curthooks: runs the curthooks stage
The early and late stages were dropped since they would act as no-ops.
We also dropped the hook stage since it does nothing in Ubuntu.
The configuration files for each step ends up in
/var/log/installer/curtin-install/subiquity-{step_name}.conf
The log files for each step end up in
/var/log/installer/curtin-install/{step_name}.log
If errors occur, a tarball of the necessary logs end up in
/var/log/installer/curtin-install/{step_name}-error.tar
All files (i.e. configuration files, log files, error-files) are bundled
in the apport report in case of crash.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The filesystem object IDs are really only meant to be a semireadable
unique string, and not for display to end users. Partitions in
particular were bad in this respect, as they could look like the number
on the end was the partition number.
Uglify the object IDs a bit to try to convey the above.
This is a partial fix to canonical/ubuntu-desktop-installer#832. The
last missing piece is to set the DISPLAY environment variable but this
can be done in the subiquity startup script in UDI.
When executing late commands, we now start by executing run-parts over
the /etc/subiquity/postinst.d directory (by default) if it exists.
A failure in run-parts is not considered critical so any other
late_commands will run no matter what.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
A new class called Command is introduced. A Command instance has
arguments (i.e., either a string or an sequence of strings) and a
boolean called "check" that tells if an error should stop the
installation.
A Command instance also has helper methods to simplify its usage.
The early/late/error command controllers now have a sequence of Command
instances.
When loaded from an autoinstall config, the commands inherit the value
of the "check" attribute from the controller itself.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
In the source autoinstall section, the search_drivers key was marked
required. This made sense at the time when it was the only supported
key. However, now that we also support the source ID, we don't want
to force the user to supply search_drivers as well.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The source autoinstall section now supports the "id" field where the
user can supply the ID of a source, e.g., "ubuntu-server" or
"ubuntu-server-minimal".
If the field is not supplied, the installation will use the source
declared default: true (if any) in the source catalog. Otherwise, it the
first source declared will be used.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The function is_token_added_overlay supposedly returns a boolean. But
the absence of a final return False statement made it return None by
accident.
In practice, it should not make a difference because returning False or
None evaluate to False in a boolean context. But returning False is
cleaner (sorry Perl).
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>