Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add custom-device-pollrates service which allows on-the-fly adding/re… #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

GloriousEggroll
Copy link

…moval of devices

@KarsMulder
Copy link
Owner

I haven't gotten around to actually spinning up a Fedora virtual machine to test this PR yet, but here are my thoughts so far:

Line 3 from custom-device-pollrates.sh looks like it should be a comment, but the line does not start with a #.

custom-device-pollrates.spec states that the license of the service is GPLv3+. The patch itself is GPLv2-only like the rest of the Linux kernel. I suppose that there is no strict need for the patch and the service to have the same license since the Kernel's GPL does not transcend syscall boundaries, but I feel like putting files with incompatible licenses in the same repository may cause more trouble than it is worth. Could you relicense your contribution to GPLv2 or GPLv2+?

The default configuration file custom-device-pollrates.conf contains some uncommented sample directives, which could cause the user's pollrate of some devices to change merely by installing the service. I think that merely installing the service should not cause some arbitrary device's pollrates to suddenly change; the pollrate should only change when the user expressedly requested that change.

@GloriousEggroll
Copy link
Author

Sure, the license was a mistaken copy-paste when I was creating the spec sheet, and someone in my discord called out the missing line comment as well. On Nobara we ship the DS4/DS5 configs enabled as it's a gaming oriented distro but I agree in general there should be no defaults, I've commented them out in the config and added instructions on usage. I also fixed up a missing dependency on the rpm spec sheet that was causing the post/postun scriptlets to fail. Should be solid now hopefully.

@KarsMulder
Copy link
Owner

I just tried building the service on a fresh installation of Fedora Workstation 37, but it doesn't seem to work for me:

$ git clone https://github.com/GloriousEggroll/Linux-Pollrate-Patch
$ cd Linux-Pollrate-Patch
$ rpmbuild -ba custom-device-pollrates.spec
warning: source_date_epoch_from_changelog set but %changelog is missing
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.NCqRZY
+ umask 022
+ cd /home/user/rpmbuild/BUILD
+ '[' /home/user/rpmbuild/BUILDROOT/custom-device-pollrates-1.0.0-4.fc37.x86_64 '!=' / ']'
+ rm -rf /home/user/rpmbuild/BUILDROOT/custom-device-pollrates-1.0.0-4.fc37.x86_64
++ dirname /home/user/rpmbuild/BUILDROOT/custom-device-pollrates-1.0.0-4.fc37.x86_64
+ mkdir -p /home/user/rpmbuild/BUILDROOT
+ mkdir /home/user/rpmbuild/BUILDROOT/custom-device-pollrates-1.0.0-4.fc37.x86_64
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes'
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
+ mkdir -p /home/user/rpmbuild/BUILDROOT/custom-device-pollrates-1.0.0-4.fc37.x86_64/usr/bin/
+ mkdir -p /home/user/rpmbuild/BUILDROOT/custom-device-pollrates-1.0.0-4.fc37.x86_64/usr/lib/systemd/system-preset/
+ mkdir -p /home/user/rpmbuild/BUILDROOT/custom-device-pollrates-1.0.0-4.fc37.x86_64/usr/lib/systemd/system/
+ mkdir -p /home/user/rpmbuild/BUILDROOT/custom-device-pollrates-1.0.0-4.fc37.x86_64/etc/custom-device-pollrates
+ install -Dm755 /home/user/rpmbuild/SOURCES/custom-device-pollrates.sh /home/user/rpmbuild/BUILDROOT/custom-device-pollrates-1.0.0-4.fc37.x86_64/usr/bin/custom-device-pollrates.sh
install: cannot stat '/home/user/rpmbuild/SOURCES/custom-device-pollrates.sh': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.NCqRZY (%install)

RPM build warnings:
    source_date_epoch_from_changelog set but %changelog is missing

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.NCqRZY (%install)

@GloriousEggroll
Copy link
Author

builds properly here using mock, also builds fine on copr, and the script is definitely there:

$ ls
99-custom-device-pollrates.preset custom-device-pollrates.sh pollrate.patch
custom-device-pollrates.conf custom-device-pollrates.spec README.md
custom-device-pollrates.service LICENSE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants