Commit Graph

5212 Commits

Author SHA1 Message Date
Carlos Nihelton 09bc1b7386
Ensures this script only runs in WSL
To prevent issues with desktop or server.
2022-09-21 09:26:13 -03:00
Carlos Nihelton 5331268600
Adds the added script to the snap
Following the same path and naming conventions as UDI.
That allows for reuse of the existing snap mounting/bootstrapping
approach.
2022-09-19 14:41:24 -03:00
Carlos Nihelton c0c4b3c7fe
Adds a bootstrapping script for WSL
Where we don't have a proper snapd support.
Approach similar to the one used in UDI.
For the case where we have Subiquity snap, but not UDI.
The script added is a stripped version of the UDI one.

Removed code related to:
 - GTK and GDK;
 - GI repository;
 - Xkb;

 Preserved:
 - Python;
 - XDG directory definitions;
 - font config;
2022-09-19 14:39:39 -03:00
Michael Hudson-Doyle 60d6746a41
Merge pull request #1417 from mwhudson/install-step-refactor
refactor CurtinInstallStep a bit
2022-09-15 08:44:22 +12:00
Michael Hudson-Doyle 37500beaa1 lint 2022-09-14 22:55:55 +12:00
Michael Hudson-Doyle 7d716030b2 apply suggestion from review 2022-09-14 21:44:34 +12:00
Michael Hudson-Doyle 972c59a198 remove unused code 2022-09-14 21:14:17 +12:00
Michael Hudson-Doyle 6d724c0a5b use new flexibility to remove a bit of mystery code from SubiquityModel 2022-09-14 21:11:57 +12:00
Michael Hudson-Doyle c34f0a8bfa make CurtinInstallStep more self-contained 2022-09-14 12:01:00 +12:00
Carlos Nihelton 80869d23f2
Merge pull request #1416 from CarlosNihelton/fix-missing-common
Fix the missing `system_setup.common` error.
2022-09-13 16:18:18 -03:00
Carlos Nihelton 08d4c39387
Fix the missing `system_setup.common` error.
When Subiquity is packaged as its own snap, that subdirectory is not
present.
That is due the lack of an `__init__.py` file.
2022-09-13 15:56:37 -03:00
Olivier Gayot 3aee57f6d0
Merge pull request #1414 from ogayot/fix-ubuntu-pro-not-configured
ubuntu-pro: fixed model not being marked configured on LTS
2022-09-12 17:33:19 +02:00
Olivier Gayot ddddc4356d
Merge pull request #1413 from ogayot/LP#1986674
snaplist: avoid showing snaplist screen on failure
2022-09-12 17:32:41 +02:00
Olivier Gayot 8c7df86c29
Merge pull request #1411 from ogayot/FR-2404
keyboard: fix wrong keyboard layout in initramfs
2022-09-12 17:32:27 +02:00
Olivier Gayot dc272c512b ubuntu-pro: fixed model not being marked configured on LTS
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-09-12 14:46:18 +02:00
Olivier Gayot 3f47c469aa
Merge pull request #1408 from ogayot/ubuntu-pro-mypy
ubuntu-pro: fix type hints for contract selection callbacks
2022-09-12 11:40:16 +02:00
Olivier Gayot 0565e34552
Merge pull request #1412 from ogayot/snaplist-fix-try-again
snaplist: fix crash when pressing "Try again" on snaplist
2022-09-12 11:25:14 +02:00
Olivier Gayot 00801c3b68 keyboard: move setupcon to keyboard model
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-09-12 11:17:54 +02:00
Olivier Gayot dcb2420846 snaplist: avoid showing snaplist screen on failure
When creating the UI for snaplist, if the server returns a FAILED status
when we request the list of snaps, we want to move on to the next
screen.

However, calling self.next_screen in the make_ui function while also
returning an actual view triggers a race condition. Depending on the
order of execution of the instructions (which are asynchronous), the
snaplist view can end up being shown even though we moved to the next
screen. This ends up doing funny things upon clicking done.

Fixed by raising the Skip exception after making sure we mark snaplist
configured.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-09-09 15:11:19 +02:00
Olivier Gayot 3222a04fb4 snaplist: fix crash when pressing "Try again" on snaplist
When pressing the "Try again" button on the snaps list, Subiquity would
crash with:

TypeError: SnapListView.wait_load() takes 1 positional argument but 2
were given

This happens because urwid passes the sender to the callback - which we
need to discard or accept it in the signature.

Fixed by discarding the sender.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-09-09 10:51:04 +02:00
Olivier Gayot 870c99bcce keyboard: fix wrong keyboard layout in initramfs
During the installation, in the curthooks stage, curtin generates the
initramfs. Unfortunately, the generated initramfs did not honor the
keyboard mapping selected by the user during installation. Therefore,
when LUKS encryption is used for the root file-system, the prompt for
the passphrase ignores the keyboard layout set by the user.

