diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-23 04:40:54 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 19:39:42 +0300 |
commit | 194ff4f1f5d44b12e9cb06ddafa6adb20174a13c (patch) | |
tree | 823835cd29daf8901a31ac14c7e6534abf199be3 /meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button | |
parent | 4feb727cd6b77a68bdaca63e121b378d814f5eaf (diff) | |
download | openbmc-194ff4f1f5d44b12e9cb06ddafa6adb20174a13c.tar.xz |
[Subtree] Bring openbmc machines to top level
The new subtree model brings the subtrees up from the openbmc-machines
layer.
Change-Id: I58a03ae1be374bc79ae1438e65e888375d12d0c0
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button')
3 files changed, 35 insertions, 0 deletions
diff --git a/meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button/id-button-pressed.service b/meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button/id-button-pressed.service new file mode 100644 index 000000000..f633fc307 --- /dev/null +++ b/meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button/id-button-pressed.service @@ -0,0 +1,10 @@ +[Unit] +Description=ID Button Pressed Service +Wants=mapper-wait@-xyz-openbmc_project-led-groups.service +After=mapper-wait@-xyz-openbmc_project-led-groups.service +StartLimitIntervalSec=0 + +[Service] +Type=oneshot +ExecStart=/usr/bin/env toggle_identify_led.sh +SyslogIdentifier=id-button diff --git a/meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button/obmc/gpio/id_button b/meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button/obmc/gpio/id_button new file mode 100644 index 000000000..b1963573f --- /dev/null +++ b/meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button/obmc/gpio/id_button @@ -0,0 +1,5 @@ +DEVPATH=/dev/input/by-path/platform-gpio-keys-event +KEY=135 +POLARITY=1 +TARGET=id-button-pressed.service +EXTRA_ARGS=--continue diff --git a/meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button/toggle_identify_led.sh b/meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button/toggle_identify_led.sh new file mode 100755 index 000000000..eec96d3f1 --- /dev/null +++ b/meta-ibm/meta-romulus/recipes-phosphor/gpio/id-button/toggle_identify_led.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Toggle the state of identify LED Group + +SERVICE="xyz.openbmc_project.LED.GroupManager" +INTERFACE="xyz.openbmc_project.Led.Group" +PROPERTY="Asserted" + +# Get current state +object=$(busctl tree $SERVICE --list | grep identify) +state=$(busctl get-property $SERVICE $object $INTERFACE $PROPERTY \ + | awk '{print $NF;}') + +if [ "$state" == "false" ]; then + target='true' +else + target='false' +fi + +# Set target state +busctl set-property $SERVICE $object $INTERFACE $PROPERTY b $target |