Commit Graph

5824 Commits

Author SHA1 Message Date
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 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
Dan Bungert 2bfff57f41 network: run `netplan apply` without snap env
netplan isn't staged in the snap, and the environment variables being
passed around don't help it.
2023-03-29 13:23:57 -06:00
Chad Smith df57846dfb cloud-init: preserve ephemeral cloud-init logs in target to aid in debug 2023-03-28 20:27:18 -06:00
Dan Bungert bc33062e9b
Merge pull request #1620 from jpnurmi/desktop-sources
Add test source catalog for desktop variants
2023-03-28 12:39:58 -06:00
J-P Nurmi 2cbf8fc0dc Add test source catalog for desktop variants 2023-03-28 20:15:14 +02:00
Carlos Nihelton d00171b7f4
Merge pull request #1618 from CarlosNihelton/fix-joining-live
(fix) Join target instead of live session
2023-03-28 14:47:51 -03:00
Carlos Nihelton cd6e69187a
(fix) Join target instead of live session
LP: #2013079
Found during beta testing that the live session is joining, instead of
the target.
2023-03-28 10:00:59 -03:00
Olivier Gayot aac8eb43c6
Merge pull request #1616 from ogayot/raid1-path-fix
filesystem: fix path property from Raid - override attribute
2023-03-27 11:57:06 +02:00
Michael Hudson-Doyle 130809f366
Merge pull request #1615 from mwhudson/defer-system-setting
only examine system from snapd when source is selected
2023-03-27 14:58:45 +13:00
Carlos Nihelton 1105da2368
Falls back to seeded l-s-c
UDI snap ships the package, thus its data dir is part of the snap
subiquity snap does not.
This tries l-s-c data dir in the base system, outside of the snap
and gives up if the dir does not exits.
2023-03-24 11:54:44 -03:00
Olivier Gayot 6737e2c053 filesystem: fix path property from Raid - override attribute
The following commmit:
  ce146ab28 add .path to Raid so for_client(raid-with-partitions) works

introduced a (read only) path property for Raid objects, returning an
imaginary value to make for_client work with Raid objects. Later on, the
following commit:
  8e658998e add "path" attributes to fs model objects that curtin now
            provides a path for

introduced a (read/write) path attribute to all filesystem objects. For
Raid however, the property still takes precedence over the new attribute
of the same name, so doing raid.path = x is invalid (no setter) and
results in the following exception:

AttributeError: can't set attribute 'path'

Fixed by using a @property + @setter attribute for path. The getter
returns the actual path if it exists, otherwise returns the same
imaginary value as before.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2023-03-24 14:42:54 +01:00
Michael Hudson-Doyle c728dfbc05 only examine system from snapd when source is selected
and only take actions (like setting storage_version to 2) when we know
we are installing a core boot classic system.
2023-03-24 17:38:07 +13:00
Michael Hudson-Doyle 4496f22ff8
Merge pull request #1613 from mwhudson/async-guided
make FilesystemController.guided_core_boot async and fallout
2023-03-24 17:37:50 +13:00