Commit Graph

6729 Commits

Author SHA1 Message Date
Dan Bungert e3b0805d3c
Merge pull request #1988 from dbungert/test-apt-mountpoint-install-tree
apt: fix mountpoint-install-tree test write dir
2024-05-01 18:21:11 -06:00
Dan Bungert acf88ac452 apt: fix mountpoint-install-tree test write dir
test_run_apt_config_check currently writes to curdir, update that to a
tempdir instead.
2024-05-01 16:30:56 -06:00
Michael Hudson-Doyle e1ca8731c7
Merge pull request #1986 from mwhudson/begin-relicensing
relicense code outside of subiquity to GPLv3-only
2024-04-30 09:58:40 +12:00
Michael Hudson-Doyle 9ff9d6c36f use newer version of AGPL-3 (very minor changes) 2024-04-30 09:58:15 +12:00
Dan Bungert a73d997b5d
Merge pull request #1983 from dbungert/lp-2063252-cryptsetup-warns
filesystem: swap options
2024-04-29 15:18:28 -06:00
Michael Hudson-Doyle 34afb5b40c update license headers outside of subiquity package 2024-04-29 09:28:40 +12:00
Michael Hudson-Doyle 295b0455c2 update license metadata 2024-04-29 09:22:04 +12:00
Dan Bungert 389a50e194
Merge pull request #1982 from dbungert/quick-test-udb
quick-test: handle ubuntu-desktop-bootstrap
2024-04-26 12:16:17 -06:00
Dan Bungert 129623cc6b quick-test: handle ubuntu-desktop-bootstrap 2024-04-26 11:51:02 -06:00
Olivier Gayot 65f8ef50d4
Merge pull request #1981 from ogayot/utcnow
Replace deprecated uses of datetime.datetime.utcnow
2024-04-26 15:58:47 +02:00
Olivier Gayot 1d7c7c051c
Merge pull request #1978 from ogayot/restricted-block-probing+nvme
filesystem: probe NVMe controllers when running the restricted probe
2024-04-26 09:14:05 +02:00
Dan Bungert 3f2529bc49 filesystem: swap options
Under some plymouth configs, cryptsetup shows warnings on boot for
underspecified cryptoswap options.  This makes the warnings go away, but
we've hardcoded some options that may change in the future.

LP: #2063252
2024-04-25 18:30:05 -06:00
Olivier Gayot c18d434439 file-util: replace use of deprecate datetime.datetime.utcnow()
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-25 17:51:14 +02:00
Olivier Gayot fa8e49457b ubuntu-advantage: compare date from two /aware/ datetime objects
The current implementation attempts to compare two datetime objects
by comparing the value returned by .timestamp().

However, one of the objects is an /aware/ datetime and the other is a
/naive/ datetime.

When calling .timestamp() on a naive datetime object, the function
expects the datetime object to represent local time. However, in our
scenario, it was UTC time.

Therefore, the comparison is slightly inaccurate and can end up
rejecting a token that is not yet expired ; or accepting one that is
about to expire.

In practice, this should rarely be a problem (a few hours is not a big
deal). But we now compare two /aware/ datetime objects to make the
comparison more correct.

