diff options
author | Corey Hinshaw | 2018-02-13 23:14:12 -0500 |
---|---|---|
committer | Corey Hinshaw | 2018-02-13 23:14:12 -0500 |
commit | 70f04a0458b29c7685e81bc2479f5ffc0024826d (patch) | |
tree | 401a52b1f113b29c30e94cf7e8a02c5676c52bc1 /system76-driver.install | |
parent | 7283edef0d274aca230b56c89e7a9a3f9e85b197 (diff) | |
download | aur-70f04a0458b29c7685e81bc2479f5ffc0024826d.tar.gz |
Update to 17.10.19 and add service management to install script
Diffstat (limited to 'system76-driver.install')
-rw-r--r-- | system76-driver.install | 64 |
1 files changed, 53 insertions, 11 deletions
diff --git a/system76-driver.install b/system76-driver.install index a32045365b9b..6045ba31cdc4 100644 --- a/system76-driver.install +++ b/system76-driver.install @@ -1,3 +1,28 @@ +_services="system76.service system76-firmware.service" + +_stop_services() { + /usr/bin/systemctl stop $_services >/dev/null 2>&1 +} + +_disable_services() { + /usr/bin/systemctl disable $_services >/dev/null 2>&1 + /usr/bin/systemctl reset-failed $_services >/dev/null 2>&1 +} + +_restore_services() { + for service in $_services; do + if /usr/bin/systemctl -q is-enabled $service >/dev/null 2>&1; then + /usr/bin/systemctl start $service > /dev/null 2>&1 + fi + done +} + +_remove_symlink() { + if [ -L $1 ] && [ "$(readlink -f $1)" = "$2" ]; then + rm $1 + fi +} + post_install() { cat << EOF @@ -15,32 +40,25 @@ cat << EOF ln -s /usr/share/applications/system76-driver-backlight.desktop /etc/xdg/autostart/system76-driver-backlight.desktop - GUI applications are provided to install drivers, patches, and formware updates. If the applications + GUI applications are provided to install drivers, patches, and firmware updates. If the applications fail to start, try the following commands as root: - GUI versions: - system76-driver system76-firmware - CLI version: - - system76-driver-cli - (!) Under Wayland try using xhost prior to running the GUI applications: xhost +local: + (!) To use system76.service, you must add "ec_sys.write_support=1" to your kernel command line + (!) If you do not use Grub bootloader, please check output for possible manual actions required for your model related to bootloader modifications. (!) For Clevo W740SU BIOS/Firmware users on Galago UltraPro: your will need to create /etc/system76-daemon.json file with following content: - { - "vendor": "System76, Inc", - "model": "galu1" - } + { "vendor": "System76, Inc", "model": "galu1" } (!) If you experience Wifi issues after resuming from suspend, consider using the included network restart script: @@ -50,6 +68,30 @@ cat << EOF EOF } +pre_upgrade() { + _stop_services +} + post_upgrade() { + /usr/bin/systemctl daemon-reload >/dev/null 2>&1 + _restore_services post_install } + +pre_remove() { + _stop_services + _disable_services + + # Remove symlinks if target points to package files + _remove_symlink /etc/xdg/autostart/system76-driver-backlight.desktop /usr/share/applications/system76-driver-backlight.desktop + _remove_symlink /lib/systemd/system-sleep/system76-nm-restart /usr/lib/system76-driver/system76-nm-restart +} + +post_remove() { + /usr/bin/systemctl daemon-reload >/dev/null 2>&1 + cat << EOF + + Be sure to stop and disable all running System76 user services. + +EOF +} |