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>
When running integration tests, the LANG variable in
.subiquity/etc/default/locale is unquoted. The pattern that we use
expects quotes so it does not match.
Fixed by making the test work with or without quotes.
In case quotes are not present, the final part of the pipeline will fail
to find a delimiter so it will print the line unchanged
excerpt from cut(1)
-f, --fields=LIST
select only these fields; also print any line that contains
no delimiter character, unless the -s option is specified
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Looking at the logs, we can observe that the below command does
not do what it is intended to do:
if [ -z "$( ls .subiquity/var/cache/apt/archives/) | grep $lang" ] ; then
++ ls .subiquity/var/cache/apt/archives/
+ '[' -z 'language-pack-en:amd64
wamerican:amd64
wbritish:amd64 | grep ' ']'
The "| grep $lang" part does not execute because it is outside the $()
construct. Therefore, the -z check is always false.
We can fix it by moving the "| grep $lang" part inside the subshell
construct but I took the opportunity to drop the use of the subshell.
Also added --fixed-strings and --quiet options to grep.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
* The mixture of storage for disable_components in and out of the config
dict was confusing and caused bugs, depending on the flow
* disable_components now solely lives in the dict, like other items
* fix several syntax errors
* missing 'this' item was renamed to 'iso'
* change the simulated 'bash -x' output to stderr
* use shlex functions for join/split
Although the script is running with -e, having two distinct invocations
of a subshell in the same instruction masks failures in the first
subshell invocation. It is similar in essence to what the pipefail
option controls.
As a consequence, the following instruction does not fail if distro-info
is not installed:
isoname=$(distro-info -d)-live-server-$(dpkg --print-architecture).iso
And therefore, we end up with something like:
isoname=-live-server-amd64.iso
Fixed by first assigning the value of $(distro-info -d) to a variable.
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
- This is a cleanup for SystemSetup per DEENG-134 and DEENG-139
- Default user should be set by the WSL launcher.
- Shutdown/reboot actions also.
- Added a structured form of communication between OOBE and launcher.
- /run/launcher-command
- Useful for develop env.
- Mimics the CI while avoiding downloading images all the time.
- Instance names change from 'tester' to the Ubuntu release adjective.
- lxc will only download if there is no local instance with that name.
- Useful for preserving matrix build instances.
pytest-3 lets us set exclude directories, which is helpful with the
desired API testing to seperate them from 'unittest discover' so that we
can keep unit test runtime short.
The behaviour of python regarding asynchronous packages changed between
18.04 and 20.04+. OOBE is only supported on 20.04 and higher and there
is no point in making the WSL specific code compatible with ealier
releases than 20.04
Co-authored-by: Didier Roche <didrocks@ubuntu.com>
It also adds an argument --ignore-tz to the schema comparison test to
not fail on system where the schema has no TZ like WSL.
Co-authored-by: Didier Roche <didrocks@ubuntu.com>
Adding "--quiet" as additional option to "lszdev" - here more for the reason of completeness and for consistency reasons.
The relevant change for solving LP#1944516 is the change in subiquity/server/controllers/zdev.py
* remove a stray space
* remove an extra call to check-yaml-fields.py, which can accept a list
of directives
* remove an entire redundant autoinstall run that I added as part of
bitlocker work but isn't actually verified in any way other than not
timing out
a while ago I rewrote inject-subiquity-snap in python, generalized it
and put it at https://github.com/mwhudson/livefs-editor. TBH, it's
always been better than the shell version but now there's a reason to
switch to it: the impish live server ISO use layers, which the current
shell scripts do not support and livefs-editor now does.
* Add new schema comparison, robust to timezone changes
Improve the schema comparison - mostly I'm worried about the
non-timezone items, spot check the timezone list for a few that should
be there.
* Incorporate feedback - pop
Impish is adding more timezones, which is cool, but breaks my schema
check, so disable this there for now and come back later with a better
answer.
Also schema check seems to need curtin.
* 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.
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.
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.
* 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.
Continuing the theme of previous work, this branch parses pc105.tree
into API-friendly attr-based classes at snap build time (which also lets
us check some constraints then and not at run time).
This is a bit sideways from the real thing I'm working on which is
moving most of the logic of keyboard handling to the server side but
anyway. This also lets me check some assumptions while processing the
data rather than in the view code.
The first of these scripts mashes the current branch's code over that of
a pre-existing subiquity snap.
The second uses the first to mash the current branch's code over the
subiquity snap from an ISO and then creates a new ISO with this new
snap.
It's all a bit terrifying but being able to get your changes into a
bootable ISO in about 30s is quite a large improvement on building the
snap from scratch.
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.