Also, datetime.datetime.utcnow() (which returns a naive datetime object)
is deprecated in favor of datetime.datetime.now() (which can return an
aware datetime object if timezone information is passed).

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-25 15:59:56 +02:00
Olivier Gayot 4695078c84 ubuntu-advantage: mention that fromisoformat can handle Z suffix in Python >= 3.11
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-25 15:53:39 +02:00
Dan Bungert 26bc08b694
Merge pull request #1979 from Chris-Peterson444/24.04.1-release-pics
doc: autoinstall release notes pictures
2024-04-24 17:36:47 -06:00
Chris Peterson f3e1d6977e doc: autoinstall release notes pictures 2024-04-24 16:34:30 -07:00
Olivier Gayot 92a47635d8 filesystem: probe NVMe controllers when running the restricted probe
If block probing times out, we rerun it with the restricted set of
probes. Sadly, the restricted set does not include "nvme" so we do not
enumerate NVMe controllers. This leads to the following error if NVMe
storage devices are present:

  File "subiquity/models/filesystem.py", line 1492, in reset
    self.process_probe_data()
  File "subiquity/models/filesystem.py", line 1512, in process_probe_data
    self._orig_config = storage_config.extract_storage_config(self._probe_data)[
  File "/site-packages/curtin/storage_config.py", line 1420, in extract_storage_config
    tree = get_config_tree(cfg.get('id'), final_config)
  File "/site-packages/curtin/storage_config.py", line 313, in get_config_tree
    for dep in find_item_dependencies(item, sconfig):
  File "/site-packages/curtin/storage_config.py", line 283, in find_item_dependencies
    _validate_dep_type(item_id, dep_key, dep, config)
  File "/site-packages/curtin/storage_config.py", line 230, in _validate_dep_type
    raise ValueError(
ValueError: Invalid dep_id (nvme-controller-nvme0) not in storage config

Fixed by also enumerating NVMe controllers as part of the restricted
probe operation.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-23 09:46:39 +02:00
Dan Bungert dbcf723676
Merge pull request #1977 from dbungert/lp-2063059-ai-codecs
doc: fix indent in reference of codecs.install
2024-04-22 07:35:05 -06:00
Dan Bungert 2afd7f2fa5 doc: fix indent in reference of codecs.install 2024-04-21 18:08:49 -06:00
Dan Bungert 74c37fe0c2
Merge pull request #1976 from ogayot/curtin-string-interpolation
snapcraft: bump curtin rev for ZFS string interpolation fix
2024-04-17 08:23:42 -06:00
Olivier Gayot 4bbab28588 snapcraft: bump curtin rev for ZFS string interpolation fix
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-17 14:50:10 +02:00
Olivier Gayot aaf0d56472
Merge pull request #1968 from ogayot/server-ignore-mirror-test-offline
mirror: if the mirror test fails, suggest an offline install
2024-04-17 10:12:55 +02:00
Olivier Gayot 0bb4915c9f mirror: if mirror test fails, suggest an offline install
In the mirror screen, if the test fails and the user decides to ignore
the failure, we used to continue the installation normally ; which in
most scenarios resulted in an error at a later stage of the
installation.

Instead, we now revert to an installation without network (i.e., only
packages from the pool are considered for installation) if the user
decides to ignore the failure.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-17 09:57:15 +02:00
Dan Bungert ac60b184ff
Merge pull request #1975 from ogayot/v2-systems-log-error
storage: log snapd response text when v2/systems/{system} or v2/snaps/{snap} fails
2024-04-16 16:53:47 -06:00
Olivier Gayot b2f9ce3649 refresh: log snapd response text when v2/snaps/{snap} fails
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-16 14:59:37 +02:00
Olivier Gayot 3e9d9762fb storage: log snapd response text when v2/systems/{system} fails
When the request to v2/systems/enhanced-secureboot-desktop (or
equivalent) fails, Subiquity did not capture the reason. This makes
it difficult to understand why this call sometimes fails. We now log the
response text to understand better what's going on.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-16 14:03:01 +02:00
Dan Bungert 2550aaa7ea
Merge pull request #1974 from dbungert/quiet-splash
curtin: desktop grub.replace_linux_default False
2024-04-15 17:21:47 -06:00
Dan Bungert ecfe394bd0 curtin: desktop grub.replace_linux_default False
Grub provides "quiet splash" for GRUB_CMDLINE_LINUX_DEFAULT out of the
box, but curtin rewrites that value and drops both "quiet" and "splash".
On desktop, retain "quiet splash".

This should be configurable via autoinstall if this change is undesired.
2024-04-15 15:55:41 -06:00
Dan Bungert 5226839467
Merge pull request #1973 from dbungert/lp-2057661
snapcraft: rev for more zfs / udev fixes
2024-04-15 08:11:01 -06:00
Dan Bungert 26d1e197eb snapcraft: rev for more zfs / udev fixes 2024-04-14 11:40:22 -06:00
Dan Bungert 75200b8091
Merge pull request #1971 from ogayot/fallback-offline-install-by-default
mirror: switch default policy to OFFLINE_INSTALL by default
2024-04-12 08:19:48 -06:00
Olivier Gayot 01338fae05 mirror: switch default policy to OFFLINE_INSTALL by default
Automated installations and desktop installations will now switch to an
offline installation by default. In this mode, only packages from the
pool will be fetched.

This should allow the installation to proceed when installing from a
private network without external access to the internet.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-12 14:37:02 +02:00
Olivier Gayot 01f4db5894
Merge pull request #1970 from dbungert/lp-2060695-dpkg-grub
models/subiquity: disable cc_dpkg_grub
2024-04-12 10:08:48 +02:00
Dan Bungert 037a8c2ece models/subiquity: disable cc_dpkg_grub
On first boot, there appear to be cases where the cc_dpkg_grub module in
cloud-init is not doing the right thing, which are to be sorted out.
But for first boot to happen we have a working boot config, so let's not
perturb that.

LP: #2060695
2024-04-11 16:47:43 -06:00
Dan Bungert 1b7fc279ec
Merge pull request #1967 from dbungert/doc-makefile
Doc makefile
2024-04-11 08:13:18 -06:00
Dan Bungert 13d68ecf89 pre-commit: simplify spelling invocation 2024-04-11 08:10:14 -06:00
Dan Bungert 1dd2388def doc: fix Makefile dependencies 2024-04-11 08:10:14 -06:00
Dan Bungert 2821206661
Merge pull request #1966 from dbungert/lp-2057837-home-dataset
filesystem: datasets for /root and /home
2024-04-11 08:09:13 -06:00
Dan Bungert 19ca4b7901 filesystem: datasets for /root and /home
Partial implementation of LP: #2057837.  To create a specific dataset
for /home/$user, this requires moving where and when users are created,
which is not in plan for 24.04.
2024-04-11 08:02:11 -06:00
Olivier Gayot 5553793f43 mirror: allow to query or set if archive/mirror is used during install
The /mirror GET and POST endpoints now include a boolean field named
"use_during_installation".

* if set to True, the mirror information will be used during
  installation to fetch packages online.

* if set to False, we will only fetch packages from the pool.

In either case, the mirror information will still be used to build the
etc/apt/ directory in the target system.

Currently, the way use_during_installation is implemented is coupled
with the force_offline property of the network model. This means that
Ubuntu Pro and other stuff will be disabled too if we're skipping the
use of the archive.

NOTE: the default value for "use_during_installation" in the POST
endpoint is `null` ; which means that we should not change the current
value of force_offline.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-11 11:00:26 +02:00
Chris Peterson 979f546f27
Merge pull request #1964 from Chris-Peterson444/pre-commit-spelling
pre-commit: add spelling check
2024-04-10 14:18:25 -07:00
Olivier Gayot 6db2ff8113
Merge pull request #1961 from ogayot/lvm-size-max
storage: fix UI crash when partition size gets capped
2024-04-09 16:58:06 +02:00
Robert Krátký 797f223705
Merge pull request #1963 from rkratky/review-of-1956
Language and formatting fixes as a follow up to #1956
2024-04-09 13:14:37 +02:00
Robert Krátký 76440813bd
Merge pull request #1962 from rkratky/FR-5798_autoinstall-intro
Better introduction to autoinstall
2024-04-09 13:13:05 +02:00
Robert Krátký ce6dd33e80 Better introduction to autoinstall. 2024-04-09 12:58:51 +02:00
Chris Peterson 5a1b0e35d9 pre-commit: add spelling check
Check for any changed .rst files in the doc/ directory and run
`make spelling` if any changes are detected.

The files directives per hook have to be more restrictive than the
global hook, so this also slightly changes the files match for
the other hooks.
2024-04-05 08:58:54 -07:00
Robert Krátký 219f55258d Language and formatting fixes. 2024-04-05 15:58:08 +02:00
Olivier Gayot 15f6848dc6 storage: fix UI crash when partition size gets capped
In cda6c54b87, we introduced the accurate
size vs human readable size for the size form fields. Unfortunately, we
also introduced a regression when the size gets capped (when it exceeds
the maximum size defined on the form). Currently, specifying a size that
is beyond the maximum value fails when submitting the form with:

  [...]
  File "urwid/wimp.py", line 543, in keypress
    self._emit('click')
  File "urwid/widget.py", line 461, in _emit
    signals.emit_signal(self, name, self, *args)
  File "urwid/signals.py", line 265, in emit
    result |= self._call_callback(callback, user_arg, user_args, args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "urwid/signals.py", line 295, in _call_callback
    return bool(callback(*args_to_pass))
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "subiquitycore/ui/form.py", line 486, in _click_done
    emit_signal(self, "submit", self)
  File "urwid/signals.py", line 265, in emit
    result |= self._call_callback(callback, user_arg, user_args, args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "urwid/signals.py", line 295, in _call_callback
    return bool(callback(*args_to_pass))
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "subiquity/ui/views/filesystem/partition.py", line 636, in done
    handler(self.disk, spec, partition=self.partition, gap=self.gap)
  File "subiquity/common/filesystem/manipulator.py", line 334, in logical_volume_handler
    lv.size = align_up(spec["size"])
              ^^^^^^^^^^^^^^^^^^^^^^
  File "subiquity/models/filesystem.py", line 1382, in align_up
    return (size + block_size - 1) & ~(block_size - 1)
            ~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'BoundFormField' and 'int'

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-04-05 11:20:34 +02:00
Chris Peterson 16bcfcf7ae
Merge pull request #1956 from Chris-Peterson444/top-level-autoinstall
Allow top-level autoinstall in all delivery methods
2024-04-04 14:32:37 -07:00