Commit Graph

215 Commits

Author SHA1 Message Date
Chris Peterson d520382f72 apport: update names and write traceback information to disk 2023-10-21 00:50:21 -07:00
Dan Bungert c08fdab2f8 one-off format of long lines with black 2023-07-25 15:27:49 -06:00
Dan Bungert 34d40643ad format with black + isort 2023-07-25 15:27:42 -06:00
Dan Bungert ff8d890f2a system_setup: fix lint
black will reformat this in a manner that trips flake8.
2023-07-25 15:25:55 -06:00
Dan Bungert 50c7ff3d36 shutdown: add pre-shutdown pubsub channel 2023-06-08 12:06:45 -06:00
Carlos Nihelton 2e67005403
Fixed paths for lsc and locales commands
Subiquity snap doesn't stage language-selector-common nor locales
packages.
Attempting to run those commands require respecting the env previously
prepared by the caller, as well as fixing the commands paths
(or changing the PATH env var in the env preparation step).
Since the apt commands were already ran with a fixed path,
I'm applying the same principle in here.
Yet, for now, Jammy doesn't ship the l-s-c package seeded,
so a condition was preserved to avoid future crashes.
2023-04-13 16:11:05 -03:00
Carlos Nihelton 1105da2368
Falls back to seeded l-s-c
UDI snap ships the package, thus its data dir is part of the snap
subiquity snap does not.
This tries l-s-c data dir in the base system, outside of the snap
and gives up if the dir does not exits.
2023-03-24 11:54:44 -03:00
Olivier Gayot 9b18f45700 snapcraft: upgrade to core22
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-03-16 12:21:44 +01:00
Dan Bungert 9d12871f15 many: s/create_task/run_bg_task/
create_task has the following note:
  Important: Save a reference to the result of this function, to avoid a
  task disappearing mid-execution.

Convert existing usage of create_task to run_bg_task, if that
create_task is not actually storing the result.
2023-02-13 14:56:07 -07:00
Carlos Nihelton d3099728ea
Merge pull request #1534 from CarlosNihelton/fix-none-wslsetupoptions
Fix wslsetupotions being None
2023-01-13 06:56:14 -03:00
Carlos Nihelton 41a2427704
Fix wslsetupotions being None
Recent changes in GUI turned possible to have that field as None,
leading to a crash.
This avoids the crash while preserving the default behavior of
installing the language packs.
2023-01-12 16:57:52 -03:00
Carlos Nihelton 5319633d78
Makes the wsl_conf imune to None 2022-12-16 13:28:11 +00:00
Carlos Nihelton 4f0b45798b
Answers no longer relevant for wsl_setup
Integration tests on wsl_setup variant should not write wsl.conf.
2022-12-16 13:28:11 +00:00
Carlos Nihelton 3e04dab619
Interactive wsl_setup no longer writes wsl.conf
That variant would only apply configs if in autoinstall.
There are no more screens available related to those settings in
wsl_setup.
Reconfiguration variant is the only one able to write that file.
2022-12-16 13:28:10 +00:00
Carlos Nihelton 0540c521fe
Moves WslConfBase to the reconfiguration workflow 2022-12-16 13:28:10 +00:00
Carlos Nihelton 1647a98ce3
Removes the now unused install_running
variable and module.
2022-12-09 11:59:31 +00:00
Carlos Nihelton 6d6e1e7854
Removes the switch to shell widget
From the summary controller when installation is in progress.
The shell is inoperable on WSL due the fake snap environment.
2022-12-09 11:44:08 +00:00
Michael Hudson-Doyle 85b3cd0724 switch from loop.create_task to asyncio.create_task
mostly done with sed
2022-11-08 10:08:46 +13:00
Olivier Gayot fa351ed7bc
Merge pull request #1446 from ogayot/pr/event-loop-rework
Stop calling deprecated asyncio.get_event_loop() function
2022-10-28 17:50:24 +02:00
Olivier Gayot 638e2cbfbf loop: fix setuptools entry-points not using asyncio.run
setuptools declares a certain number of entry points that use the main
function of the associated component. That said, now that main is an
async function, it does not work. There seems to be no way to tell
setuptools to wrap the call to the entry point with asyncio.run so we
need to revert to a synchronous main function.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-10-28 17:05:54 +02:00
Olivier Gayot a62a0b6002 loop: start running the event loop before doing anything else
This allows us to use asyncio.run() and to avoid many pitfalls.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-10-28 17:05:54 +02: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
Edu Gómez Escandell b939b0e552 Fix 2022-09-27 14:13:36 +02:00
Carlos Nihelton ef5984b1be
Merge pull request #1427 from CarlosNihelton/2stage-snap-wsl-87
[WSL] Two stage snap launching
2022-09-21 21:05:29 -03:00
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 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
Carlos Nihelton 2a598a8b5d
[WSL] Fixes wrong paramters being passed ...
to the WSLSetupOptions controller.

