Commit Graph

6587 Commits

Author SHA1 Message Date
Dan Bungert a8c1143eee filesystem: create zpool with encryption info 2024-02-27 15:14:34 -07:00
Dan Bungert 1b00eb5616 utils: extract write_named_tempfile 2024-02-27 15:14:34 -07:00
Dan Bungert d886dcd97d
Merge pull request #1920 from dbungert/tests-noble
Fix unittests on Noble
2024-02-26 23:58:57 -07:00
Dan Bungert 76c9b6607a console_conf: fix not_called usage 2024-02-26 17:06:17 -07:00
Dan Bungert d266ac6a3f server: fix py3.12 related unittest deprecation 2024-02-26 17:05:53 -07:00
Dan Bungert 6fc7f46dd4
Merge pull request #1917 from dbungert/zfs-luks-keystore
types: rename ZFS_LUKS -> ZFS_LUKS_KEYSTORE
2024-02-23 08:00:03 -07:00
Dan Bungert f60290bb11 types: rename ZFS_LUKS -> ZFS_LUKS_KEYSTORE
Clarify that the implemented mechanism is the keystore setup.  An
implementation that doesn't use native ZFS encryption is plausibly
interesting, which is a better use of the term ZFS_LUKS.
2024-02-23 07:53:27 -07:00
Dan Bungert 98ca9cdfa8
Merge pull request #1919 from bboozzoo/bboozzoo/console-conf-wrapper-sync
bin/console-conf-wrapper: use /run/console-conf, fix mode extraction
2024-02-23 07:17:55 -07:00
Maciej Borzecki 3ea3da1a9a bin/console-conf-wrapper: fix mode extraction when modeenv is not available
We generally expect /var/lib/snapd/modeenv to exist, but in case it does not,
fall back to picking up the mode from kernel command line (just like snapd does
it).

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-23 14:21:06 +01:00
Maciej Borzecki 09b039a868 bin/console-conf-wrapper: update wrapper to use /run/console-conf
The changes in 66e8222a09 and
f3043cde88 introduced established
/run/console-conf as the project runtime directory. Make sure that the wrapper
uses the same location.

