Commit Graph

2103 Commits

Author SHA1 Message Date
Michael Hudson-Doyle 7f1beb1d64 add a mode argument to shutdown to allow reboot or power off 2021-08-22 09:36:41 +12:00
Michael Hudson-Doyle a2675b6ca6 add an immediate parameter to request immediate reboot 2021-08-22 09:36:41 +12:00
Michael Hudson-Doyle fc39247073 rename "reboot" controller/endpoint to "shutdown" 2021-08-22 09:36:41 +12:00
Michael Hudson-Doyle c75ff1fccf
Merge pull request #1021 from mwhudson/variant-flexibility
redo how install variant determines which models to wait for
2021-08-17 16:08:54 +12:00
Dan Bungert a688b37a6f Add /storage/has_bitlocker convenience API 2021-08-09 10:41:54 -06:00
J-P Nurmi b2794ebfef
Specify a large keepalive timeout to help UDI stay connected (#1022) 2021-08-06 09:49:02 -06:00
Michael Hudson-Doyle a5ae411c55 allow app state transition from NEEDS_CONFIRMATION to WAITING
consider the following scenario, admittedly one that is not possible
today:

 * There is an "install model" that is required for server and not
   desktop (let's say "mirror")
 * The user initially selects a desktop install and moves through the
   screens until they are asked for confirmation.
 * At this point the user moves back through the screens and selects a
   server variant.  Now the application state of NEEDS_CONFIRMATION is
   misleading; the state needs to move back to WAITING until the mirror
   model is configured.

This is all probably excessively general but I feel like the core
control flow of the installer needs to be able to handle this sort of
thing...
2021-08-05 16:19:12 +12:00
Michael Hudson-Doyle 9080a56804 tweak when x-status: confirm gets sent 2021-08-05 16:18:18 +12:00
Michael Hudson-Doyle e7d2959625 have SubiquityModel know which models are required for which variants 2021-08-05 16:17:48 +12:00
Michael Hudson-Doyle fdd1879d50 adapt SubiquityModel api to allow a bit more flexibility 2021-08-05 13:41:05 +12:00
Michael Hudson-Doyle 0bc2cf4a95
Merge pull request #1014 from dbungert/with-open
Convert a bare open() call to with open()
2021-08-04 14:43:22 +12:00
Michael Hudson-Doyle 3152e5ce13 fix adding a partition to an existing raid
found this by mistake by accident when trying to test something else...
2021-08-03 14:09:38 +12:00
Dan Bungert 18a00153bd Convert a bare open() call to with open() 2021-08-02 11:53:13 -06:00
Dan Bungert 2940bfeb76
In dryrun, run simulated curtin with same python (#1009) 2021-07-21 10:42:24 -06:00
Dan Bungert 7808ccac84 GET /timezone no longer sets to system
The original design for timezone intentionally set the system timezone
based on geoip results, before a POST /timezone.  After the feedback on
LP: #1936310 I'm having second thoughts on that and wish for GET to be
a simple informational query with no such side effects.
2021-07-15 13:02:22 -06:00
Dan Bungert c79aa602dc Proper fix for setting timezone inappropriately in dryrun
Reenable integration test for set of timezone.
Don't set it while in dryrun.
2021-07-15 10:49:32 -06:00
Dan Bungert ada889328d Verify that machine-config arg is a file
If machine-config is pointed to a non-existant file, dryrun can kind of
unhelpfully hang without much indication that anything is happening.
2021-07-14 16:40:22 -06:00
Dan Bungert 9f883ff0f7
Add missing configure on timezone POST (#1003) 2021-07-13 19:36:10 -06:00
Dan Bungert 1d770ef2ef Switch to lookup from SNAP to SUBIQUITY_ROOT
Subquity looking up various resources from SNAP is causing problems for
ubuntu-desktop-installer.  Hide this detail away with SUBIQUITY_ROOT so
that other clients don't have to do magic with the SNAP env variable.
2021-07-13 16:15:37 -06:00
Dan Bungert 4cbfb7f18f
Abstract resource file lookup relative to SNAP (#998)
* Abstract resource file lookup relative to SNAP

Using SNAP to find the resource files is a bit of an odd requirement for
non-subiquity clients.  Start abstracting that away so it's easier to
change later.

Also move loadkeys to lookup from this, since the previous solution is
still a problem for ubuntu-desktop-installer.

* Move loadkeys / configure-apt to bin

loadkeys / configure-apt are in usr/bin only when we specially put them
there by way of snapcraft, which makes things a little harder on
non-subiquity clients.  Move them to bin, which is to say don't have
snapcraft put them in usr/bin.
2021-07-13 16:14:31 -06: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 916ee7516e add an imsm integration test 2021-07-07 08:40:33 +12:00
Michael Hudson-Doyle f5e8359226 do not offer components of imsm containers with volumes as guided options 2021-07-07 08:40:33 +12:00
Michael Hudson-Doyle dfe36d7617 support imsm volumes as boot devices 2021-07-07 08:40:33 +12:00
Michael Hudson-Doyle 7cfd5e42ab support display and some actions for imsm raid arrays and volumes 2021-07-07 08:40:33 +12:00
Michael Hudson-Doyle 8e253fb955 remove some apps from the snapcraft.yaml 2021-07-02 11:59:21 +12:00
Dan Bungert 5b54579d24
Unhardcode path to subiquity-loadkeys (#994)
With multiple users of subiquity in different ways, this may not be
always available at this specific location.
2021-07-01 17:45:37 -06:00
Dan Bungert f57b3d1f61 Default selected_language to en_US if LANG is not helpful 2021-07-01 17:26:21 -06:00
Dan Bungert 90b1bb9eed
Refactor - drop external_temp_file (#985)
Move unattended-upgrades to part of postinstall, so it can be done
before the restore_apt_config umount, which lets us get rid of the
redundant external_temp_file logic.
2021-06-28 17:11:49 -06:00
Michael Hudson-Doyle edb101cf2a
Merge pull request #993 from mwhudson/lp-1933711
allow a mount action to not have a device
2021-06-29 11:03:44 +12:00
Michael Hudson-Doyle 7de63e7aae allow a mount action to not have a device
for https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1933711
2021-06-28 10:49:46 +12:00
Michael Hudson-Doyle 067c3a949b make two FilesystemModel helper methods slightly more general
so I can adapt a call to not require changes when imsm volumes become
possible boot devices
2021-06-25 13:52:29 +12:00
Michael Hudson-Doyle 16d34299b2
Merge pull request #989 from mwhudson/old-raid-size
for an existing raid, read the size out of udev data rather than guessing
2021-06-25 08:55:21 +12:00
Michael Hudson-Doyle 71810263b0 remove a method that got missed in some previous branch 2021-06-24 19:32:26 +12:00
Michael Hudson-Doyle ac964b4312 for an existing raid, read the size out of udev data rather than guessing 2021-06-23 15:12:16 +12:00
William Entriken 5876f7e770 Correct spelling of GitHub 2021-06-15 15:08:36 -04:00
Dan Bungert 6a189dd598
Add EventCallback, and move mirror task things to GeoIP (#983)
Move mock_app to common location.
Move run_coro to subiquitycore so that subiquitycore doesn't have to
reference things in subiquity, even for test.
Move task tracking things from mirror to geoip.
Server app owns the geoip instance.
Create EventCallback as an alternative to MessageHub that should
hopefully express clearer intermodule dependencies.
2021-06-14 16:05:27 -06:00
Michael Hudson-Doyle 83d076975d
Merge pull request #979 from mwhudson/install-wpasupplicant-on-demand
install wpasupplicant when a wifi nic is seen
2021-06-10 12:54:09 +12:00
Dan Bungert 6aa33ecddc
GeoIP: split out, add timezone (#981)
Split GeoIP out to a distinct class.
Add timezone support to it.
Add GeoIP tests.
2021-06-09 18:44:47 -06:00
Michael Hudson-Doyle ef008f4aea address review comments 2021-06-10 12:32:29 +12:00
Michael Hudson-Doyle fa9628f34c remove support from network model for filtering out wlan devices 2021-06-09 13:00:43 +12:00
Michael Hudson-Doyle f2aa174b76 install wpasupplicant in the target system if it was installed in live system 2021-06-09 13:00:43 +12:00
Michael Hudson-Doyle 907e7dd7b0 implement UI for tracking wpasupplicant install state
this should perhaps be in the subiquity package vs subiquitycore somehow
but that seems hard.
2021-06-09 13:00:43 +12:00
Michael Hudson-Doyle 7bb9af41d8 add wpasupplicant-install-state tracking to API
absolutely minimal client side implementation
2021-06-09 13:00:43 +12:00
Michael Hudson-Doyle 6a37ab9733 do not show wlan nics to client until wpasupplicant is installed 2021-06-09 13:00:43 +12:00
Michael Hudson-Doyle 429155d1c4 start installing wpasupplicant when we see a wlan nic 2021-06-09 13:00:35 +12:00
Dan Bungert 21058464fd
make_cloudconfig - start moving cloud config generation to models (#975)
Add make_cloudconfig as a function that models should offer that allows
for generation of the cloud-config snippet.
Move snaplist and locale to this mechanism.
Add a test for snaplist output.
2021-06-08 16:54:29 -06:00
Dan Bungert 86b087eb4b
Add client_variant (#976)
We need to know which controllers to block on, and which are optional.
The mechanism, for now, is this client_variant functionality, which adds
a mandatory early API call that the client shall use.  This allows
controllers to say that they are only required to be configured for
certain install clients, such as is necessary for timezone (which is
needed on desktop, and optional on server).
2021-06-08 16:06:32 -06:00
Michael Hudson-Doyle 861295b192 add a comment about why we only split out the wifi config 2021-06-09 09:57:25 +12:00
Michael Hudson-Doyle 9c93f2b0e1 write any wifi config to a file only readable by root 2021-06-08 10:00:44 +12:00