Skip to content

Commit

Permalink
Use absolute paths within systemd units.
Browse files Browse the repository at this point in the history
Supporting systemd prior to 239.
  • Loading branch information
Rouven Spreckels committed Aug 17, 2019
1 parent 4c8882b commit d0e63db
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ETC := /etc/default/huawei-wmi/
SYS := /sys/devices/platform/huawei-wmi/

PKG := huawei-wmi
VER := 1.0.0
VER := 1.0.1
SRC := $(PKG)-$(VER)/

.DEFAULT_GOAL := all
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
huawei-wmi (1.0.1) stable; urgency=medium

* Use absolute paths within systemd units supporting systemd prior to 239.

-- Rouven Spreckels <[email protected]> Sat, 17 Aug 2019 10:37:41 +0200

huawei-wmi (1.0.0) stable; urgency=medium

* Add `suspend-then-hibernate.target`.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 0 additions & 14 deletions generic/huawei-wmi-1.0.0/huawei-wmi-privilege.service

This file was deleted.

File renamed without changes.
13 changes: 13 additions & 0 deletions generic/huawei-wmi-1.0.1/huawei-wmi-privilege.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Huawei WMI Privilege
After=sys-devices-platform-huawei\x2dwmi.device

[Service]
Type=oneshot
Environment=SYS=/sys/devices/platform/huawei-wmi
ExecStart=/bin/sh -c '[ -e ${SYS}/charge_thresholds -a -e ${SYS}/fn_lock_state ] || sleep 1'
ExecStart=/bin/chgrp huawei-wmi ${SYS}/charge_thresholds ${SYS}/fn_lock_state
ExecStart=/bin/chmod g=u ${SYS}/charge_thresholds ${SYS}/fn_lock_state

[Install]
WantedBy=sys-devices-platform-huawei\x2dwmi.device
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ User=nobody
Group=huawei-wmi
Environment=ETC=/etc/default/huawei-wmi
Environment=SYS=/sys/devices/platform/huawei-wmi
ExecStart=sh -c 'echo Old charge thresholds $(cat ${SYS}/charge_thresholds)'
ExecStart=sh -c 'cat ${ETC}/charge_thresholds > ${SYS}/charge_thresholds'
ExecStart=sh -c 'echo New charge thresholds $(cat ${SYS}/charge_thresholds)'
ExecStart=/bin/sh -c 'echo Old charge thresholds $(cat ${SYS}/charge_thresholds)'
ExecStart=/bin/sh -c 'cat ${ETC}/charge_thresholds > ${SYS}/charge_thresholds'
ExecStart=/bin/sh -c 'echo New charge thresholds $(cat ${SYS}/charge_thresholds)'

[Install]
WantedBy=huawei-wmi-privilege.service
Expand Down

0 comments on commit d0e63db

Please sign in to comment.