deinstapel / cpupower

Manage the frequency scaling driver of your CPU (Intel Core and AMD Ryzen processors supported)
GNU General Public License v3.0
527 stars 69 forks source link

Not installable on ostree OSes #192

Open marcolaux opened 2 years ago

marcolaux commented 2 years ago

Hello and good day,

would you be interested to make this nice extension compatible with immutable OSes like Fedora Silverblue?

/usr for example is not writable and the udev rules for example could be written to /etc instead.

The script itself could still rely within the extension folder and does not need to be in /usr/bin or /usr/local/bin.

What do you think?

All the best marco

fin-ger commented 2 years ago

Afaik GNOME Shell extensions are unsupported on ostree by design. Therefore no GNOME shell extension is able to run on Silverblue. Please prove me wrong if that is not the case. Thank you for your contribution!

marcolaux commented 2 years ago

Afaik GNOME Shell extensions are unsupported on ostree by design. Therefore no GNOME shell extension is able to run on Silverblue. Please prove me wrong if that is not the case. Thank you for your contribution!

This not quite true. I have several extensions installed. Extensions are install-able by the user.

It's just that changes to the root filesystems can't be made without creating a layer.

But everything in userspace does not change at all.

marcolaux commented 2 years ago

Because /etc/ is still writable the udev rules could be moved to there and the executable could rely within the path of the extension itself instead to get moved to /usr or /local/usr, that is not writable in Silverblue.

marcolaux commented 2 years ago

In Silverblue and Kinoite the changeable things by the user are moved to /var (/var/etc, /var/home) and the previous paths (/etc and /home) are just symlinks to there. Everything in /var is changable.

fin-ger commented 2 years ago

Having the cpufreqctl executable in a user-writable location is a no-go for security reasons as this script gets executed with superuser rights and must never be writable by an unprivileged user.

But nevertheless ostree support is then worth having a look at. Thanks for your hint!

marcolaux commented 2 years ago

What do you think about /opt/ :)

fin-ger commented 2 years ago

If that's a location usable in ostree and not writable by normal users, it's fine, I think. I think the easiest approach would be to package this extension as a native package for ostree based distros. In other distros /opt is usually managed by the distros package manager and therefore not a good location to put the cpufreqctl binary. /usr/local is I think the only sane location for GNOME extension website installs.

fin-ger commented 2 years ago

If that's not possible because GNOME shell extensions are only installable via the Extensions website on ostree, a native companion package which provides the polkit rules and cpufreqctl tool would be a good solution. If there exists a reliable mechanism to identify ostree distros, the extension could ask the user to install this companion package instead of trying to install itself into /usr/local.

marcolaux commented 2 years ago

I learned that it's indeed possible to use /usr/local/bin for custom executables and scripts.