Commit Graph

176 Commits

Author SHA1 Message Date
Michael Hudson-Doyle f015634b79 configure controllers tui does not support when installing desktop
A bit of a hack but probably a useful one.
2022-11-15 15:43:33 +13:00
Michael Hudson-Doyle 5dafdb916d call into snapd to set up encryption when required 2022-11-11 14:46:44 +13:00
Michael Hudson-Doyle 2bb3aab362 add sample data which will fail at the finish-install step 2022-11-10 11:48:37 +13:00
Michael Hudson-Doyle c24cfd3d04 call into snapd to finish the installation of a core boot classic system 2022-11-10 11:48:37 +13:00
Michael Hudson-Doyle 5baa7b5e5f tidy sample data slightly 2022-11-10 11:47:29 +13:00
Michael Hudson-Doyle 27953f794d fix integration test 2022-11-01 15:59:06 +01:00
Michael Hudson-Doyle f87b97bbdf add some more sample data 2022-11-01 14:39:23 +01:00
Michael Hudson-Doyle 2e05f79dc1 add example source, api output and fix some bugs 2022-11-01 13:54:36 +01:00
Olivier Gayot 561fff1d5b
Merge pull request #1336 from ogayot/password-passphrase
Refactor how we handle confirmation fields - use passphrase instead of password where relevant
2022-10-28 14:06:54 +02:00
Chad Smith 07c62876d0 examples: fix invalid user-data example since we now validate schema 2022-09-01 13:12:53 -06:00
Dan Bungert 1bf562c85a
Merge pull request #1390 from CarlosNihelton/langpack-flag
[WSL] Enables users to skip installing language packs
2022-08-26 17:17:43 -06:00
Dan Bungert 70db2a6414 filesystem: fix kname for os prober 2022-08-25 17:01:33 -06:00
Carlos Nihelton 6dd157dac7
Adding WSLSetupOptions API endpoint
Intended to receive options that affect the setup process.
and won't be written to /etc/wsl.conf
Options relative to that conf file are handled by WslConfBase and
WslConfAdvanced.
Currently only the option for skip installing language packs is
available.
2022-08-23 10:45:29 -03:00
Olivier Gayot 324ff0bc8f Merge pull request #1372 from ogayot/FR-2475
install: invoke curtin multiple times with different stages
2022-08-11 11:11:51 +02:00
Olivier Gayot 559b904f54 install: don't run curtin install for hook stage
The hook stage does not do anyting in Ubuntu. Let's skip it.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-08-11 09:24:09 +02:00
Olivier Gayot 4c70b78fba install: invoke curtin multiple times with different stages
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>
2022-08-11 09:16:06 +02:00
Olivier Gayot 34d4acd264 hooks: execute hook scripts as builtin late commands
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>
2022-08-09 09:47:26 +02:00
Olivier Gayot 0c73bf9b86 source: add ability to select source in autoinstall
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>
2022-08-04 10:58:59 +02:00
Dan Bungert c473a22bf1 examples: make the 'simple' mc disk bigger
Increase size of the disk in the simple machine config to 100 GiB.
This file is used heavily as a basic starting machine config and it
should be large enough for many types of tests.
2022-07-21 08:52:42 -06:00
Dan Bungert 90e7bd8389 examples: threebuntu-on-msdos
3 Ubuntu installs, of various versions, on a MSDOS partition table.
Data courtesy of jp.nurmi@canonical.com.
2022-07-11 18:17:19 -06:00
Olivier Gayot 7ebef6d609 ubuntu-pro: add subscription info in response to /ubuntu_pro/check_token
The response to /ubuntu_pro/check_token now includes information about
the subscription: the name of the contract and the "name" of the account.

Instead of returning the list of services as an optional field, we now
include the list of services in the subscription object. The
subscription object is itself marked optional. This is a backward
incompatible change.

  {
    "status": "VALID_TOKEN",
    "services": [
      {
        "name": "esm-infra",
        "description": "UA Infra: Extended Security Maintenance (ESM)",
        "auto_enabled": true
      }
    ]
  }

  =>

  {
    "status": "VALID_TOKEN",
    "subscription": {
        "account_name": "user@domain.com",
        "contract_name": "UA Apps - Essential (Virtual)",
        "services": [
          {
            "name": "esm-infra",
            "description": "UA Infra: Extended Security Maintenance (ESM)",
            "auto_enabled": true
          }
        ]
     }
  }

