From 967e73f80668de39e109daca4aa5dae3684601fe Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Sun, 4 Apr 2021 16:16:02 +0100 Subject: [PATCH] Adds systemd scripts for hardware access and modem --- .gitignore | 1 + systemd/.config/systemd/user/monitorModem.service | 9 +++++++++ .../etc/systemd/system/pinephone-hardware-access.service | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100644 systemd/.config/systemd/user/monitorModem.service create mode 100644 systemd/ROOT/etc/systemd/system/pinephone-hardware-access.service diff --git a/.gitignore b/.gitignore index 4bf02c9d..48bd772d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,6 @@ mutt/accounts/* /qutebrowser/.config/qutebrowser/autoconfig.yml /bin/.bin/pappy /systemd/.config/systemd/user/timers.target.wants/ +/systemd/.config/systemd/user/default.target.wants/ nvim/.config/nvim/.netrwhist remind/.local/share/remind/work.rem diff --git a/systemd/.config/systemd/user/monitorModem.service b/systemd/.config/systemd/user/monitorModem.service new file mode 100644 index 00000000..7f15d6f2 --- /dev/null +++ b/systemd/.config/systemd/user/monitorModem.service @@ -0,0 +1,9 @@ +[Unit] +Description=Monitor Modem + +[Service] +Environment="PATH=/usr/bin:/usr/local/bin:/home/jonathan/.bin:/home/jonathan/.bin/modem:/home/jonathan/.bin/dmenu" +ExecStart=/home/jonathan/.bin/modem/monitorModem + +[Install] +WantedBy=default.target diff --git a/systemd/ROOT/etc/systemd/system/pinephone-hardware-access.service b/systemd/ROOT/etc/systemd/system/pinephone-hardware-access.service new file mode 100644 index 00000000..52d47b88 --- /dev/null +++ b/systemd/ROOT/etc/systemd/system/pinephone-hardware-access.service @@ -0,0 +1,9 @@ +[Unit] +Description=Enable user access to pinephone hardware kernel interface + +[Service] +Type=oneshot +ExecStart=/bin/bash -c 'for i in /sys/module/8723cs/parameters/rtw_scan_interval_thr /sys/devices/platform/backlight/backlight/backlight/brightness /sys/power/state /sys/devices/platform/soc/1f00000.rtc/power/wakeup /sys/power/mem_sleep /sys/bus/usb/drivers/usb/unbind /sys/bus/usb/drivers/usb/bind /sys/class/leds/red:indicator/brightness /sys/class/leds/blue:indicator/brightness /sys/class/leds/green:indicator/brightness /sys/class/leds/white:flash/brightness /dev/rtc0 /sys/devices/platform/soc/1f03400.rsb/sunxi-rsb-3a3/axp221-pek/power/wakeup /sys/class/wakeup/*; do [ -e "$i" ] && chmod a+rw "$i" >> /tmp/log 2>&1; done' + +[Install] +WantedBy=multi-user.target