Commit Graph

5980 Commits

Author SHA1 Message Date
Dan Bungert 03c48daded test/api: add a simple coreboot testcase 2023-05-15 16:50:27 -06:00
Dan Bungert 451c4d7b74 storage/v1: handle variations for guided_GET
Purposefully simple as this is not believed to be a real use case to
have multiple variations.
2023-05-15 16:50:27 -06:00
Dan Bungert 1cc39ab7ee examples: fake enhanced-secureboot-desktop 2023-05-15 16:50:27 -06:00
Michael Hudson-Doyle b5ba12bf2c filesystem: enumerate and choose variation 2023-05-15 16:50:27 -06:00
Dan Bungert ebc7e39ea8 source: test expected model characteristics 2023-05-15 16:49:15 -06:00
Michael Hudson-Doyle 5105eb6c82 parse variations out of the source catalog
This parses variations but nothing iterates over them or selects a
non-arbitrary one yet.
2023-05-15 16:49:15 -06:00
Dan Bungert 02bfe89c93
Merge pull request #1676 from dbungert/workflow-mantic
workflow: +mantic
2023-05-12 07:53:51 -06:00
Dan Bungert f21dac28f2 workflow: +mantic 2023-05-12 07:44:16 -06:00
Olivier Gayot cf1e13ac12
Merge pull request #1671 from ogayot/no-reorder-uefi
install: request curthooks not to reorder UEFI boot entries
2023-04-28 10:08:41 +02:00
Olivier Gayot a270019387 prober: turn on parallelism for probert storage
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-27 11:09:23 +02:00
Olivier Gayot 782481b357
Merge pull request #1670 from ogayot/asyncio-probert
prober: move to asyncio for probert storage
2023-04-27 11:08:33 +02:00
Olivier Gayot 0bf2d9d38d install: request curthooks not to reorder UEFI boot entries
By default, curthooks will automatically reorder the UEFI boot entries
so that the media used during installation is set as the first boot
entry.

This is something that MAAS wants because MAAS typically boots over the
network.

This is not typically something we would want for a server or desktop
installer though. Most of the time, the media is a removable device.
Ideally, we would want the new installed grub to be the first boot
entry.

Furthermore, on some UEFI implementations, the BootCurrent does not
correspond to a Boot#### entry when booting from a removable media. When
this happens, curtin fails at making the media the first boot entry,
resulting in the following error:

  Invalid BootOrder order entry valueXXXX
                                       ^
  efibootmgr: entry XXXX does not exist

Fixed by disabling the UEFI boot entries reordering when invoking
curthooks.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-26 13:42:07 +02:00
Olivier Gayot 60f2b506db prober: move to asyncio for probert storage
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-25 15:12:19 +02:00
Olivier Gayot 1607a8a95b
Merge pull request #1669 from ogayot/logical+swap
filesystem: fix logical+swap or logical+boot partition not considered logical
2023-04-25 11:27:30 +02:00
Olivier Gayot 81acb6eb9f snapcraft: bump curtin to handled logical swap partitions
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-25 10:56:58 +02:00
Olivier Gayot 36161c0040 filesystem: fix logical+swap or logical+boot partition not considered logical
Some people who installed a previous version of Ubuntu on a DOS
partition table ended up with a logical, ESP partition (which is marked
bootable).

This is an unsupported use-case. An ESP partition should always be a
primary partition. Ideally, an ESP partition should be on a GPT.

However, curtin's storage_config makes it clear that expecting the flag
of a logical partition to be set to 'logical' is a bad idea.

  # if the boot flag is set, use this as the flag, logical
  # flag is not required as we can determine logical via
  # partition number

Other people want to create a swap partition in an extended partition.
This is a perfectly valid use-case and we set flag='swap' for those
partitions.

Therefore, in subiquity code, we cannot just check if a partition has a
flag set to 'logical'. We need to look at the partition number too.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-24 14:31:35 +02:00
Dan Bungert 649dbcc5d6
Merge pull request #1667 from dbungert/merge-discourse-docs-2023-april
Merge discourse docs 2023 april
2023-04-20 05:14:32 -06:00
Dan Bungert 0c8c38e088 documentation: merge changes from Discourse 2023-04-20 12:05:25 +01:00
Dan Bungert da678c7472 documentation: makefile helper targets 2023-04-20 12:05:25 +01:00
Olivier Gayot dfd67b5039
Merge pull request #1666 from ogayot/probert-fix-follow-on
Cosmetic fixes for asynchronous probert runs fix
2023-04-19 13:44:16 +02:00
Olivier Gayot 62dafb2c3d storage: add LP bug number to non-reg test and minor reword
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-19 09:22:08 +02:00
Olivier Gayot 69d6ef91e1 storage: add type hint for locked_probe_data
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-19 09:19:33 +02:00
Dan Bungert f43dae64e5
Merge pull request #1664 from dbungert/curtin-ntfs
snapcraft: rev for ntfsresize change
2023-04-18 19:21:13 +01:00
Dan Bungert fe2b3f2d88 snapcraft: rev for ntfsresize change 2023-04-18 19:13:54 +01:00
Dan Bungert 5586382890
Merge pull request #1660 from ogayot/no-probert-during-partitioning
storage: don't let probing discard storage config in the middle of partitioning
2023-04-18 19:09:00 +01:00
Olivier Gayot 9e4cd77d9d storage: add API test to cover probert run finishing during partitioning
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-18 11:01:26 +02:00
Olivier Gayot d8748c27fe storage: add unit tests to cover probe data locking
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-18 10:56:13 +02:00
Olivier Gayot cd25ec454f storage: don't let probing discard storage config in the middle of partitioning
If a probert run finished in the middle of partitioning, the probing
data would be loaded automatically and this would essentially discard
changes made so far by the user. This is not a desirable behavior.

Upon starting partitioning, we now prevent later probert runs from
automatically loading the probe data. Instead, the data is stored and
only loaded after after a reset.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-18 10:52:55 +02:00
Olivier Gayot 2f160ada88
Merge pull request #1661 from ogayot/probert-verbosity-fix
snapcraft: bump probert to pickup verbosity fix
2023-04-17 09:20:08 +02:00
Olivier Gayot 55a5ebd42b snapcraft: bump probert to pickup verbosity fix
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-17 09:08:10 +02:00
Olivier Gayot d4b9068dc5
Merge pull request #1659 from ogayot/apt-get-error-on-focal
mirror: clean environment before running apt-get
2023-04-14 16:27:48 +02:00
Olivier Gayot 3bb74546e2 mirror: clean environment before running apt-get
For mirror testing, we run apt-get update on the host. By default,
external commands run by subiquity inherit the environment variables set
by the snap (including LD_LIBRARY_PATH).

We don't ship apt-get or its dependencies in the subiquity snap, so we
want to reset LD_LIBRARY_PATH and other variables when running the
command.

Not doing so leads to the following error when running the subiquity
snap on a focal-based system:

 * apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not
   found (required by /snap/subiquity/4675/usr/lib/x86_64-linux-gnu/libsystemd.so.0)
 * apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not
   found (required by /snap/subiquity/4675/usr/lib/x86_64-linux-gnu/libsystemd.so.0)
 * apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not
   found (required by /snap/subiquity/4675/usr/lib/x86_64-linux-gnu/libsystemd.so.0)
 * apt-get: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not
   found (required by /snap/core22/current/lib/x86_64-linux-gnu/libcap.so.2)

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-14 16:13:36 +02:00
Olivier Gayot 0e957dfb9d
Merge pull request #1652 from ogayot/swap
filesystem: fix crash when editing swap partition in v2
2023-04-14 15:16:11 +02:00
Olivier Gayot aa6274c38e filesystem: fix crash when editing swap partition in v2
When we create a swap partition using v2_add_partition, the mount
parameter always has the value of None.

We do however, create a fake mountpoint object and assign it the value
of "" (empty string) so we know the swap partition is used although it's
not really mounted anywhere in the filesystem hierarchy.

Subsequently, when editing the swap partition, the mount parameter is
set to the empty string, not None.

This causes trouble in the create_mount function, which normally returns
immediately upon encountering None as the mountpoint.

Fixed by skipping the call to create_mount for a swap partition.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-14 09:51:33 +02:00
Dan Bungert b99544dfe6
Merge pull request #1657 from CarlosNihelton/seeded-cmds-wsl-490
[system_setup] Fixed paths for language-related commands
2023-04-13 14:22:38 -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
Dan Bungert cfd30c94eb
Merge pull request #1651 from dbungert/udi-tag-report
errorreport: tag with snap name
2023-04-13 10:21:38 -06:00
Dan Bungert cd03fea2f0 errorreport: tag report with snap name 2023-04-13 10:14:39 -06:00
Dan Bungert 232f2f9d8c errorreport: add tags capability
Future problem_report has a nice add_tags method, simulate it here.
Should be able to drop this with a core24 move.
2023-04-13 10:14:39 -06:00
Olivier Gayot c22ad1dc83
Merge pull request #1532 from ogayot/edit-lvm-bug
storage: fix crash when editing encrypted VG created in guided storage
2023-04-13 10:41:16 +02:00
Olivier Gayot 86c727fbce
Merge pull request #1648 from ogayot/fix-double-source-configure
Fix assertion in autoinstall API test
2023-04-12 17:12:45 +02:00
Dan Bungert 85b04ae399
Merge pull request #1647 from dbungert/probert-pr131
snapcraft: rev probert for diagnostics
2023-04-12 07:42:51 -06:00
Dan Bungert 748803b201
Merge pull request #1646 from dbungert/udi-log-apport
errorreport: get udi log
2023-04-12 07:42:34 -06:00
Dan Bungert 46b291b48f
Merge pull request #1643 from dbungert/u-u-fail-nonfatal
unattended-upgrades: failure is not install-fatal
2023-04-12 07:39:22 -06:00
Dan Bungert 8cbb1cf74c
Merge pull request #1642 from dbungert/u-d-i-slimy-snap-build
scripts: update slimy to handle u-d-i
2023-04-12 07:37:29 -06:00
Olivier Gayot 8298ec17c8 api: avoid post-ing to source in autoinstalls
When running autoinstalls, the source model will be marked configured
automatically after apply_autoinstall_config has run. The selected
source will be the one described in the autoinstall section or will
default to the legacy server entry: Ubuntu Server.

Doing an additional POST request can only make things inconsistent in
fully automated installs.

When the POST request is handled, most of the models may already have
applied their autoinstall configuration, and are already relying on the
previous source selected.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-12 12:15:53 +02:00
Olivier Gayot 6aa9452bb0 mirror: bail if source changes after applying autoinstall config
If the source model changes, the mirror model gets a chance to apply a
new apt configuration. However, if this happens during an automated
install, this is a recipe to disaster.

Make sure we raise an exception if a POST request to /source occurs
after the mirror model has started applying its autoinstall
configuration.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-12 12:13:32 +02:00
Olivier Gayot 938f2ffc24 mirror: avoid assertion error if the source changes at the wrong time
When the source model changes, the mirror model gets notified and
replaces the "apt configurer" instance with a new one. If this happens
in the middle of a "deploy apt configuration + run apt-get update"
operation, this leads to an assertion error.

Fixed by making sure we do the entire operation on the same "apt
configurer" instance.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-12 12:11:10 +02:00
Dan Bungert 8a71b7d1ed errorreport: get udi log 2023-04-11 18:35:09 -06:00
Dan Bungert fd1fc1c1d3 snapcraft: rev probert for diagnostics 2023-04-11 17:25:11 -06:00