If the token is not valid, the subscription object will be null:

  {
    "status": "EXPIRED_TOKEN",
    "subscription": null
  }

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-30 16:31:56 +02:00
Olivier Gayot d63b44c014 storage: use fields named passphrase for passphrases
Because the storage views lean on the implementation of
setup_password_validation from the identity screen, we were forced to
use a form with fields named "password" and "password_confirm".

This makes the code confusing because we use the "passphrase"
terminology in the storage forms.

We now leave up to the caller to specify which fields he wants to be
part of the validation ; instead of making him provide the full form.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-24 11:37:54 +02:00
Dan Bungert b298caf83a examples: add sample with size info 2022-05-31 09:09:33 -06:00
Olivier Gayot e5017256a2 snaplist: add visual indication for starred publishers
In addition to verified publishers being indicated by a check-mark, we
now have starred publishers indicated with a circled star.

If unicode support is not available, for instance with serial
connections, we use a different number of stars to represent:

 * verified publishers: 2 stars
 * starred publishers: 1 star
 * others: no star

Because our mechanism to substitute unicode characters with ascii
equivalents expect a 1:1 mapping, we cannot simply replace the circled
start by two stars. To workaround the issue, we added a narrow
non-breakable space.

When support of unicode is available, this character shows up as a
normal space.
When support of unicode is not available, it gets replaced by a star.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-05-04 10:32:32 +02:00
Olivier Gayot 79326cf2eb source: run answers when only one source is configured
Before, we would not run answers for the source controller if only one
source was specified. The controller would automatically get marked
configured.

Since we're adding a new "search drivers" option in this screen, we need
to make it interactive in integration tests now.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02:00
Jean-Baptiste Lallement a3a21da408 Removed systemd from the UI
We won't ship systemd officially in 22.04, hence remove it from the UI.
However it's still there and distributed and can be enabled manually.

Co-authored-by: Didier Roche <didrocks@ubuntu.com>
2022-04-07 10:55:30 +02:00
Olivier Gayot ad6cd6e383
Merge pull request #1196 from ogayot/FR-2077
Add client-side controller and view to install third-party drivers on server installer
2022-03-17 10:38:48 +01:00
Olivier Gayot 2bf39f02ca Merge pull request #1217 from ogayot/ua-rebranding
Rename UbuntuAdvantage -> UbuntuPro
2022-03-17 09:20:43 +01:00
Didier Roche d17cd6fc38 System-Setup: Add systemd experimental support to WSL
Grow a new API for enabling/disabling systemd experimental support. We
do this by chaining a specific command= in the boot section.
We preserve the user customized command= content when systemd
experimental support is not enabled.

Co-authored-by: Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
2022-03-16 12:24:18 +01:00
Olivier Gayot e9b2e24b1a Rename UbuntuAdvantage -> UbuntuPro but keep autoinstall compat
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-15 11:50:57 +01:00
Didier Roche 5695da5699 system-setup: Remove ubuntu-wsl-integration from API and TUI.
This project is no longer supported under WSL. Remove integration in the TUI
and API for it. Adapted tests and schema.
2022-03-14 15:58:03 +01:00
Olivier Gayot 2ec62051d4 Add basic implementation for third-party drivers GUI
[Michael Hudson Doyle]
 * Original patch

 [Olivier Gayot]
 * Make sure visible elements can be translated by using gettext _()
   construct.
 * Have GET /drivers provide the status of the checkbox (i.e. install
   drivers?) so we can restore the choice of the user when going back.
 * Store an object with an "install" boolean in the autoinstall schema ;
   instead of storing a boolean directly.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-03-10 09:55:58 +01:00