To ensure that the initramfs uses the right keyboard layout, the
/etc/console-setup/cached_* files must be updated before the initramfs
gets created. At the beginning of the curthooks stage, we now call
setupcon --save-only in the target to refresh those files if needed.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-09-08 13:13:38 +02:00
Olivier Gayot 003127054f ubuntu-pro: don't use keyword arguments for callables
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-09-07 09:37:01 +02:00
Olivier Gayot da6dd3af41 ubuntu-pro: fix contract-selection callbacks signatures
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-09-07 09:36:56 +02:00
Dan Bungert 76b1faed1a
Merge pull request #1407 from dbungert/curtin-cryptsetup
snapcraft: rev curtin for cryptsetup fix
2022-09-06 18:48:34 -06:00
Dan Bungert 53a97f1156 snapcraft: rev curtin for cryptsetup fix 2022-09-06 18:02:11 -06:00
Dan Bungert e4a7f43658
Merge pull request #1406 from dbungert/lp-1983265-netplan-gateway
network: use routes instead of gateway directives
2022-09-06 17:35:20 -06:00
Dan Bungert 9e0a90fc22 network: use routes instead of gateway directives 2022-09-06 16:44:12 -06:00
Dan Bungert 9a651f57de
Merge pull request #1405 from CarlosNihelton/fix-api-test
Respects the output base dir on server.spawn() on API tests
2022-09-02 08:51:43 -06:00
Carlos Nihelton 73b9190a59
Respects the output base dir on server.spawn()
On API tests
2022-09-02 09:17:07 -03:00
Dan Bungert 3ec022f54b
Merge pull request #1404 from dbungert/fix-wipe
filesystem: restore previous wipe behavior
2022-09-01 15:26:12 -06:00
Dan Bungert 9aec674904 filesystem: restore previous wipe behavior 2022-09-01 15:12:57 -06:00
Dan Bungert 24ec78c670
Merge pull request #1359 from blackboxsw/cloud-init/validate-user-data-schema
subiquitymodel: validate merged cloud-config userdata_raw before reboot
2022-09-01 13:48:14 -06:00
Chad Smith 069f0c76a7 subiquity.controllers.userdata: validate autoinstall.user-data schema
Raise SchemaValidationError when any autoinstall.user-data config
is invalid cloud-init cloud-config schema.

If any deprecated config keys or values are provided under
autoinstall.user-data, log warnings about those deprecations.
2022-09-01 13:12:53 -06:00
Chad Smith 1e0291e5df subiquitymodel: validate merged cloud-config userdata_raw before reboot
Raise SchemaValidationErrors when invalid config is provided to
cloud-init as merged cloud-config for the installed target.

Log warnings if any deprecated cloud-config keys are present in
merged cloud-config.
2022-09-01 13:12:53 -06: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 cada41d7b9
Merge pull request #1396 from dbungert/no-double-jsonschema
snapcraft: remove dupe jsonschema
2022-09-01 12:37:22 -06:00
Dan Bungert 2929bb481b
Merge pull request #1386 from dbungert/lp-1983036-edit-part-wipe
filesystem: fix wipe on v2 edit_partition
2022-08-30 15:34:33 -06:00
Dan Bungert 96636fe3ff filesystem: fix add_partition wipe value 2022-08-30 12:47:55 -06:00
Dan Bungert 48d90d8b15 filesystem: fstype compare against orig fstype 2022-08-30 12:47:42 -06:00
Dan Bungert 02d2d44bae filesystem: edit require wipe on fstype change 2022-08-30 12:47:42 -06:00
Dan Bungert 590eb3a40c filesystem: edit_partition comment fixup 2022-08-30 12:47:42 -06:00
Dan Bungert aa0e6f34c7 filesystem: extend test for the unwipe case
Add test for the case where a user marks a partition with data as one to
be formatted, then later undoes that operation.
2022-08-30 12:47:42 -06:00
Dan Bungert 25f4ac0bc2 filesystem: fix wipe on v2 edit_partition 2022-08-30 12:47:42 -06:00
Dan Bungert 943ea53fbc
Merge pull request #1402 from dbungert/terminology
fix some easier cases of impolite language
2022-08-29 18:00:35 -06:00
Dan Bungert 1cbcbb7e3c
Merge pull request #1403 from dbungert/yaml-normalize
Yaml normalize
2022-08-29 17:35:23 -06:00
Michael Hudson-Doyle 60953951fe
Merge pull request #1394 from CarlosNihelton/style-help-gray
Defaults help text style to gray
2022-08-30 11:34:42 +12:00
Dan Bungert 80d6c7c09d snapcraft: normalize 2022-08-29 13:54:51 -06:00
Dan Bungert b9f75059be scripts: add yaml-normalize.py 2022-08-29 13:54:51 -06:00
Dan Bungert d73772258d fix some easier cases of impolite language 2022-08-29 12:30:39 -06:00
Carlos Nihelton 68b92f1022
Merge pull request #1400 from CarlosNihelton/optional-controller
Sets WslSetupOptions as an optional controller
2022-08-29 14:00:07 -03:00