From 81c0f027f8473fbbbf7f42b277853551c29264c3 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Fri, 2 Feb 2018 16:30:05 +0100 Subject: [PATCH] standby: rename suspend script to standby The suspend script has conflicts with the suspend from bash, then we decided to rename our custom suspend script to standby and create a symlink called suspend to maintain backward compatibility. https://jira.digi.com/browse/DEL-5622 Signed-off-by: Arturo Buzarra --- .../busybox/busybox-1.24.1/acpid.map | 2 +- .../ccimx6qpsbc/{suspend => standby} | 6 +++--- .../ccimx6sbc/{suspend => standby} | 6 +++--- .../busybox/busybox-1.24.1/ccimx6ul/acpid.map | 2 +- .../busybox-1.24.1/ccimx6ul/{suspend => standby} | 6 +++--- .../busybox/busybox-1.24.1/pswitch-standby | 4 ++++ .../busybox/busybox-1.24.1/pswitch-suspend | 4 ---- .../recipes-core/busybox/busybox_1.24.1.bbappend | 16 +++++++++------- 8 files changed, 24 insertions(+), 22 deletions(-) rename meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/{suspend => standby} (96%) rename meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/{suspend => standby} (96%) rename meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/{suspend => standby} (96%) create mode 100644 meta-digi-dey/recipes-core/busybox/busybox-1.24.1/pswitch-standby delete mode 100644 meta-digi-dey/recipes-core/busybox/busybox-1.24.1/pswitch-suspend diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/acpid.map b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/acpid.map index 2994fe36e..a7099c9d7 100644 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/acpid.map +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/acpid.map @@ -1,3 +1,3 @@ #s_type n_type(hex) s_code n_code value description -EV_KEY 0x01 KEY_SLEEP 142 1 pswitch-suspend +EV_KEY 0x01 KEY_SLEEP 142 1 pswitch-standby EV_KEY 0x01 KEY_POWER 116 0 pswitch-poweroff diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/standby similarity index 96% rename from meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/suspend rename to meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/standby index 9b5d6ca47..7ac3b94d5 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6qpsbc/standby @@ -1,9 +1,9 @@ #!/bin/sh #=============================================================================== # -# suspend +# standby # -# Copyright (C) 2017 by Digi International Inc. +# Copyright (C) 2017,2018 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -15,7 +15,7 @@ # #=============================================================================== -scriptname="$(basename ${0})" +scriptname="$(basename $(readlink -f ${0}))" syspower="/sys/power/state" lockfile="/var/lock/${scriptname}.lock" lockfd="9" diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/standby similarity index 96% rename from meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/suspend rename to meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/standby index 21a30a524..b3e3f22e7 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6sbc/standby @@ -1,9 +1,9 @@ #!/bin/sh #=============================================================================== # -# suspend +# standby # -# Copyright (C) 2009-2017 by Digi International Inc. +# Copyright (C) 2009-2018 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -15,7 +15,7 @@ # #=============================================================================== -scriptname="$(basename ${0})" +scriptname="$(basename $(readlink -f ${0}))" syspower="/sys/power/state" lockfile="/var/lock/${scriptname}.lock" lockfd="9" diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/acpid.map b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/acpid.map index 7755a2a33..f3940541e 100644 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/acpid.map +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/acpid.map @@ -1,3 +1,3 @@ #s_type n_type(hex) s_code n_code value description -EV_KEY 0x01 KEY_SLEEP 142 1 pswitch-suspend +EV_KEY 0x01 KEY_SLEEP 142 1 pswitch-standby EV_KEY 0x01 KEY_POWER 116 1 pswitch-poweroff diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/standby similarity index 96% rename from meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend rename to meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/standby index 969876e33..9efc21b44 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/standby @@ -1,9 +1,9 @@ #!/bin/sh #=============================================================================== # -# suspend +# standby # -# Copyright (C) 2016, 2017 by Digi International Inc. +# Copyright (C) 2016-2018 by Digi International Inc. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -15,7 +15,7 @@ # #=============================================================================== -scriptname="$(basename ${0})" +scriptname="$(basename $(readlink -f ${0}))" syspower="/sys/power/state" lockfile="/var/lock/${scriptname}.lock" lockfd="9" diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/pswitch-standby b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/pswitch-standby new file mode 100644 index 000000000..005e93210 --- /dev/null +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/pswitch-standby @@ -0,0 +1,4 @@ +#!/bin/sh + +logger -t acpid "Power key standby request." +exec /bin/standby diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/pswitch-suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/pswitch-suspend deleted file mode 100644 index f061ce276..000000000 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/pswitch-suspend +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -logger -t acpid "Power key suspend request." -exec /bin/suspend diff --git a/meta-digi-dey/recipes-core/busybox/busybox_1.24.1.bbappend b/meta-digi-dey/recipes-core/busybox/busybox_1.24.1.bbappend index 56d5012b2..d3d7d9a6b 100644 --- a/meta-digi-dey/recipes-core/busybox/busybox_1.24.1.bbappend +++ b/meta-digi-dey/recipes-core/busybox/busybox_1.24.1.bbappend @@ -1,16 +1,16 @@ -# Copyright (C) 2013 Digi International. +# Copyright (C) 2013-2018 Digi International. FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" SRC_URI += "file://0001-del-baudrates.patch \ file://0002-ntpd-indefinitely-try-to-resolve-peer-addresses.patch \ - file://suspend \ + file://standby \ file://busybox-ntpd \ file://index.html \ file://digi-logo.png \ file://busybox-acpid \ file://acpid.map \ - file://pswitch-suspend \ + file://pswitch-standby \ file://pswitch-poweroff \ file://busybox-static-nodes \ file://bridgeifupdown \ @@ -29,7 +29,7 @@ INITSCRIPT_NAME_${PN}-ntpd = "busybox-ntpd" PACKAGES =+ "${PN}-acpid" FILES_${PN}-acpid = " ${sysconfdir}/init.d/busybox-acpid \ ${sysconfdir}/acpi/acpid.map \ - ${sysconfdir}/acpi/pswitch-suspend \ + ${sysconfdir}/acpi/pswitch-standby \ ${sysconfdir}/acpi/pswitch-poweroff \ " INITSCRIPT_PACKAGES =+ "${PN}-acpid" @@ -53,13 +53,15 @@ do_install_append() { install -m 0644 ${WORKDIR}/index.html ${D}/srv/www/ install -m 0644 ${WORKDIR}/digi-logo.png ${D}/srv/www/ fi - # Install 'suspend' script - install -m 0755 ${WORKDIR}/suspend ${D}${base_bindir} + # Install 'standby' script + install -m 0755 ${WORKDIR}/standby ${D}${base_bindir} + # Create a symlink called suspend to maintain backward compatibility + ln -s standby ${D}${base_bindir}/suspend if grep "CONFIG_ACPID=y" ${WORKDIR}/defconfig; then install -m 0755 ${WORKDIR}/busybox-acpid ${D}${sysconfdir}/init.d/ install -d ${D}${sysconfdir}/acpi/ install -m 0755 ${WORKDIR}/acpid.map ${D}${sysconfdir}/acpi/ - install -m 0755 ${WORKDIR}/pswitch-suspend ${D}${sysconfdir}/acpi/ + install -m 0755 ${WORKDIR}/pswitch-standby ${D}${sysconfdir}/acpi/ install -m 0755 ${WORKDIR}/pswitch-poweroff ${D}${sysconfdir}/acpi/ fi if grep "CONFIG_MAKEDEVS=y" ${WORKDIR}/defconfig; then