diff options
Diffstat (limited to 'scripts/contrib/dialog-power-control')
| -rwxr-xr-x | scripts/contrib/dialog-power-control | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/scripts/contrib/dialog-power-control b/scripts/contrib/dialog-power-control deleted file mode 100755 index 82c84baa1d..0000000000 --- a/scripts/contrib/dialog-power-control +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # Copyright OpenEmbedded Contributors | ||
| 4 | # | ||
| 5 | # SPDX-License-Identifier: GPL-2.0-only | ||
| 6 | # | ||
| 7 | # Simple script to show a manual power prompt for when you want to use | ||
| 8 | # automated hardware testing with testimage.bbclass but you don't have a | ||
| 9 | # web-enabled power strip or similar to do the power on/off/cycle. | ||
| 10 | # | ||
| 11 | # You can enable it by enabling testimage (see the Yocto Project | ||
| 12 | # Development manual "Performing Automated Runtime Testing" section) | ||
| 13 | # and setting the following in your local.conf: | ||
| 14 | # | ||
| 15 | # TEST_POWERCONTROL_CMD = "${COREBASE}/scripts/contrib/dialog-power-control" | ||
| 16 | # | ||
| 17 | |||
| 18 | PROMPT="" | ||
| 19 | while true; do | ||
| 20 | case $1 in | ||
| 21 | on) | ||
| 22 | PROMPT="Please turn device power on";; | ||
| 23 | off) | ||
| 24 | PROMPT="Please turn device power off";; | ||
| 25 | cycle) | ||
| 26 | PROMPT="Please click Done, then turn the device power off then on";; | ||
| 27 | "") | ||
| 28 | break;; | ||
| 29 | esac | ||
| 30 | shift | ||
| 31 | done | ||
| 32 | |||
| 33 | if [ "$PROMPT" = "" ] ; then | ||
| 34 | echo "ERROR: no power action specified on command line" | ||
| 35 | exit 2 | ||
| 36 | fi | ||
| 37 | |||
| 38 | if [ "`which kdialog 2>/dev/null`" != "" ] ; then | ||
| 39 | DIALOGUTIL="kdialog" | ||
| 40 | elif [ "`which zenity 2>/dev/null`" != "" ] ; then | ||
| 41 | DIALOGUTIL="zenity" | ||
| 42 | else | ||
| 43 | echo "ERROR: couldn't find program to display a message, install kdialog or zenity" | ||
| 44 | exit 3 | ||
| 45 | fi | ||
| 46 | |||
| 47 | if [ "$DIALOGUTIL" = "kdialog" ] ; then | ||
| 48 | kdialog --yesno "$PROMPT" --title "TestImage Power Control" --yes-label "Done" --no-label "Cancel test" | ||
| 49 | elif [ "$DIALOGUTIL" = "zenity" ] ; then | ||
| 50 | zenity --question --text="$PROMPT" --title="TestImage Power Control" --ok-label="Done" --cancel-label="Cancel test" | ||
| 51 | fi | ||
| 52 | |||
| 53 | if [ "$?" != "0" ] ; then | ||
| 54 | echo "User cancelled test at power prompt" | ||
| 55 | exit 1 | ||
| 56 | fi | ||
| 57 | |||
