Hi,
I’m trying to update Snap package for an existing Snap CLI app (auto-cpufreq), which is created using following snapcraft.yaml
name: auto-cpufreq
base: core22
summary: Automatic CPU speed & power optimizer for Linux
description: |
Automatic CPU speed & power optimizer for Linux based on active
monitoring of laptop's battery state, CPU usage and system load.
Ultimately allowing you to improve battery life without making
any compromises.
license: LGPL-3.0
grade: stable
confinement: strict
adopt-info: auto-cpufreq
compression: lzo
parts:
auto-cpufreq:
plugin: python
python-packages:
- setuptools
- wheel
- requests
build-packages:
- gcc
- python3-dev
stage-packages:
- coreutils
- dmidecode
source: .
override-pull: |
snapcraftctl pull
snapcraftctl set-version `grep ^VERSION $SNAPCRAFT_PART_SRC/setup.py | sed 's/.*"\(.*\)"/\1/'`
deploy-scripts:
plugin: dump
source: scripts
organize:
cpufreqctl.sh: usr/bin/cpufreqctl.auto-cpufreq
snapdaemon.sh: usr/bin/snapdaemon
copy-image:
plugin: dump
source: images
plugs:
etc-auto-cpufreq-conf:
interface: system-files
write:
- /etc/auto-cpufreq.conf
apps:
auto-cpufreq:
command: bin/auto-cpufreq
environment:
PYTHONPATH: $SNAP/usr/lib/python3/site-packages:$SNAP/usr/lib/python3/dist-packages:$PYTHONPATH
LC_ALL: C.UTF-8
LANG: C.UTF-8
PKG_MARKER: SNAP
plugs:
- cpu-control
- system-observe
- hardware-observe
- etc-auto-cpufreq-conf
auto-cpufreq-gtk:
command: bin/auto-cpufreq-gtk
extensions: [gnome]
environment:
PYTHONPATH: $SNAP/usr/lib/python3/site-packages:$SNAP/usr/lib/python3/dist-packages:$PYTHONPATH
LC_ALL: C.UTF-8
LANG: C.UTF-8
PKG_MARKER: SNAP
plugs:
- desktop
- desktop-legacy
- wayland
- x11
- cpu-control
- system-observe
- hardware-observe
service:
command: usr/bin/snapdaemon
plugs:
- cpu-control
- system-observe
- hardware-observe
environment:
LC_ALL: C.UTF-8
LANG: C.UTF-8
PKG_MARKER: SNAP
daemon: simple
However, after the auto-cpufreq GTK app is run and I click on “install” button (which runs as sudo
to install the daemon)
I’ll be greeted with following (debug) message:
The following error occured:
/bin/sh: 1: pkexec: not found
I’ve came across another Snap that’s using pkexec
where suggestion is to use classic
confinement which fixes the problem.
However, due to the fact I use extensions: [gnome]
in snapcraft.yaml, as soon as I change confinement: strict
to confinement: classic
I’ll get the following error:
snapcraft
Extension 'gnome' does not support confinement 'classic'
Full execution log: '/home/ahodzic/.local/state/snapcraft/log/snapcraft-20230828-201048.785188.log'
Hence, could you please advise me how can I switch to classic confinement with GNOME or have ability not to run into pkexec: not found
error while using strict confinement.
Thanks!
Adnan