Commit Graph

20 Commits

Author SHA1 Message Date
Olivier Gayot 6c3ae3c6dd mirror: add support for falling back to an offline install
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-02-15 18:09:39 +01:00
Olivier Gayot ff46c48d60 mirror: use apt->mirror-selection instead of relying on version
We used to rely on a version key under apt autoinstall section to
specify if we want the old implementation (i.e., a single candidate
primary mirror) or the new implementation (i.e., multiple primary mirror
candidates).

Instead, we now introduce the apt->mirror-selection autoinstall section,
and move the primary section under it.

If the primary section if under apt, we want the old implementation.
If the primary section is under apt->mirror-selection, we want the new
implementation.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-02-14 19:44:57 +01:00
Olivier Gayot 7dbd0177e4 mirror: add autoinstall tests for apt/mirror version 2
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-02-10 15:43:05 +01:00
Olivier Gayot c46723750b codecs: add ability to install ubuntu-restricted-addons
Subiquity now supports a new endpoint that can be used by the desktop
installer to configure whether the ubuntu-restricted-addons package
should be installed. This package contains third-party codecs commonly
used on a desktop install.

  curl --unix-socket /run/subiquity/socket http://a/codecs
  > {"install": false}

  curl --unix-socket /run/subiquity/socket \
    http://a/codecs -d '{"install": true}'

  curl --unix-socket /run/subiquity/socket http://a/codecs
  > {"install": true}

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-11-04 10:41:03 +01:00
Olivier Gayot 566f32b01e source: don't mark search_drivers required
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>
2022-08-04 10:58:59 +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
Olivier Gayot caff5f7dd7 source: add support for autoinstall data
Since we added a search_drivers checkbox that is uncheckd by default,
there is no longer a way for users to install third-party drivers in an
autoinstall context.

We now implement the autoinstall support for source so that users can
specify what value they want for search_drivers.

Futhermore, to be backward compatible with existing autoinstall
configurations, we now make search_drivers default to true in
autoinstall contexts.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-04-26 13:43:47 +02: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
Olivier Gayot 43f71a02be Improve autoinstall schema for third-party drivers
The autoinstall data for the drivers was only constituted of a boolean,
e.g.:

  drivers: true

or

  drivers: false

It was not immediately clear that the boolean value meant (install/don't
install the drivers).

We now store the boolean in the "install" sub-element instead, e.g.:

  drivers:
    - install: true

  drivers:
    - install: false

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-27 20:16:14 +01:00
Michael Hudson-Doyle b2cd25b299 skeleton of a ubuntu-drivers controller and api
[Olivier Gayot]
 * update copyright year 2018 -> 2022
 * drop explicit inheritance from object

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-02-27 19:26:14 +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
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
Olivier Gayot 76278f4d74 Add support for ubuntu-advantage in autoinstall
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-01-04 17:53:36 +01:00
Dan Bungert e32b7f28ac mirror: add disable_components API 2021-11-23 10:56:43 -07:00
Dan Bungert 8da3df2cd2 schema: remove timezones, and tz schema check 2021-10-19 10:06:01 -06:00
Michael Hudson-Doyle a9d7e46b5f add autoinstall config to choose shutdown mode 2021-08-22 09:36:41 +12:00
Dan Bungert 40945f1823
TimeZone: autoinstall and API (FR-1184) (#986)
* TimeZone: autoinstall and API

Add support for Get/Set timezone methods.  Get means that we inquire
with GeoIP as to which timezone is suggested.  Non-availability of
GeoIP, or a previous explicit Set, means that we return the system
timezone.  Set of timezone by Post results in set of the live system
timzeone, and queuing a set of the target system by way of cloud-init.

* Add clarifying comment about _request.
2021-07-13 06:25:03 -06:00
Michael Hudson-Doyle 9564f9ae52 move kernel package selection to its own controller/model 2021-06-02 13:58:53 +12:00
Dan Bungert a0e2e244bd
add setting policy for post-install updates via autoinstall (#920)
* Add element updates (non-UI)

This can be controlled with autoinstall
updates: security or all

Also an API for controlling this:
curl --silent --unix-socket .subiquity/socket a/updates ->
"security"
curl -d '"all"' --unix-socket .subiquity/socket a/updates

* Automated tests - log grep for default/none/all states

* Enforce possible values on Updates controller

Route all the various get/set thru 2 common functions.
Validate incoming data.
2021-03-31 13:57:53 -06:00
Dan Bungert 2c6474f3cb Lock in current schema
Accidental schema updates are unintended, so enforce that.  Schema
updates that don't break API are fine, we can handle that by manually
regenerating the schema at such time.
2021-03-03 11:31:04 -07:00