Commit Graph

6319 Commits

Author SHA1 Message Date
Dan Bungert 446f3772d3
Merge pull request #1687 from dbungert/default-user-none
server: fix when cloud-config has no default user
2023-06-29 16:20:23 -06:00
Dan Bungert 5bd9a4fc94 server: fix when cloud-config has no default user
If a cloud-config is sent that adjusts the users but creates no default
user, Subiquity crashes with a exception while mishandling the None.

cloudinit.distros.ug_util.extract_default is documented as returning
None in the event that the default user cannot be found.

Example bad cloud-config:
```yaml
users:
- name: ubuntu-server
```
2023-06-29 15:51:01 -06:00
Olivier Gayot 8f7760462a documentation: update autoinstall schema to include active-directory
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-29 14:26:54 +02:00
Michael Hudson-Doyle 0f78185b9a add some unit tests 2023-06-28 13:43:52 +12:00
Michael Hudson-Doyle bc11d0df3e maybe fix CI 2023-06-28 12:45:34 +12:00
Michael Hudson-Doyle 283e07a615 add integration test for reset-partition-only
This requires some tweaks to make the test machinery accept an
autoinstall that doesn't do most of the things we usually expect.  Also
set the .target attribute to None when reset-partition-only is true to
catch more issues in the dry-run environment.
2023-06-28 12:21:09 +12:00
Michael Hudson-Doyle 94172698f5 more bits and pieces 2023-06-26 17:01:57 +12:00
Michael Hudson-Doyle 35b951c87a skip some other steps in stage 1 2023-06-26 17:01:57 +12:00
Michael Hudson-Doyle 663a752d3a one more 2023-06-26 17:01:57 +12:00
Michael Hudson-Doyle 19f6b37b9b extremely naive way of having only a reset partition 2023-06-26 17:01:57 +12:00
Olivier Gayot 6123601cba oem: install (and upgrade) OEM meta-packages if available
When OEM meta-packages are available, install them before running
curthooks. If we are online, we also upgrade the metapackages so that
they are upgraded to their version in the relevant OEM archive. This
will effectively pull the kernel.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-23 10:05:21 +02:00
Olivier Gayot 64aabc1dd0 ubuntu-drivers: try to avoid OEM metapkgs when installing drivers
When installing third-party drivers, we now pass the --no-oem option to
the ubuntu-drivers install command. Because of LP #1966413, the option
might get ignored, which is not ideal but sort of acceptable - because
we want OEM meta-packages installed unconditionally anyway.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-23 10:05:21 +02:00
Olivier Gayot 044bec1724 ubuntu-drivers: don't list OEM meta-packages as drivers
When we want to list third-party drivers, we want to avoid listing OEM
meta-packages as well. The ubuntu-drivers --no-oem list would do it but
we can't reliably use it for now. Let's manually exclude oem-*-meta
packages from the list.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-23 10:05:21 +02:00
Olivier Gayot ef7668d9f7
Merge pull request #1701 from ogayot/etc-apt-discard-selectively
apt: reset only diverted files on deconfigure
2023-06-23 09:35:19 +02:00
Olivier Gayot 174e7afdd0 apt: reset only diverted files on deconfigure
Before starting the actual installation, we make changes to etc/apt
directory in an overlay so that the packages are pulled from the media
instead of the network.

At the end of installation, we need to revert these changes. We used to
replace the etc/apt directory on the target by the etc/apt directory
from the configured overlay.

This is a simple way to revert the temporary changes. Unfortunately, it
also removes configuration files that extra packages may have installed
in etc/apt. For instance, when installing an OEM meta-package, a
etc/apt/sources.list.d/<oem-meta-package>.list gets installed.

If we reset etc/apt to its content from the configured overlay, we lose
this file.

