File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ 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+ ln -sT " ../surface-rapl.service" " $pkgdir /usr/lib/systemd/system/multi-user.target.wants/surface-rapl.service"
71+ ln -sT " ../surface-rapl.service" " $pkgdir /usr/lib/systemd/system/suspend.target.wants/surface-rapl.service"
72+
6773 # copy license
6874 install -D -m644 " LICENSE" " $pkgdir /LICENSE"
6975
Original file line number Diff line number Diff line change @@ -20,5 +20,11 @@ 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+ ln -sT "../surface-rapl.service" "${pkgdir}/usr/lib/systemd/system/multi-user.target.wants/surface-rapl.service"
27+ ln -sT "../surface-rapl.service" "${pkgdir}/usr/lib/systemd/system/suspend.target.wants/surface-rapl.service"
28+
2329% :
2430 dh $@
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ 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+ ln -sT " ../surface-rapl.service" " %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/surface-rapl.service"
37+ ln -sT " ../surface-rapl.service" " %{buildroot}/usr/lib/systemd/system/suspend.target.wants/surface-rapl.service"
3438
3539%files
3640/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