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.
update requires root access to the machine and there is no --simulate
option so skip it in dry-run mode.
Co-authored-by: Didier Roche <didrocks@ubuntu.com>
UDI sets the SNAP env var to '.' for development purposes.
See: https://github.com/canonical/ubuntu-desktop-installer/commit/9eb6f04
It is unlikely that under test or production that env var will
ever by just '.'. On the other hand in dry-run we want this controller
to interpret it as '/' if not properly set, thus discarding the '.'.
It seemed far too much complicated find the proper way to deal with
apt Python library under the snap environment.
Opted for running the system apt command without the LD_*
customisations, similar to what an installer does when chroot into the
taget system.
This allows for running subprocess outside of the snap environment.
Both functions now receive a custom env without the LD_ related vars.
Renamed _create_user() to create_user() to make explicit that it has the
same semantic level as apply_locale().
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>
Tests in real WSL2 environment revealed that update-locale checks fails but with the "--no-checks" option it updates the locale files accordingly and when the image restarts the locale is correctly set.
Also, splits part of the configure() method:
- `__query_uid()` finds the username UID
- `_create_user()` creates the user set in IdentityModel
- Both methods accept a fake root path under dryrun.
The check-language-support on my machine was providing a single empty
newline as output, and the length check isn't catching that as the
resulting packages array has a value of [''].
Drop empty values from the list to avoid a "KeyError: ''" exception.
Those commands needs to be async to be able to still answer GET/POST
request while configure is running.
This allows showing up the summary page immediately.
Co-authored-by: Jean-Baptiste Lallement <jean-baptiste@ubuntu.com>
- With 'prefill' working, calling Powershell to find Windows locale
is not required anymore.
- Since `f21986be` subiquity's default locale controller respects
mode.selected_language initialization.
1. rebase with main and update autoinstall-system-setup.yml
2. provide a more unified indent style
3. update get_userandgroups() to the dropped one
4. fix the problematic os action
5. simply asignments
6. assign default_loader a default value
7. provide a type-to-file dict in wsl_conf
8. provide stderr info when providing error in creating user
9. update schema and example files