Commit Graph

6087 Commits

Author SHA1 Message Date
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
Dan Bungert 9b13e0b0ee
Merge pull request #1639 from ogayot/autoinstall-no-netplan-apply-if-nm-enabled
network: don't run netplan apply if no autoinstall and nm is enabled
2023-04-11 16:09:47 -06:00
Dan Bungert b72a5397fb scripts: update slimy to handle u-d-i
If the target snap is ubuntu-desktop-installer, put subiquity changes in
the appropriate location.
2023-04-11 14:10:49 -06:00
Dan Bungert 800a1e9372 install: make unattended-upgrades non-fatal
Log the result if failed, ensure that this is also journal-visible.
2023-04-11 13:53:20 -06:00
Dan Bungert e71a9f98cd runner: show stdout/stderr on exception 2023-04-11 13:53:20 -06:00
Dan Bungert 7c5a7f4289 utils: stdout/stderr logger 2023-04-11 13:53:20 -06:00
Olivier Gayot 9d32ded2f9 network: don't run netplan apply if no autoinstall and nm is enabled
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Co-authored-by: Dan Bungert <daniel.bungert@canonical.com>
2023-04-11 19:43:50 +02:00
Dan Bungert 69713714d2
Merge pull request #1641 from dbungert/lp-2015521-guided-resize-non-last-logical
gaps: fix gap size in extended
2023-04-07 11:14:54 -06:00
Dan Bungert 5219ecf50c gaps: fix gap when before a partition in extended
We need the ebr space if we're doing logical partitions, but not for the
primaries.
2023-04-07 10:59:05 -06:00
Dan Bungert dc810414d8 gaps: add unittests for gap before part on msdos 2023-04-07 10:59:05 -06:00
Dan Bungert fa81e0981e test/api: regression test for LP: #2015521 2023-04-07 10:59:05 -06:00
Dan Bungert 0a4134cd4b
Merge pull request #1640 from dbungert/localectl
locale: switch to localectl set-locale
2023-04-07 07:40:10 -06:00
Dan Bungert fb2c6da2e6 locale: switch to localectl set-locale
Move away from localedef to fully set the locale.
2023-04-06 17:25:49 -06:00
Olivier Gayot d899ada0d0
Merge pull request #1637 from ogayot/kb-multi-layout
keyboard: fix use of multi-layout keyboard layout
2023-04-05 15:19:40 +02:00
Dan Bungert 70a2a668b1
Merge pull request #1636 from dbungert/udi-gh-1772
storage: restricted probes must gather fs info
2023-04-05 07:04:26 -06:00
Olivier Gayot a91dbfa004 keyboard: fix use of multi-layout keyboard layout
The XKB configuration guide shows that multi-layout configuration is
possible, as in the following example:

    Option "XkbLayout" "us,cz,de"
    Option "XkbVariant" ",bksl,"

which translates to:
 * layout "us" with no variant
 * layout "cz" with variant "bksl"
 * layout "de" with no variant

The same applies to /etc/default/keyboard.