Credits to @kubiko for introducing the changes in his core24 nucleus branch.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-02-23 14:20:48 +01:00
Dan Bungert f83bf19e47
Merge pull request #1916 from dbungert/desktop-reduce-models
server: fix desktop INSTALL_MODEL_NAMES
2024-02-22 07:08:56 -07:00
Dan Bungert ca91bf0108 server: fix desktop INSTALL_MODEL_NAMES
Mirror and proxy are not in plan to be shown in the UI, so stop
requiring them.
2024-02-21 11:46:18 -07:00
Chris Peterson efd5138853 network: fix typo in BondConfig to_config method
A mismatch between the key names in BondConfig's to_config method
and NetworkDev's netdev_info function was causing subiquity to
crash when creating a bond with a valid transmit hash policy and
then later trying to edit it (LP: #2051586).

The correct key name set by the to_config method should be
"transmit-hash-policy" since this later gets passed to netplan
and neither "xmit-hash-policy" nor "xmit_hash_policy" is a valid
key name in pure netplan config.
2024-02-21 08:48:34 -08:00
Olivier Gayot cf909d751c
Merge pull request #1915 from ogayot/fix-netplan-detection
network: fix detection of netplan on recent Ubuntu releases
2024-02-21 09:18:42 +01:00
Olivier Gayot 4e6bae198b network: fix detection of netplan on recent Ubuntu releases
Subiquity has a mechanism to detect the presence of netplan. It does so
by checking the existence of the file /lib/netplan/generate. This
mechanism is used in the network screen to validate the YAML
configuration.

However, since netplan 0.107 (present in mantic and noble), the file
/lib/netplan/generate is no longer present. It used to be provided as an
alias for /usr/libexec/netplan/generate ; starting in jammy.

This made Subiquity unable to detect that netplan is running ; and
therefore skip the YAML validation against netplan.

Since we support focal in Subiquity, let's change the detection code so
that we look for both locations. When we stop supporting Focal in the
future, we can drop the reference to /lib/netplan/generate.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-19 13:03:30 +01:00
Chris Peterson 477fef9590
Merge pull request #1913 from Chris-Peterson444/netplan-comment
update rationale for netplan config permissions
2024-02-16 15:26:54 -08:00
Olivier Gayot c8501d81db
Merge pull request #1910 from ogayot/pro-dynamic-eol
Do not use hard-coded EOL year for ESM updates on the ubuntu-pro screen
2024-02-16 09:46:08 +01:00
Chris Peterson 7f388aded2 update rationale for netplan config permissions
Previously we had stripped the wifi config and wrote it separately with
stricter permissions than normal to avoid leaking sensitive data, but
now at first glance this seems redundant with all the netplan config
file permissions being the same. The reason we didn't collapse
everything back to one file with the permissions change is that
there are scenarios in which the 00-installer-config.yaml file could
purposefully be shared, so we should continue to strip known private
information from that file.
2024-02-15 10:56:27 -08:00
Michael Hudson-Doyle 5e5ef826d5
Merge pull request #1894 from medicalwei/factory-reset-fix-boots
factory-reset: remove EFI boot entry, retarget GRUB entry to chainload Reset Partition GRUB
2024-02-15 09:50:39 +13:00
Chris Peterson beb41c30d0
Merge pull request #1911 from Chris-Peterson444/netplan-permissions-tests
permissions: update netplan configs to 0600
2024-02-13 17:06:30 -08:00
Chris Peterson ed3d2b3e7d ci: disable lint on noble
Temporarily disable lint ci test on noble until we can determine
regression.
2024-02-13 16:58:48 -08:00
Chris Peterson 9ecc4060b9 permissions: update netplan configs to 0600
Since netplan 0.106.1, Netplan YAMLs should have file permissions
with mode 0o600 (owner RW only) and root owner.
2024-02-13 16:36:11 -08:00
Olivier Gayot ce938e6d03
Merge pull request #1895 from ogayot/pr/ssh-dissociate-form-submission
Dissociate SSH key import from form submission
2024-02-13 19:20:34 +01:00
Olivier Gayot b5bbb76900 ubuntu-pro: consume general info and show on the UI
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-13 13:02:40 +01:00
Olivier Gayot a42ea0a685 ubuntu-pro: return number of packages and EOL ESM in /ubuntu_pro/info
We now rely on distro-info to find out the EOL ESM date on LTS releases.
This information is meant to be shown on the Ubuntu Pro screens ;
instead of hardcoded values.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-13 13:02:25 +01:00
Olivier Gayot 7a5ff9e76a examples: add lsb-release for jammy and noble
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-13 11:56:31 +01:00
Olivier Gayot 8e3751f647 lsb-release: split the function so it can be tested with more ease
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-13 11:56:31 +01:00
Dan Bungert 2883cad416
Merge pull request #1880 from medicalwei/fixed-reset-partition-size
Accept a fixed partition size for reset partition in autoinstall.yaml
2024-02-12 20:21:10 -07:00
Dan Bungert d617ae0f1f
Merge pull request #1872 from kubiko/console-conf-use-snapd-socket
console_conf: identity: use snapd unix socket
2024-02-12 20:17:26 -07:00
Olivier Gayot 3f3bb29c2e ssh: call GitHub / Launchpad service, not ssh_import_id
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot 3ac1810b0c ssh: use view-helpers for detecting the confirmation key overlay
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot 5861968e80 view-helpers: add function waiting for an overlay to be displayed
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot 0f3c53c283 ssh: drop redundant use of context when importing key
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot f5ecece153 ssh: have a button to show a key
When selecting a SSH identity, the user can open a dialog showing the
contents of the key.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot feaf0601d3 ssh: add identity table with ability to remove key
A new table shows all the SSH identities/keys that are currently
imported. The user can select one and delete it from the list if he
wants to.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 14:08:59 +01:00
Olivier Gayot 446bf3814d answers: move ssh-import-id directive to SSH section
When running answers-based automation, the SSH controller looks into
more than one section to find ssh-import-id directives.

If the "SSH" section exists, then it is where the ssh-import-id
directives must be placed. However, if the section does not exist, the
controller will also look for ssh-import-id directives in the "Identity"
section.

The answers.yaml file used this special mechanism. This is fine.
However, if one adds a SSH section to customize other settings (e.g.,
install_server, pwauth), then the ssh-import-id directives in the
Identity section suddently get ignored ; which is confusing and looks
as if there is a bug.

Let's move ssh-import-id directives to the SSH section.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-12 13:59:23 +01:00
Yao Wei (魏銘廷) 61d748d549 doc: add Reset Partition to `autoinstall-reference.rst` 2024-02-12 16:49:51 +08:00
Olivier Gayot 24f48f0d87 Merge pull request #1884 from ogayot/nvme-o-tcp-poc
NVMe over TCP with /home on remote storage
2024-02-09 11:38:59 +01:00
Dan Bungert ab31a3b206
Merge pull request #1907 from dbungert/use-cryptoswap
Use cryptoswap
2024-02-08 18:07:36 -07:00
Dan Bungert 08a91988fa snapcraft: rev curtin for dm_crypt config support 2024-02-08 16:19:08 -07:00
Dan Bungert 72ca35d06b filesystem: add ZFS_LUKS capability flag
Start the ZFS_LUKS work with adding the flag and connecting the parts
needed.  Enable cryptoswap as part of that.
2024-02-08 16:19:08 -07:00
Olivier Gayot c1105dffee filesystem: add integration test using nvme-o-tcp
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot 88b6dcb6c6 filesystem: add support for reformatting in run-answers
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot 76f0469705 filesystem: fix run-answers for deleting a partition
When trying to delete a partition using the answers-based mechanism,
subiquity tries to call .done() on the ConfirmDeletesStretchy overlay.
However, this method does not exist. The .confirm() method is what we
should use instead.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot 376131b04d filesystem: pass _netdev option for mounts on remote storage
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot c3de13d10c filesystem: only allow /home on remote storage
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot 802e9ef8db storage: add property to tell if FS objects are "on" remote storage
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot e83343c02c filesystem: LVM_VolGroup has a list of devices, not a set
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot c95716669c storage: expect optional NVMe controllers in the storage config
Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 19:17:05 +01:00
Olivier Gayot 81ed199e17 ssh: dissociate key import from form submission
Previously, on the SSH screen, the ability to enable/disable the SSH
server and the ability to import a SSH identity were both covered by a
single form. Therefore, there was no way to import multiple identities.

This change adds a button "Import SSH key" which opens a new form to
import an identity. The button can be pressed multiple times and the
resulting identities are all submitted when the user clicks on Done.

Furthermore, navigating back to the SSH screen does not "forget" already
imported identities.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
2024-02-08 17:53:14 +01:00