File tree Expand file tree Collapse file tree 6 files changed +36
-0
lines changed
Expand file tree Collapse file tree 6 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,14 @@ package() {
6464 install -D -m644 " target/_surface" " $pkgdir /shell-completions/surface.zsh"
6565 install -D -m644 " target/surface.fish" " $pkgdir /shell-completions/surface.fish"
6666
67+ # copy service files
68+ install -D -m644 " systemd/surface-rapl.service" " $pkgdir /usr/lib/systemd/system/surface-rapl.service"
69+ install -D -m744 " systemd/surface-rapl.sh" " $pkgdir /usr/libexec/surface-rapl.sh"
70+ mkdir -p " $pkgdir /usr/lib/systemd/system/multi-user.target.wants"
71+ ln -sT " ../surface-rapl.service" " $pkgdir /usr/lib/systemd/system/multi-user.target.wants/surface-rapl.service"
72+ mkdir -p " $pkgdir /usr/lib/systemd/system/suspend.target.wants"
73+ ln -sT " ../surface-rapl.service" " $pkgdir /usr/lib/systemd/system/suspend.target.wants/surface-rapl.service"
74+
6775 # copy license
6876 install -D -m644 " LICENSE" " $pkgdir /LICENSE"
6977
Original file line number Diff line number Diff line change @@ -20,5 +20,13 @@ override_dh_install:
2020 install -D -m644 "target/_surface" "${pkgdir}/usr/share/zsh/vendor-completions/_surface"
2121 install -D -m644 "target/surface.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/surface.fish"
2222
23+ # service files
24+ install -D -m644 "systemd/surface-rapl.service" "${pkgdir}/usr/lib/systemd/system/surface-rapl.service"
25+ install -D -m744 "systemd/surface-rapl.sh" "${pkgdir}/usr/libexec/surface-rapl.sh"
26+ mkdir -p "${pkgdir}/usr/lib/systemd/system/multi-user.target.wants"
27+ ln -sT "../surface-rapl.service" "${pkgdir}/usr/lib/systemd/system/multi-user.target.wants/surface-rapl.service"
28+ mkdir -p "${pkgdir}/usr/lib/systemd/system/suspend.target.wants"
29+ ln -sT "../surface-rapl.service" "${pkgdir}/usr/lib/systemd/system/suspend.target.wants/surface-rapl.service"
30+
2331% :
2432 dh $@
Original file line number Diff line number Diff line change @@ -31,6 +31,12 @@ install -D -m755 "target/release/surface" "%{buildroot}/usr/bin/surface"
3131install -D -m644 " target/surface.bash" " %{buildroot}/usr/share/bash-completion/completions/surface"
3232install -D -m644 " target/_surface" " %{buildroot}/usr/share/zsh/site-functions/_surface"
3333install -D -m644 " target/surface.fish" " %{buildroot}/usr/share/fish/vendor_completions.d/surface.fish"
34+ install -D -m644 " systemd/surface-rapl.service" " %{buildroot}/usr/lib/systemd/system/surface-rapl.service"
35+ install -D -m744 " systemd/surface-rapl.sh" " %{buildroot}/usr/libexec/surface-rapl.sh"
36+ mkdir -p " %{buildroot}/usr/lib/systemd/system/multi-user.target.wants"
37+ ln -sT " ../surface-rapl.service" " %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/surface-rapl.service"
38+ mkdir -p " %{buildroot}/usr/lib/systemd/system/suspend.target.wants"
39+ ln -sT " ../surface-rapl.service" " %{buildroot}/usr/lib/systemd/system/suspend.target.wants/surface-rapl.service"
3440
3541%files
3642/usr/bin/surface
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description =Undoes firmware throttling processor after low-battery boot/resume
3+ After =suspend.target
4+
5+ [Service]
6+ Type =oneshot
7+ ExecStart =/usr/libexec/surface-rapl.sh
8+
9+ [Install]
10+ WantedBy =multi-user.target
11+ WantedBy =suspend.target
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ target=/sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_2_power_limit_uw
3+ [ -f " $target " ] && echo 0 > " $target " || :
You can’t perform that action at this time.
0 commit comments