Fixed by selectively discarding changes to the files that subiquity
modified.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-22 09:55:30 +02:00
Olivier Gayot fa29b9088b
Merge pull request #1696 from ogayot/umockdev
ubuntu-drivers: add ability to run ubuntu-drivers in dry-run with umockdev
2023-06-15 10:11:22 +02:00
Olivier Gayot e56053f2bb ubuntu-drivers: add support for umockdev in dry-run
When running subiquity in dry-run mode with SUBIQUITY_DEBUG=run-drivers,
we now support using a YAML file describing the hardware in a
umockdev-compatible way. This allows to give some control on what
ubuntu-drivers list will reply.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-15 09:37:02 +02:00
Olivier Gayot 364e718c60 apt-deps: add ubuntu-drivers-common needed for dry-run
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-15 09:18:29 +02:00
Olivier Gayot 59b959b7c5
Merge pull request #1690 from ogayot/list-oem
Add controller + model listing OEM meta-packages
2023-06-13 19:05:59 +02:00
Dan Bungert d420d91ed0
Merge pull request #1695 from dbungert/doc-clarify
doc: update README
2023-06-13 08:08:28 -06:00
Olivier Gayot eea922cd1b oem: add GET endpoint returning OEM meta-packages to be installed
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-13 14:23:42 +02:00
Olivier Gayot a804bbfe8b oem: add minimal model + controller
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-13 14:14:05 +02:00
Michael Hudson-Doyle 40b18f8fe3
Merge pull request #1694 from mwhudson/guided-reasons
return some information about disallowed guided options
2023-06-13 10:04:51 +12:00
Michael Hudson-Doyle ab6e643d50 start to return disallowed guided options 2023-06-13 09:55:17 +12:00
Michael Hudson-Doyle 702badf815 record allowed and disallowed capabilities for each source variation
Also rewrite a bit of my old code even I now find confusing.
2023-06-13 09:55:17 +12:00
Michael Hudson-Doyle 92560a87b5 add disallowed types and fields 2023-06-13 09:55:13 +12:00
Michael Hudson-Doyle 3ec6e6e2bd rename GuidedStorageTarget* 'capabilities' attribute to 'allowed' 2023-06-13 09:54:14 +12:00
Michael Hudson-Doyle 7e043a0950
Merge pull request #1693 from mwhudson/possible-to-targets
rename GuidedStorageResponseV2.possible to targets
2023-06-13 09:53:02 +12:00
Michael Hudson-Doyle 6c0ea12857
Merge pull request #1691 from mwhudson/flag-reset-partition
set "mstfres" flag on reset partition
2023-06-13 09:52:51 +12:00
Michael Hudson-Doyle 760c41913b set "mstfres" flag on reset partition 2023-06-13 09:22:28 +12:00
Michael Hudson-Doyle 9ed9f4e469 update curtin and adapt to API change 2023-06-13 09:22:24 +12:00
Michael Hudson-Doyle e2bc77b706
Merge pull request #1692 from mwhudson/ignore-bad-systems
log and ignore systems (in the snapd sense) we cannot install
2023-06-13 08:22:57 +12:00
Dan Bungert a26df84032
Merge pull request #1656 from kubiko/main
bin/console-conf-wrapper: prefer use of snapd/modeenv
2023-06-12 14:08:13 -06:00
Dan Bungert 1e68336595 doc: update README
Clarify that doc is the go-forward folder.
2023-06-12 14:03:50 -06:00
Dan Bungert 9bbf1ac058
Merge pull request #1685 from s-makin/docs-RTD-setup
docs: add files for RTD setup
2023-06-12 13:55:59 -06:00
Michael Hudson-Doyle 98bfb066b7 rename GuidedStorageResponseV2.possible to targets
Fairly soon v2/guided will return information about guided targets that
are not, in fact, possible.
2023-06-12 00:19:22 +12:00
Michael Hudson-Doyle 1fa3d3065e log and ignore systems (in the snapd sense) we cannot install
These errors are really errors in how the ISO is constructed, so logging
and ignoring seems more appropriate, compared to say encryption being
unavailable because the TPM is in lockout mode.
2023-06-09 14:51:47 +12:00
Michael Hudson-Doyle 211ee4e7b5
Merge pull request #1686 from mwhudson/recovery-part
allow creation and population of a recovery partition via autoinstall
2023-06-09 09:33:57 +12:00
Dan Bungert 3ac413e88b
Merge pull request #1689 from dbungert/zfs-autoinstall
zfs autoinstall
2023-06-08 12:24:38 -06:00
Dan Bungert 0e1da11c36 filesystem: allow zpool to satisfy mount 2023-06-08 12:06:45 -06:00
Dan Bungert 895f6a6384 filesystem: handle zpool export 2023-06-08 12:06:45 -06:00
Dan Bungert 7e74184fdc filesystem: add zfs/zpool fsobjs 2023-06-08 12:06:45 -06:00
Dan Bungert 50c7ff3d36 shutdown: add pre-shutdown pubsub channel 2023-06-08 12:06:45 -06:00
Dan Bungert c0741ab715 examples: autoinstalls showing zfs root
Add example autoinstalls.  Include several necessary steps for
everything to go well that will be moved out of the autoinstall in
following PRs.
2023-06-08 12:06:33 -06:00
Olivier Gayot aec441d9e9 ubuntu-drivers: by default in dry-run, consider that drivers are available
We only search for drivers if search_drivers is enabled in the source
screen. When testing in dry-run mode, we need to check the
search_drivers checkbox AND remember to pass the has-drivers debug flag.
I think it makes sense to consider drivers available by default in
dry-run mode.

This also means that OEM meta-packages are available by default (and
_should_ be installed automatically) in dry-run now.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-08 15:34:08 +02:00
Olivier Gayot e657b7e0e7 ubuntu-drivers: add method to list OEM meta-packages
The ubuntu_drivers.list_drivers() method currently returns names of
drivers + name of OEM meta-packages.

We now define a new method to be used for the OEM meta-packages only.

For now, the has-drivers, no-drivers, run-drivers debug flags affect the
presence of the OEM meta-packages as well. Going forward, we should
define dry-run directives controlling drivers & OEM independently.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-06-08 15:33:55 +02:00
Michael Hudson-Doyle 0e043679f4 stop passing source to every curtin step 2023-06-08 13:10:16 +12:00
Michael Hudson-Doyle c85ad513ec handle spaces in curtin step names better 2023-06-08 12:43:21 +12:00
Michael Hudson-Doyle 9b7a395347 skip symlinks when populating rp 2023-06-08 12:43:21 +12:00
Michael Hudson-Doyle 16ff550a2c update curtin 2023-06-08 12:43:18 +12:00