Created attachment 436122 [details] Proposed cpugov.eselect module Attached is a proposed cpugov.eselect module for manually selecting governors and/or frequencies for cpus. This will work with modern cpus, including desktops, if frequency scaling support is compiled into the kernel, or as a module. But the obvious target will be laptops, etc. This will work from the bash commandline, or in a script. psuedo-governors "max" and "min" have been added. Note that some advanced Intel cpus may change frequencies even while in performance or powersave mode. cpugov "max" and "min" prevent that. As usual, root or sudo permission is required to change frequencies/governors. I'm not a developer, and don't know how to go about doing the ebuild, let alone adding it to the Gentoo tree. But I am willing to be proxy-maintainer for "eselect cpugov". I'll be using it on my machines. Thanks to Ulrich Mueller for helping me get this module into conformance with Gentoo specs.
It sounds like you have re-implemented a subset of sys-apps/cpupower. Why?
(In reply to Mike Gilbert from comment #1) > It sounds like you have re-implemented a subset of sys-apps/cpupower. Why? With "a very small subset" of the required space, too. [i3][waltdnes][~] emerge -pv cpupower These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] sys-apps/pciutils-3.3.1::gentoo USE="kmod zlib -dns -static-libs -udev" 385 KiB [ebuild N ] sys-power/cpupower-3.18::gentoo USE="-cpufreq_bench -debug -nls" 79,038 KiB Total: 2 packages (2 new), Size of downloads: 79,423 KiB cpugov.eselect, fully expanded, is 7511 bytes. I'm afraid to ask how much space cpupower consumes once the 79 megabyte tarball is expanded and built. WHY does it need that much stuff???
(In reply to Walter Dnes from comment #2) > cpugov.eselect, fully expanded, is 7511 bytes. I'm afraid to ask how much > space cpupower consumes once the 79 megabyte tarball is expanded and built. > WHY does it need that much stuff??? cpupower is shipped as part of the linux kernel sources, so the 79 MB is a full copy of the linux kernel source code. The size could be reduced by repacking the source code in a new tarball.
Adding eselect@g.o in case they want to pick this up.
> % emerge -pv1 cpupower > > These are the packages that would be merged, in order: > > Calculating dependencies... done! > [ebuild R ] sys-power/cpupower-4.5.0::gentoo USE="nls -cpufreq_bench -debug" 67 KiB > > Total: 1 package (1 reinstall), Size of downloads: 67 KiB That's a bit nicer. ;)
(In reply to Walter Dnes from comment #0) > I'm not a developer, and don't know how to go about doing the ebuild, let > alone adding it to the Gentoo tree. But I am willing to be proxy-maintainer > for "eselect cpugov". In order that you can proxy maintain it, there needs to be an ebuild first. Which should be easy to write: no eclasses, and only one function, namely src_install() with a single insinto/doins pair. Also there are plenty of examples in the app-eselect category.
The ebuild process includes downloading the file, which raises the next question... where should I post it? Is there a preferred site like github or dev.gentoo.org? I'll need to set up an account at whatever site I use.
Created attachment 436480 [details] Preliminary eselect-cpugov-0.1.ebuild
> SRC_URI="https://dev.gentoo.org/~xxxxxx/distfiles/${P}.gz" Probably better to put this on a source hosting site like github.com or gitlab.com instead of expecting a developer to keep sources in personal dev space. Also the eselect module appears to have been gzipped twice. Was that intentional?
(In reply to nvinson234 from comment #9) > Also the eselect module appears to have been gzipped twice. Was that > intentional? That's a bug in your web browser. Fetch it with wget and it will only be compressed once. Of course, there was no need to compress a 7k file in the first place.
(In reply to Mike Gilbert from comment #10) > > That's a bug in your web browser. Fetch it with wget and it will only be > compressed once. so it is. Thanks for the heads up. I retract my question.
Created attachment 436906 [details] Latest ebuild
I hate this. I had a long comment, added an attachment, and only the attachment came through. Ugh. Anyhow, IANAD (I Am Not A Developer). I wanted to test the latest ebuild, but something is not properly set up in my local overlay. I think I followed the wiki instructions fully. Anyhow, here's what happens when I tried "emerge eselect-cpugov-0.1.ebuild digest" *** emerging by path is broken and may not always work!!! Calculating dependencies / * Manifest not found for '/usr/local/portage/app-eselect/eselect-cpugov/eselect-cpugov-0.1.ebuild' *** You are emerging a masked package. It is MUCH better to use *** /etc/portage/package.* to accomplish this. See portage(5) man *** page for details. >>> Waiting 10 seconds before starting... >>> (Control-C to abort)... Continuing... in: 10 9 8 7 6 5 4 3 2 1 ... done! Traceback (most recent call last): File "/usr/lib/python-exec/python2.7/emerge", line 50, in <module> retval = emerge_main() File "/usr/lib64/python2.7/site-packages/_emerge/main.py", line 1185, in emerge_main return run_action(emerge_config) File "/usr/lib64/python2.7/site-packages/_emerge/actions.py", line 3236, in run_action emerge_config.args, spinner) File "/usr/lib64/python2.7/site-packages/_emerge/actions.py", line 324, in action_build settings, trees, myopts, myparams, myaction, myfiles, spinner) File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 9196, in backtrack_depgraph myaction, myfiles, spinner) File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 9233, in _backtrack_depgraph success, favorites = mydepgraph.select_files(myfiles) File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 3583, in select_files return self._select_files(args) File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 3685, in _select_files os.path.dirname(os.path.dirname(os.path.dirname(ebuild_path))))) File "/usr/lib64/python2.7/site-packages/_emerge/depgraph.py", line 6532, in _pkg raise portage.exception.PackageNotFound(cpv) PackageNotFound: app-eselect/eselect-cpugov-0.1
Oh, I forgot to mention the Github location... https://github.com/walterdnes/cpugov/blob/master/cpugov.eselect
(In reply to Walter Dnes from comment #12) > Created attachment 436906 [details] > Latest ebuild > # Copyright 2016 Gentoo Foundation > # Distributed under the terms of the GNU General Public License v2 > # $Id$ Please use the standard header from header.txt. > > EAPI=5 Why not EAPI 6? > > DESCRIPTION="Manages cpu governor and frequency selection" > HOMEPAGE="https://www.gentoo.org" https://wiki.gentoo.org/wiki/No_homepage would be a better choice here. > SRC_URI="https://github.com/walterdnes/${P}" This cannot be unpacked automatically. You need a tarball and/or compression there, otherwise an explicit src_unpack function would be needed. (But see below.) > > LICENSE="GPL-2" Should be GPL-2+ because the license is GPL v2 or later. > SLOT="0" > KEYWORDS="amd64 x86" Don't start with stable keywords. > IUSE="" Not needed. There should be an RDEPEND on app-admin/eselect. > > src_install() { > insinto /usr/share/eselect/modules > doins cpugov.eselect > } (In reply to Walter Dnes from comment #14) > Oh, I forgot to mention the Github location... > https://github.com/walterdnes/cpugov/blob/master/cpugov.eselect I guess you should make a release there, in order to create a distfile that can be automatically unpacked.
(In reply to Walter Dnes from comment #13) > I hate this. I had a long comment, added an attachment, and only the > attachment came through. Ugh. Anyhow, IANAD (I Am Not A Developer). I wanted > to test the latest ebuild, but something is not properly set up in my local > overlay. I think I followed the wiki instructions fully. Anyhow, here's what > happens when I tried "emerge eselect-cpugov-0.1.ebuild digest" > > *** emerging by path is broken and may not always work!!! > > Calculating dependencies / * Manifest not found for > '/usr/local/portage/app-eselect/eselect-cpugov/eselect-cpugov-0.1.ebuild' > > *** You are emerging a masked package. It is MUCH better to use > *** /etc/portage/package.* to accomplish this. See portage(5) man > *** page for details. > >>> Waiting 10 seconds before starting... > >>> (Control-C to abort)... > Continuing... in: 10 9 8 7 6 5 4 3 2 1 > ... done! > Traceback (most recent call last): To update the manifest: ebuild eselect-cpugov-0.1.ebuild manifest. That said, you might consider joining the IRC channel #gentoo-proxy-maint or the IRC channel #gentoo-dev-help for help in crafting and testing the ebuild. Both channels are on freenode's IRC network (irc.freenode.net).