Dan Bungert c68a32fe42 examples: add disk with free space at end 2022-02-28 16:01:49 -07:00
Dan Bungert 9bd3ea6a6c filesystem: passphrase in answers, failing test 2022-02-11 16:19:19 -07:00
Dan Bungert d158d4e701
Merge pull request #1174 from ogayot/ua-entitled-services-only
Don't list UA services that are not entitled
2022-01-28 11:13:09 -07:00
Olivier Gayot 7dfe722686 Don't list UA services that are not entitled
Instead of only checking if a given UA service is available, we now also
check if it is entitled.

 - the available field for a service refers to its availability on the
   current machine (e.g. on Focal running on a amd64 CPU) ; whereas
 - the entitled field tells us if the contract covers the service.

Therefore, we need to make sure that we only list the services that are
both "available" and "entitled".

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-28 18:58:39 +01:00
Olivier Gayot 2bbd4fffe6 Update example states for Subiquity to cover valid token values
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-21 13:48:43 +01:00
Olivier Gayot 9e7bc5053b Add support for APT preferences through autoinstall in Subiquity
The autoinstall schema for "apt" now supports the "preferences"
configuration. Each preference element should contain the properties
described below, that 1:1 map with the keywords from apt_preferences(5):

  * package      <-> Package:
  * pin          <-> Pin:
  * pin-priority <-> Pin-Priority:

These preferences are forwarded to curtin through
subiquity-curtin-apt.conf. Support for these rules must be added to
curtin as well.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-11 18:42:40 +01:00
Dan Bungert 5ae52c000b
Merge pull request #1151 from ogayot/FR-1652
Validate UA token & list available services
2022-01-10 10:02:41 -07:00
Dan Bungert 96a53eff14
Merge pull request #1154 from dbungert/autoinstall-disable-components
apt: fix disable_components w/ autoinstall
2022-01-10 09:45:49 -07:00
Olivier Gayot f8704aa246 Merge branch 'main' into FR-1652
Resolve conflicts in PR 1151.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-10 10:53:51 +01:00
Olivier Gayot 81c67780ff Add basics checks for token validity in the autoinstall JSON schema
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-06 10:54:08 +01:00
Dan Bungert 5a2a7f5ad6 apt: fix disable_components w/ autoinstall
* The mixture of storage for disable_components in and out of the config
  dict was confusing and caused bugs, depending on the flow
* disable_components now solely lives in the dict, like other items
2022-01-05 10:35:05 -07:00
Olivier Gayot d345cf999a Use autoinstall for ubuntu-advantage in integration tests
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-04 17:58:46 +01:00
Olivier Gayot fd403ce476 Add sample outputs for ua status --simulate-with-token --format json
This commit introduces example JSON files that would simulate output of
the ua_client script, as in the following command:

  $ ubuntu-advantage status \
      --simulate-with-token "${token}" \
      --format json

Two files are added, one for each of the following scenario:
 * output when supplied a valid, non expired token
 * output when supplied a valid but expired token

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2021-12-17 17:41:45 +01:00
Olivier Gayot fe4b6fde6f Only show UA screen if running on LTS release
The UA screen is now shown only if we are running on an LTS release.
In dry-run mode, we pretend to always be on Ubuntu focal.

To implement the possibility to skip the screen, we added another POST
resource to inform the server that we are finished configuring
UbuntuAdvantage.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2021-12-16 11:06:09 +01:00
Olivier Gayot 1c9c04d55d Add initial integration of Ubuntu Advantage in subiquity
Introduce a new view, model and controllers pair to enable Ubuntu
Advantage from Subiquity. For now, we expect the user to input an
alphanumeric token and rely on cloud-init to enable the features
associated with the subscription.

This implementation comes with a number of limitations:
 * inability to validate the token before first-boot
 * inability to check what features are associated with the Ubuntu
   Advantage subscription, before first-boot
 * the user must input the token directly: there is no mechanism to
   deduce the token based on email address and password.

The new screen is placed after the identity scree. The installation
should already be running when the UA screen will be shown to the user.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2021-12-08 23:25:39 +01:00
Dan Bungert c4a9b6a1d6 examples: add os-prober to win10 2021-12-07 11:46:28 -07:00
Carlos Nihelton 7179bfb4fc Sample files for testing
Those files simulate the information generated by WSL launcher.
2021-10-28 14:16:28 -03:00
Patrick Wu ec04a6833a
system_setup: shutdown/reboot tests 2021-10-18 17:15:45 +08:00