We do make use of this ability to automatically set an alternative
keyboard layout for non latin keyboard layouts (e.g., Arabic "ara"
becomes "us,ara" so that users can toggle between American and Arabic
keyboard layouts.

In the following commit:

  13cae2488 keyboard: validate layout and variant

.. we started implementing early validation of the keyboard layout, but
we did not consider that multi-layouts are supported.

As a result, subiquity fails at keyboard selection when a non latin
keyboard layout is selected.

Fixed by making sure the validation expects possible multi-layout
setups.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-05 12:32:48 +02:00
Dan Bungert c921192db3 storage: restricted probes must gather fs info
In ubuntu-desktop-installer/issues/1772, a user formatted an existing
partition as ext4, which triggered the ESP to be "mounted".  Except this
mount step also formatted the ESP.

Previously, when we ran block probing, the restricted=False version
failed, which caused it to run a restricted=True probe.  The
restricted=True probe looks at block devices, but does not gather
filesystem information.  The esp "mount" check is also willing to format
the partition if it is unformatted.  (We do not have a distinction
between a partition that is unformatted and one for which we have not
obtained filesystem information.)

This user had block probing restricted=False fail due to LP: #2012722,
where Ventoy was in use and we handled the device mapper entry poorly.
While recreating the failure case, simply retesting with a build with
the fix for LP: #2012722 is enough to avoid this problem.  This is
because the restricted=False probe passes, which means filesystem info
is gathered, which means the mount step doesn't attempt to format it.

There will inevitably be other block probing failure cases for
restricted=False.  restricted=True must not leave people so vulnerable
to a partition reformat.

Gather filesystem information during a restricted=True probe.
2023-04-04 14:00:24 -06:00
Dan Bungert a8e2b3e700
Merge pull request #1634 from dbungert/bootable-disks
Bootable disks
2023-04-04 08:09:46 -06:00
Dan Bungert 965a49f28f storage/v2: remove potential_boot_disks 2023-04-03 17:39:17 -06:00
Dan Bungert 3a0e9ed425 storage/v2: mark can_be_boot_device on disks 2023-04-03 17:38:49 -06:00
Dan Bungert c8e30bcefc
Merge pull request #1630 from dbungert/sizing-policy
Sizing policy
2023-04-03 12:52:45 -06:00
Olivier Gayot 716b4aee0c
Merge pull request #1631 from ogayot/wwn-extension-bump-curtin
snapcraft: update curtin to fix disk lookups with wwn extensions
2023-04-03 20:52:00 +02:00
Dan Bungert 15518fafd0 utils: matching_dicts handle key=None, typing
Co-authored-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-03 12:36:40 -06:00
Olivier Gayot 4c4ab16f7d snapcraft: update curtin to fix disk lookups with wwn extensions
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-04-03 20:34:00 +02:00
Dan Bungert a67ce9b8cd storage: autoinstall sizing-policy
Co-authored-by: Ryan Mounce <ryan@mounce.com.au>
2023-04-03 11:41:58 -06:00
Dan Bungert be76431de7 storage: implement unscaled LV sizing for guided 2023-04-03 11:41:58 -06:00
Dan Bungert d156b04a3a sizing: move lv scaling logic 2023-04-03 11:41:58 -06:00
Dan Bungert 6e15c46135 util: add matching_dicts
Move some of this logic to a common util, so it can be used in
unittests.  The curtin version is close but expects to work on a storage
config, which is not a flat list.
2023-04-03 11:41:47 -06:00
Carlos Nihelton e3f7b38512
Merge pull request #1627 from CarlosNihelton/fix-ad-bind-mounts
[Active Directory] Bind mounts in the joining context manager
2023-03-31 11:12:12 -03:00
Carlos Nihelton cda5a0f250
Umounts in the reversed order.
Sometimes unmounting order matters. Let's take the defensive approach.
2023-03-31 10:58:14 -03:00
Carlos Nihelton 4763d6baed
Merge pull request #1617 from CarlosNihelton/wsl-update-lsc
[system_setup] (fix) Falls back to seeded l-s-c
2023-03-31 10:31:45 -03:00
Dan Bungert 981fe7b4b4
Merge pull request #1628 from dbungert/ld-lib-path-vs-cmds
Ld lib path vs cmds
2023-03-31 06:12:54 -06:00
Dan Bungert 708cb02281 cmd: log environment on startup 2023-03-30 16:39:03 -06:00
Dan Bungert 1d9ad848fe utils: orig_environ cleans LD_LIBRARY_PATH
LD_LIBRARY_PATH is set earlier than some of the other environment
variables like PATH or PYTHONPATH, so trying to save a clean version in
snapcraft is not viable.  Remove it here.
2023-03-30 16:34:12 -06:00
Carlos Nihelton 37f3348135
Bind mounts
realm --install <target> requires system bind-mounts to work properly.
2023-03-30 11:57:04 -03:00
Olivier Gayot 8eca07c706
Merge pull request #1621 from ogayot/ventoy-bump-curtin
snapcraft: bump version of curtin to pickup ventoy fix
2023-03-30 16:51:17 +02:00
Olivier Gayot 243da45bf6 snapcraft: bump version of curtin to pickup ventoy fix
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-03-30 16:33:15 +02:00
Dan Bungert 92ac6544cd
Merge pull request #1623 from dbungert/gh-udi-1723-netplan-apply
network: run `netplan apply` without snap env
2023-03-30 07:02:58 -06:00
Dan Bungert 3af43a4d56
Merge pull request #1624 from dbungert/wsl-organize
system-setup: fix disappearing ubuntu-wsl-setup
2023-03-30 07:02:20 -06:00
Dan Bungert 6a402a87a4
Merge pull request #1625 from dbungert/crash-report
errorreport: all recent syslog
2023-03-30 07:01:46 -06:00
Dan Bungert 9ee6611eb1 errorreport: all recent syslog
Some outputs only appear in the journal.
2023-03-29 19:00:02 -06:00
Dan Bungert 84e79faa41
Merge pull request #1619 from blackboxsw/preserve-cloud-init-logs-in-target
cloud-init: preserve ephemeral cloud-init logs in target to aid in debug
2023-03-29 16:16:11 -06:00
Dan Bungert 5711b17b13 system-setup: restore accidentally deleted file 2023-03-29 16:02:53 -06:00
Dan Bungert 08e3201d4b system-setup: fix disappearing ubuntu-wsl-setup
Make a copy of this file to INSTALL, as the organize step renames it,
causing it to disappear from the source directory.
2023-03-29 16:00:10 -06:00