Misuse of the default_loader().
That's meant for loading /etc/wsl.conf.
WSLSetupOptions is by design not related to that config file.
2022-09-15 17:12:03 -03:00
Carlos Nihelton b4734ad587
Makes the default_loader for wsl.conf testable 2022-09-15 16:24: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
Carlos Nihelton c08ebef9df
Removes the controller name from the required set
INSTALL_MODEL_NAMES
2022-08-29 12:15:52 -03:00
Carlos Nihelton 86d19c6259
Sets WslSetupOptions as an optional controller
We have strong defaults, so the clients should only need to POST if
the desired options are not the default ones.
2022-08-29 12:15:29 -03:00
Carlos Nihelton 69934729da
Removes forgotten log statement. 2022-08-26 16:09:02 -03:00
Carlos Nihelton 912b9dd416
Sets the help colors to gray
Per Design's recommendation:
See https://github.com/canonical/ubuntu-desktop-installer/issues/1073#issuecomment-1224493840
2022-08-24 09:07:30 -03:00
Carlos Nihelton 1fab813d8a
DEENG-378 Uses the cached native lang descript...
...tion to format the checkbox caption
2022-08-23 11:30:12 -03:00
Carlos Nihelton 1d9b7449d3
Fixes linting warnings 2022-08-23 10:45:34 -03:00
Carlos Nihelton 20b60d6f98
Connects the new controllers to server and client.
Higher level constructs are now aware of the new endpoint.
2022-08-23 10:45:34 -03:00
Carlos Nihelton fdc43496f5
Implements client and server ...
... for WSL Setup Options

Both controllers and UI
2022-08-23 10:45:34 -03: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 91870c8214 meta/status: replace POST_WAIT and POST_RUNNING by generic states
With the plan to call curtin multiple times where each invocation has a
specific purpose, we want the client to have a simple way to monitor the
status of the installation.

Instead of defining new application states for each stage, we will
report the more generic WAITING / RUNNING states in a loop until we get
to the final stages of the installation.

To start with, we are dropping POST_WAIT and POST_RUNNING in favor or
WAITING and RUNNING.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-07-22 10:51:01 +02:00
Olivier Gayot 384e4b62ac ui: move confirmation mechanism in subiquitycore.ui
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2022-06-24 17:24:20 +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
Carlos Nihelton 347e6e640e
Better help message for system setup 2022-06-16 16:15:16 -03:00
Carlos Nihelton 7e94f78c0a
Enhance comment and fix typo on it. 2022-06-07 13:27:15 -03:00
Carlos Nihelton 061efddec2
Missed linter warnings. 2022-06-06 17:57:00 -03:00
Carlos Nihelton eff558c8ad
Enables TCPSite for WSL
It listens on 127.0.0.1 only.
2022-06-06 17:42:49 -03:00
Michael Hudson-Doyle 3d1c8fd6cf convert SubiquityServer.kernel_params to an overengineered class 2022-06-02 08:56:32 +12:00
Didier Roche 95bee59dee
Merge pull request #1303 from CarlosNihelton/wsl-locgen-speedup
[system_setup] Allow skipping locale-gen command
2022-05-31 14:08:07 +02:00
Carlos Nihelton 5a8e2f2835
Allow skipping locale-gen command.
lang-packs post-install hook executes locale-gen.
For certain languages a matrix of locales is generated.
Re-running locale-gen regenerates not only the locale we wanted,
but the whole matrix, causing further delays.

We can save up to 40s (tested on my laptop) by skipping locale-gen if
apt succeeded.

Still useful to run it unconditionally i dry-run since apt won't execute
any post-install hook.
2022-05-31 08:22:41 -03:00
Carlos Nihelton 87112ebecf
Sets TUI about help message on super init. 2022-05-26 07:37:35 -03:00
Carlos Nihelton 3c27982939
Programmatic manipulation of the lsb fields
For better message composition.
2022-05-24 14:25:34 -03:00