52259 Commits

Author SHA1 Message Date
Michael Vogt
63c82c0ab1 release: 2.53 (really this time after cherry-picking d07bfcd) 2.53 2021-10-05 20:32:32 +02:00
Maciej Borzecki
d07bfcd9ad overlord: fix generated snap-revision assertions in remodel unit tests
When building on LP, the mock snap files generated with mksquashfs end up having
the same sha3-348 digest, despite forcing a 1s delay between consecutive snap
builds, what should have affected the internal file timestamps. As a workaround,
use a different content of mock files, such that the files must yield a
different digest.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-05 20:28:53 +02:00
Michael Vogt
3546f33f73 release: 2.53
Update changelogs with the 2.53 changes.
2021-10-05 19:59:28 +02:00
Michael Vogt
faa6ae930c Merge pull request #10887 from mvo5/release-2.52.1-changelog
release: merge 2.52.1 changelog into master
2021-10-05 16:43:47 +02:00
Michael Vogt
16085c01a6 Merge remote-tracking branch 'upstream/master' into release-2.52.1-changelog 2021-10-05 15:34:24 +02:00
Michael Vogt
cd99de5594 release: 2.52.1 (#10885)
Update changelog with the 2.52.1 changes.
2.52.1
2021-10-05 14:47:58 +02:00
Michael Vogt
83244699a3 snap-bootstrap: wait in mountNonDataPartitionMatchingKernelDisk
* snap-bootstrap: wait in `mountNonDataPartitionMatchingKernelDisk`

The current snap-bootstrap has a race when mounting the seed
partition in `mountNonDataPartitionMatchingKernelDisk` on EFI
systems.

The code determines the partUUID of the disk that booted the
kernel by reading the EFI LoaderDevicePartUUID variable. However
there is no guarantee that this partition is available when
snap-bootstrap runs, the kernel may still enumerate the HW.
This can be observed on a fast NUC when booting from a USB
stick.

Note that the `the-tool.serice` already has a
"After=systemd-udev-settle.service" set but that is still
racy because any `udev settle` (or `udev trigger --settle`)
is racy, the only option is to poll for the part uuid to
appear.

This is a minimal commit to avoid too much churn in code.

Thanks to Sertac for reporting this bug.

* snap-bootstrap: rework waitPartSrc to improve testing (thanks to Alberto and Ian)

* snap-bootstrap: show a log message if waitPartSrc needs to wait

If waitPartSrc needs to wait for the device this commit makes it
show a logger.Noticef() message. The message is only shown once
because waiting for the device is usually super quick and if it
is not that is most likely an error anyway so spamming the
terminal will not help.

* snap-bootstrap: add test that ensures that if no waiting is needed for partSrc no log message is displayed

* snap-bootstrap: rename waitPartSrc -> waitFile

* snap-bootstrap: fix time.Duration() casting on 32bit systems
2021-10-05 12:03:05 +02:00
Michael Vogt
3b125d7598 snap-bootstrap: wait in mountNonDataPartitionMatchingKernelDisk
* snap-bootstrap: wait in `mountNonDataPartitionMatchingKernelDisk`

The current snap-bootstrap has a race when mounting the seed
partition in `mountNonDataPartitionMatchingKernelDisk` on EFI
systems.

The code determines the partUUID of the disk that booted the
kernel by reading the EFI LoaderDevicePartUUID variable. However
there is no guarantee that this partition is available when
snap-bootstrap runs, the kernel may still enumerate the HW.
This can be observed on a fast NUC when booting from a USB
stick.

Note that the `the-tool.serice` already has a
"After=systemd-udev-settle.service" set but that is still
racy because any `udev settle` (or `udev trigger --settle`)
is racy, the only option is to poll for the part uuid to
appear.

This is a minimal commit to avoid too much churn in code.

Thanks to Sertac for reporting this bug.

* snap-bootstrap: rework waitPartSrc to improve testing (thanks to Alberto and Ian)

* snap-bootstrap: show a log message if waitPartSrc needs to wait

If waitPartSrc needs to wait for the device this commit makes it
show a logger.Noticef() message. The message is only shown once
because waiting for the device is usually super quick and if it
is not that is most likely an error anyway so spamming the
terminal will not help.

* snap-bootstrap: add test that ensures that if no waiting is needed for partSrc no log message is displayed

* snap-bootstrap: rename waitPartSrc -> waitFile

* snap-bootstrap: fix time.Duration() casting on 32bit systems
2021-10-05 12:02:20 +02:00
Michael Vogt
f2b1862498 Merge pull request #10877 from mvo5/system-restart-immediate-2.52
many: support an API flag system-restart-immediate to make snap ops proceed immediately with system restarts (2.52)
2021-10-05 10:00:29 +02:00
Michael Vogt
169c60d6f9 Merge pull request #10777 from alfonsosanchezbeato/mm-add-pcie
interfaces/modem-manager: add access to PCIe modems
2021-10-04 17:48:40 +02:00
Michael Vogt
090bb85058 Merge pull request #10870 from bboozzoo/bboozzoo/mark-recovery-capable-after-remodel
overlord/devicestate: record recovery capable system on a successful remodel
2021-10-04 17:46:14 +02:00
Michael Vogt
7485ef72f6 Merge pull request #10869 from MiguelPires/prereq-install-device-ctx
o/snapstate: use device ctx in prerequisite install/update
2021-10-04 17:39:26 +02:00
Michael Vogt
c0c2296afe daemon: update to support 2.52 2021-10-04 16:48:43 +02:00
Ian Johnson
e45dd3e037 Merge pull request #10872 from anonymouse64/feature/uc20-multi-volume-gadget-asset-updates-8
osutil/disks: support filtering by mount opts in MountPointsForPartitionRoot

Rename RootMountPointsForPartition -> MountPointsForPartitionRoot as suggested by Alberto, and expand it to support filtering by mount options since we will need to ensure we are only using rw mounts when actually performing gadget asset updates.

Also address some comments in #10862 and #10857.
2021-10-04 09:13:54 -05:00
Samuele Pedroni
741b4827f4 many: support an API flag system-restart-immediate to make snap ops proceed immediately with system restarts (#10871)
* daemon: introduce system-restart-immediate flag in the snaps APIs

this gets reflected on the Change

* overlord: make Changes respect system-restart-immediate

have all system restart requests that don't use Now already
use snapstate.RestartSystem which consults system-restrat-immediate
on the Change as set by daemon
2021-10-04 14:59:29 +02:00
Samuele Pedroni
309fdb449c many: support an API flag system-restart-immediate to make snap ops proceed immediately with system restarts (#10871)
* daemon: introduce system-restart-immediate flag in the snaps APIs

this gets reflected on the Change

* overlord: make Changes respect system-restart-immediate

have all system restart requests that don't use Now already
use snapstate.RestartSystem which consults system-restrat-immediate
on the Change as set by daemon
2021-10-04 13:52:39 +02:00
Miguel Pires
f9e2271307 o/snapstate: use deviceCtx in prereq update 2021-10-04 10:20:20 +01:00
Miguel Pires
3cff341668 o/snapstate: use deviceCtx in prereq install 2021-10-04 10:20:20 +01:00
Ian Johnson
6e196353fb osutil/disks: support filtering by mount opts in MountPointsForPartitionRoot
This is needed because we want to be sure we can write to the mountpoint
directory we find for the partition, there is a chance for UC20 systems that we
could get the /var/lib/snapd/seed mountpoint for the ubuntu-seed partition when
searching and that would be read-only, but when doing gadget asset updates we
want to be able to write to the partition, so this lets us filter the resulting
mount points by their mount options.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-10-01 17:29:14 -05:00
Ian Johnson
a5f8047388 osutil/disks: RootMountPointsForPartition -> MountPointsForPartitionRoot
Also simplify an if condition to roll two checks into the same if.

Thanks to Maciej, Alberto and Michael for these suggestions.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-10-01 17:27:35 -05:00
Ian Johnson
96a771e117 osutil/disks: add some doc-comments and TODOs
As suggested by Michael in https://github.com/snapcore/snapd/pull/10857.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-10-01 12:53:42 -05:00
Michael Vogt
81766df419 Merge pull request #10862 from anonymouse64/feature/uc20-multi-volume-gadget-asset-updates-7
osutil/disks: add RootMountPointsForPartition
2021-10-01 17:45:08 +02:00
Maciej Borzecki
7899dbf9df tests/nested/manual/core20-remodel: verify snapd_good_recovery_systems= in bootenv
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-01 16:07:52 +02:00
Maciej Borzecki
2bbc395d2a cmd/snap: update snap debug boot-vars unit tests
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-01 15:36:15 +02:00
Maciej Borzecki
33e05cc14f boot: include snapd_good_recovery_systems in debug bootenv dump
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-01 15:31:17 +02:00