* overlord: add manager tests for refresh to local revisions
This adds manager tests to test that refresh to the same revision
works and local revisions work.
* snapstate: remove temporary snap file for local revisions early
The SnapSetup.SnapPath is only needed to check/mount the snap. If
the snap is already local we will not mount it again. So we can
remove temporary snap files from e.g. side-loading early.
This fixes the bug that sideloaded snaps that already have local
revisions are not removed. They will get removed eventually via
the snapmgr.go:SnapManager.localInstallCleanup() code. But this
code only runs every 24h and if people install enough side-loaded
snaps the disk may fill-up before the cleanup happens.
* snapstate: move removal of local revisions closer to the "mount" task generation (thanks to Samuele)
* snapstate: fix typo
Without this line:
cat /sys/block/mmcblk0/device/date
results in this denial:
/sys/devices/platform/soc/3f202000.mmc/mmc_host/mmc0/mmc0:aaaa/dateSee: https://forum.snapcraft.io/t/interface-for-read-info-about-sd-card/25202
After adding the line in the commit to my snap apparmor file it works:
root@srly-r7d8mg4oj4eo0go:/home/pi# sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/snap.screenly-client.submit-report
Warning from /var/lib/snapd/apparmor/profiles/snap.screenly-client.submit-report (/var/lib/snapd/apparmor/profiles/snap.screenly-client.submit-report line 1297): Character # was quoted unnecessarily, dropped preceding quote ('') character
root@srly-r7d8mg4oj4eo0go:/home/pi# snap run --shell screenly-client.submit-report
root@srly-r7d8mg4oj4eo0go:/home/pi# cat /sys/block/mmcblk0/device/date
06/2017
Following #10461, avoid visiting same halt task in waitChainSearch helper in ifacestate to avoid slow convergence where the wait graphs might have an exponential number of paths (or very unlikely cycles).
On some systems the pi config.txt cannot be modified safely. E.g.
on devices that measure boot or similar.
This commit adds a way to disable the system.pi-config.* settings
when adding the following header to the config.txt
```
# snapd-edit: no
```
Co-authored-by: Maciej Borzecki <maciek.borzecki@gmail.com>
* configcore: ignore system.pi-config.* setting on measured kernels
Some pi devices uses measured boot, e.g. avnet. On these devices
the config.txt is part of the measurements and we cannot modify
config.txt without changing the measurements and breaking the
boot.
So this commit adds a check for kernels that known to use measured
boot and here the configuration is ignored.
* configcore: tweak naming/comments (thanks to Samuele)
The log appears is visible in the user's terminal when running `snap download`
command.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
the expectations control whether to report "run" or "" on non-UC20
systems.
this is an idea discussed with @bboozzoo, it avoids having to resort
to use the cached value field directly sometimes which is confusing.
introduce sysconfig.Device (similar to boot.Device)
have sysconfig.ApplyFilesystemOnlyDefaults and
sysconfig.ConfigureTargetSystem take the model and pass down a
sysconfig.Device
for these two we assume that mode is not run
We want to make sure that the swap size is an even integer number of megabytes
and that it's not too small, and that it's not negative.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
Add a handler for the system swap option which manipulates /etc/default/swapfile
and swapfile.service. This option works both with systemd around at runtime, and
without during the initrd for example when only the rootfs is available.
In order to properly handle this when the key is not set without running systemd
unnecessarily, we need to use GetPristine to indicate if the value was changed
or not.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
* interfaces/opengl: add support for Imagination PowerVR
* interfaces: update opengl_test.go for new pvr_sync driver
Co-authored-by: Michael Vogt <mvo@ubuntu.com>
* interfaces/netlink-protocol: add netlink-protocol interface
Some kernel drivers implement custom netlink protocol for the communication with userspace.
Provide interface which allows gadget snap to enable custom protocols.
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
* tests: add spread test for netlink-protocol interface
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
* interfaces: netlink-protocol -> netlink-driver, other adjustments
Thanks to Samuele for the suggestions
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
* interfaces/policy/basedeclaration_test.go: add netlink-driver as a snowflake
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
* interfaces/netlink-driver: validate family-name plug attr w/ BeforePreparePlug
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
* interfaces/netlink-driver: add additional accesses
This then matches the existing netlink-connector interface.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
* interfaces/builtin/netlink_driver: fix unit tests to match current access patterns
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Co-authored-by: Ian Johnson <ian.johnson@canonical.com>
Co-authored-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>