58475 Commits

Author SHA1 Message Date
Michael Vogt
87725a5df4 release: 2.60 (#12894) 2.60 2023-06-15 17:43:28 +02:00
Alex Murray
7eb7ffae0c snap: update vendored apparmor to 3.0.8 with userns and mqueue support (#12836)
* snap: update vendored apparmor to 3.0.8 with userns and mqueue support

Update the snap build to use the latest upstream AppArmor 3.0.8 release and also
add local patches to add support for userns and POSIX mqueue mediation support.

Signed-off-by: Alex Murray <alex.murray@canonical.com>

* build-aux/snap: fetch patches during build rather than vendor them

By fetching them during the build *and* using the source of the Ubuntu apparmor
package in lunar (23.04) this allows us to keep these patches in sync with what
is used in Ubuntu and to show their provenance at the same time.

Signed-off-by: Alex Murray <alex.murray@canonical.com>

---------

Signed-off-by: Alex Murray <alex.murray@canonical.com>
Co-authored-by: Michael Vogt <mvo@ubuntu.com>
2023-06-15 16:44:46 +02:00
Michael Vogt
67cb157533 NEWS.md: add more new 2.60 features (#12890)
* NEWS.md: add note about install from initrd

* NEWS.md: update to include more 2.60 features

* README.md: fix typo (thanks to Graham)
2023-06-15 15:37:09 +02:00
Valentin David
4f2d107db1 interfaces/udev: do not tag modules
Module loading generates event for devpath /module/<nameofmodule>.
Some modules and devices have the same KERNEL name. For example
rfkill. We need to ignore module insertions. Otherwise we get
error message when trying to run snap-device-helper.
2023-06-15 15:21:15 +02:00
Sergio Costas
cc7fab59a2 account_control: allow local user account management (#12626)
* account_control: allow local user account management

This MR adds support for adding, removing and modifying the users.
It is required for Core Desktop.

* Remove peer entries

* Add peer=(label=unconfined)

It works the same.

* Add extra peer=(label=unconfined)
2023-06-15 10:16:56 +02:00
Sergio Cazzolato
8c723a5b9d tests: skip snap-advice-command test on exernal backend (#12884)
On some slow external devices the test fails to restart snapd on restore

As the test fails during restore, it means the whole execution fails
forcing re-execution.

The idea is to run this for classic and uc16 in google.
2023-06-14 21:44:09 +02:00
Valentin David
c91f0ae069 cmd/snap-bootstrap: make a unit test work on other architectures 2023-06-14 21:42:45 +02:00
Valentin David
cc5dbce977 tests: add test installing uc20 in initrd 2023-06-14 21:42:45 +02:00
Valentin David
6b57ec4736 snap-boostrap: install in initrd 2023-06-14 21:42:45 +02:00
Valentin David
2c40260b1a o/c/configcore/services.go: read modeenv instead of kcmdline 2023-06-14 21:42:45 +02:00
Valentin David
2d2d077fc0 cmd/snap/cmd_auto_import.go: read modeenv instead of kcmdline 2023-06-14 21:42:45 +02:00
Valentin David
47a9204792 spread-shellcheck: fix quotes in environment variables 2023-06-14 21:42:45 +02:00
Valentin David
7a03cd15c2 gadget/install/install.go: obey seed mounted by initramfs
We need to be consistant on what snap-bootstrap mounts as seed and
where UC is installed. There are cases where multiple disks contain UC
seed. snap-bootstrap may choose a disk based on kernel parameters.
2023-06-14 21:40:47 +02:00
Alfonso Sánchez-Beato
d72df3375f many: add pointer to volume in gadget.VolumeStructure.
With this pointer we can access to "partial" options from the Volume,
with information that we need to check if the structure needs a
filesystem or if it has a partially defined size.

Additionally, rename willHaveFilesystem() to HasFilesystem() and use
it everywhere, as in the end they mean the same: the structure
definition in the gadget expects a filesystem to be there.
2023-06-14 18:07:20 +02:00
Michael Vogt
ab54d2e91d devicestate: do not use the proxy for device-service on proxy errors
When a `proxy.store` is used together with a `device-service.url`
snapd will try to acquire the serial assertion via the proxy
store.

If there was any error from the proxy store snapd would historically
just ignore the proxy store and use the `device-service.url` directly.

However this behavior is not neccessarily correct as the proxy may
just be down or configured incorrectly. So this was changed [1] but
existing customers depend on the old behavior.

For a real fix we need a way to express that a proxy store should
be used in general but that it should not be used for the
`device-service.url`. This is not possible to express right now
and needs design.

So as a short term fix this commit restores the old behavior.

[1] https://github.com/snapcore/snapd/pull/12593/files#diff-def3111c6efb66814e58452672900286c18087b637548fcee28c321ada4a2b6c
2023-06-14 17:48:09 +02:00
Michael Vogt
c9310ccf3e tests: update cgroup-tracking test for the new pattern 2023-06-13 22:17:56 +02:00
Nick Rosbrook
95f1e3c414 sandbox/cgroup: change scope unit pattern to snap.<pkg>.<app>-<uuid>.scope
The current naming pattern for transient scope units does not yield a
natural way to create systemd drop-in configurations that apply to all
instances of a snap, regardless of the UUID. For example, systemd
drop-in configurations for a unit named foo-bar-baz.scope could be made
by placing .conf snippets in any of the following directories:

 /etc/systemd/user/foo-bar-baz.scope.d/
 /etc/systemd/user/foo-bar-.scope.d/
 /etc/systemd/user/foo-.scope.d/

In other words, successively truncating the unit name after '-' yields
valid drop-in directory names. This feature is specifc to '-', and in
particular does not work with '.'.

It is desirable to have the ability to write drop-in configurations that
apply, for example, to all instances of firefox. To allow this
functionality, modify the pattern used for transient scope units to
snap.<pkg>.<app>-<uuid>.scope (i.e. separate the app name and UUID by a '-').

Both the old and the new patterns are supported in an attempt to make
a smooth transition.

Signed-off-by: Nick Rosbrook <nick.rosbrook@canonical.com>
2023-06-13 22:17:56 +02:00
Miguel Pires
598df3621a daemon: add aspects endpoint to REST API
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-06-13 17:36:48 +02:00
Miguel Pires
910ce42ac1 tests: commented out unused code in hidden dir test
Shellcheck complains about unreachable code in the hidden-snap-dir
test. This commit comments out that code.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-06-13 16:16:11 +01:00
Michael Vogt
d7d0d6570a interfaces: fix network-control rule for apparmor 3.1.4
It looks like some changes in apparmor 3.1.4 cause issues with
the existing network-control rules. It appears the rules are
stricter now.

Thie commit updates the rules to match the new behavior, see
also https://bugs.launchpad.net/apparmor/+bug/2023025
2023-06-13 12:48:15 +02:00
Miguel Pires
ce612b151b timeutil: check error result in test
Adds an error assertion and replaces a deferred restore with
testutil.Backup (follow-up of #12859).

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-06-12 14:37:13 +01:00
Miguel Pires
b73965e68f bootloader: remove naked return
Removes a naked return that the latest version of golangci-lint
complains about.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-06-12 14:37:13 +01:00
Tim Smeets
b44704463a Add flipper zero to u2f devices under existing STMicro based products 2023-06-12 09:00:49 +02:00
Michael Vogt
9c79c6011e spread: add apparmor version as part of the debug output 2023-06-08 16:30:14 +02:00
Oliver Calder
42bcf1097d interfaces/builtin: added zfs mount options to mount-control
Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
2023-06-08 08:50:22 +02:00