From e73cae4c8193a0983d41e4e59e9b114f77928ca5 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Mon, 5 Mar 2018 17:52:27 -0700 Subject: [PATCH] Update Envy --- HP_Envy/HP_Envy.md | 22 ++++++++ HP_Envy/etc/acpi/actions/bl_down.sh | 4 ++ HP_Envy/etc/acpi/actions/bl_up.sh | 4 ++ HP_Envy/etc/acpi/events/anything | 3 ++ HP_Envy/etc/acpi/events/bl_down | 2 + HP_Envy/etc/acpi/events/bl_up | 2 + HP_Envy/etc/acpi/handler.sh | 77 +++++++++++++++++++++++++++ HP_Envy/etc/modprobe.d/blacklist.conf | 4 ++ 8 files changed, 118 insertions(+) create mode 100644 HP_Envy/HP_Envy.md create mode 100755 HP_Envy/etc/acpi/actions/bl_down.sh create mode 100755 HP_Envy/etc/acpi/actions/bl_up.sh create mode 100644 HP_Envy/etc/acpi/events/anything create mode 100644 HP_Envy/etc/acpi/events/bl_down create mode 100644 HP_Envy/etc/acpi/events/bl_up create mode 100755 HP_Envy/etc/acpi/handler.sh create mode 100644 HP_Envy/etc/modprobe.d/blacklist.conf diff --git a/HP_Envy/HP_Envy.md b/HP_Envy/HP_Envy.md new file mode 100644 index 0000000..a80e40a --- /dev/null +++ b/HP_Envy/HP_Envy.md @@ -0,0 +1,22 @@ +# Module Blacklist + +* sp5100_tco - something nvidia related +* acer_wmi - some acer wireless module that hangs while booting +* amd_gpio - Further testing needed +* tpm_crb -- TPM crap, may not need to be blacklisted, further testing needed + +# Disabled Services +* systemd-rfkill.socket -- Further testing needed + +# ACPI Config +* Add events and actions in order to control brightness + Check your codes with "acpi_listen" and then press your brightness keys + They may be different. Edit the events files as needed + +NOTES: + The above was all tested as of kernel 4.5.16 + The ones marked with "needs more testing" were done all at the same time + and the kernel updated to 4.5.17 during the process. + It's possible that the kernel upgrade fixes all these issues, but the system + boots now. Also, the acer module is certainly not needed as this laptop + has nothing from acer diff --git a/HP_Envy/etc/acpi/actions/bl_down.sh b/HP_Envy/etc/acpi/actions/bl_down.sh new file mode 100755 index 0000000..11e2ff4 --- /dev/null +++ b/HP_Envy/etc/acpi/actions/bl_down.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +bl_device=/sys/class/backlight/amdgpu_bl0/brightness +echo $(($(cat $bl_device)-5)) | sudo tee $bl_device diff --git a/HP_Envy/etc/acpi/actions/bl_up.sh b/HP_Envy/etc/acpi/actions/bl_up.sh new file mode 100755 index 0000000..bd0e883 --- /dev/null +++ b/HP_Envy/etc/acpi/actions/bl_up.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +bl_device=/sys/class/backlight/amdgpu_bl0/brightness +echo $(($(cat $bl_device)+5)) | sudo tee $bl_device diff --git a/HP_Envy/etc/acpi/events/anything b/HP_Envy/etc/acpi/events/anything new file mode 100644 index 0000000..d182898 --- /dev/null +++ b/HP_Envy/etc/acpi/events/anything @@ -0,0 +1,3 @@ +# Pass all events to our one handler script +event=.* +action=/etc/acpi/handler.sh %e diff --git a/HP_Envy/etc/acpi/events/bl_down b/HP_Envy/etc/acpi/events/bl_down new file mode 100644 index 0000000..1f4d13a --- /dev/null +++ b/HP_Envy/etc/acpi/events/bl_down @@ -0,0 +1,2 @@ +event=video/brightnessdown BRTDN 00000087 00000000 +action=/etc/acpi/actions/bl_down.sh diff --git a/HP_Envy/etc/acpi/events/bl_up b/HP_Envy/etc/acpi/events/bl_up new file mode 100644 index 0000000..b182e5f --- /dev/null +++ b/HP_Envy/etc/acpi/events/bl_up @@ -0,0 +1,2 @@ +event=video/brightnessup BRTUP 00000086 00000000 +action=/etc/acpi/actions/bl_up.sh diff --git a/HP_Envy/etc/acpi/handler.sh b/HP_Envy/etc/acpi/handler.sh new file mode 100755 index 0000000..bab144d --- /dev/null +++ b/HP_Envy/etc/acpi/handler.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# Default acpi script that takes an entry for all actions + +case "$1" in + button/power) + case "$2" in + PBTN|PWRF) + logger 'PowerButton pressed' + ;; + *) + logger "ACPI action undefined: $2" + ;; + esac + ;; + button/sleep) + case "$2" in + SLPB|SBTN) + logger 'SleepButton pressed' + ;; + *) + logger "ACPI action undefined: $2" + ;; + esac + ;; + ac_adapter) + case "$2" in + AC|ACAD|ADP0) + case "$4" in + 00000000) + logger 'AC unpluged' + ;; + 00000001) + logger 'AC pluged' + ;; + esac + ;; + *) + logger "ACPI action undefined: $2" + ;; + esac + ;; + battery) + case "$2" in + BAT0) + case "$4" in + 00000000) + logger 'Battery online' + ;; + 00000001) + logger 'Battery offline' + ;; + esac + ;; + CPU0) + ;; + *) logger "ACPI action undefined: $2" ;; + esac + ;; + button/lid) + case "$3" in + close) + logger 'LID closed' + ;; + open) + logger 'LID opened' + ;; + *) + logger "ACPI action undefined: $3" + ;; + esac + ;; + *) + logger "ACPI group/action undefined: $1 / $2" + ;; +esac + +# vim:set ts=4 sw=4 ft=sh et: diff --git a/HP_Envy/etc/modprobe.d/blacklist.conf b/HP_Envy/etc/modprobe.d/blacklist.conf new file mode 100644 index 0000000..a3d64b0 --- /dev/null +++ b/HP_Envy/etc/modprobe.d/blacklist.conf @@ -0,0 +1,4 @@ +blacklist acer_wmi +blacklist sp5100_tco +blacklist amd_gpio +blacklist tpm_crb