From 00b7ea65463af32d610ebdff6fcdd2d7a0877666 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Tue, 11 Aug 2015 18:27:16 +0300 Subject: apmd: update to 3.2.2-15 This basically means replacing a "-14" Debian patch with "-15" patch. (From OE-Core rev: cc636032617964818211ccb47a9fb6d6163af8c0) Signed-off-by: Alexander Kanavin Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd.service | 7 -- meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy | 91 -------------- .../recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy.conf | 16 --- meta/recipes-bsp/apmd/apmd-3.2.2-14/default | 8 -- meta/recipes-bsp/apmd/apmd-3.2.2-14/init | 51 -------- meta/recipes-bsp/apmd/apmd-3.2.2-14/libtool.patch | 33 ----- meta/recipes-bsp/apmd/apmd-3.2.2-14/unlinux.patch | 25 ---- meta/recipes-bsp/apmd/apmd/apmd.service | 7 ++ meta/recipes-bsp/apmd/apmd/apmd_proxy | 91 ++++++++++++++ meta/recipes-bsp/apmd/apmd/apmd_proxy.conf | 16 +++ meta/recipes-bsp/apmd/apmd/default | 8 ++ meta/recipes-bsp/apmd/apmd/init | 51 ++++++++ meta/recipes-bsp/apmd/apmd/legacy.patch | 133 +++++++++++++++++++++ meta/recipes-bsp/apmd/apmd/libtool.patch | 33 +++++ meta/recipes-bsp/apmd/apmd/unlinux.patch | 25 ++++ meta/recipes-bsp/apmd/apmd_3.2.2-14.bb | 80 ------------- meta/recipes-bsp/apmd/apmd_3.2.2-15.bb | 76 ++++++++++++ 17 files changed, 440 insertions(+), 311 deletions(-) delete mode 100644 meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd.service delete mode 100644 meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy delete mode 100644 meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy.conf delete mode 100644 meta/recipes-bsp/apmd/apmd-3.2.2-14/default delete mode 100755 meta/recipes-bsp/apmd/apmd-3.2.2-14/init delete mode 100644 meta/recipes-bsp/apmd/apmd-3.2.2-14/libtool.patch delete mode 100644 meta/recipes-bsp/apmd/apmd-3.2.2-14/unlinux.patch create mode 100644 meta/recipes-bsp/apmd/apmd/apmd.service create mode 100644 meta/recipes-bsp/apmd/apmd/apmd_proxy create mode 100644 meta/recipes-bsp/apmd/apmd/apmd_proxy.conf create mode 100644 meta/recipes-bsp/apmd/apmd/default create mode 100755 meta/recipes-bsp/apmd/apmd/init create mode 100644 meta/recipes-bsp/apmd/apmd/legacy.patch create mode 100644 meta/recipes-bsp/apmd/apmd/libtool.patch create mode 100644 meta/recipes-bsp/apmd/apmd/unlinux.patch delete mode 100644 meta/recipes-bsp/apmd/apmd_3.2.2-14.bb create mode 100644 meta/recipes-bsp/apmd/apmd_3.2.2-15.bb (limited to 'meta/recipes-bsp') diff --git a/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd.service b/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd.service deleted file mode 100644 index ffab82334f..0000000000 --- a/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Advanced Power Management daemon -After=remote-fs.target - -[Service] -EnvironmentFile=-@SYSCONFDIR@/default/apmd -ExecStart=@SBINDIR@/apmd -P @SYSCONFDIR@/apm/apmd_proxy $APMD diff --git a/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy b/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy deleted file mode 100644 index c48ee4e5d5..0000000000 --- a/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -# -# apmd_proxy - program dispatcher for APM daemon -# -# Written by Craig Markwardt (craigm@lheamail.gsfc.nasa.gov) 21 May 1999 -# Modified for Debian by Avery Pennarun -# -# This shell script is called by the APM daemon (apmd) when a power -# management event occurs. Its first and second arguments describe the -# event. For example, apmd will call "apmd_proxy suspend system" just -# before the system is suspended. -# -# Here are the possible arguments: -# -# start - APM daemon has started -# stop - APM daemon is shutting down -# suspend critical - APM system indicates critical suspend (++) -# suspend system - APM system has requested suspend mode -# suspend user - User has requested suspend mode -# standby system - APM system has requested standby mode -# standby user - User has requested standby mode -# resume suspend - System has resumed from suspend mode -# resume standby - System has resumed from standby mode -# resume critical - System has resumed from critical suspend -# change battery - APM system reported low battery -# change power - APM system reported AC/battery change -# change time - APM system reported time change (*) -# change capability - APM system reported config. change (+) -# -# (*) - APM daemon may be configured to not call these sequences -# (+) - Available if APM kernel supports it. -# (++) - "suspend critical" is never passed to apmd from the kernel, -# so we will never see it here. Scripts that process "resume -# critical" events need to take this into account. -# -# It is the proxy script's responsibility to examine the APM status -# (via /proc/apm) or other status and to take appropriate actions. -# For example, the script might unmount network drives before the -# machine is suspended. -# -# In Debian, the usual way of adding functionality to the proxy is to -# add a script to /etc/apm/event.d. This script will be called by -# apmd_proxy (via run-parts) with the same arguments. -# -# If it is important that a certain set of script be run in a certain -# order on suspend and in a different order on resume, then put all -# the scripts in /etc/apm/scripts.d instead of /etc/apm/event.d and -# symlink to these from /etc/apm/suspend.d, /etc/apm/resume.d and -# /etc/apm/other.d using names whose lexicographical order is the same -# as the desired order of execution. -# -# If the kernel's APM driver supports it, apmd_proxy can return a non-zero -# exit status on suspend and standby events, indicating that the suspend -# or standby event should be rejected. -# -# ******************************************************************* - -set -e - -# The following doesn't yet work, because current kernels (up to at least -# 2.4.20) do not support rejection of APM events. Supporting this would -# require substantial modifications to the APM driver. We will re-enable -# this feature if the driver is ever modified. -- cph@debian.org -# -#SUSPEND_ON_AC=false -#[ -r /etc/apm/apmd_proxy.conf ] && . /etc/apm/apmd_proxy.conf -# -#if [ "${SUSPEND_ON_AC}" = "false" -a "${2}" = "system" ] \ -# && on_ac_power >/dev/null; then -# # Reject system suspends and standbys if we are on AC power -# exit 1 # Reject (NOTE kernel support must be enabled) -#fi - -if [ "${1}" = "suspend" -o "${1}" = "standby" ]; then - run-parts -a "${1}" -a "${2}" /etc/apm/event.d - if [ -d /etc/apm/suspend.d ]; then - run-parts -a "${1}" -a "${2}" /etc/apm/suspend.d - fi -elif [ "${1}" = "resume" ]; then - if [ -d /etc/apm/resume.d ]; then - run-parts -a "${1}" -a "${2}" /etc/apm/resume.d - fi - run-parts -a "${1}" -a "${2}" /etc/apm/event.d -else - run-parts -a "${1}" -a "${2}" /etc/apm/event.d - if [ -d /etc/apm/other.d ]; then - run-parts -a "${1}" -a "${2}" /etc/apm/other.d - fi -fi - -exit 0 diff --git a/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy.conf b/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy.conf deleted file mode 100644 index 751145c522..0000000000 --- a/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy.conf +++ /dev/null @@ -1,16 +0,0 @@ -# /etc/apm/apmd_proxy.conf: configuration file for apmd. -# -# This file is managed by debconf when installing or reconfiguring the -# package. It is generated by merging the answers gathered by debconf -# into the template file "/usr/share/apmd/apmd_proxy.conf". - -# The following doesn't yet work, because current kernels (up to at least -# 2.4.20) do not support rejection of APM events. Supporting this would -# require substantial modifications to the APM driver. We will re-enable -# this feature if the driver is ever modified. -- cph@debian.org -# -# Set the following to "false" if you want to reject system suspend or -# system standby requests when the computer is running on AC power. -# Otherwise set this to "true". Such requests are never rejected when -# the computer is running on battery power. -#SUSPEND_ON_AC=true diff --git a/meta/recipes-bsp/apmd/apmd-3.2.2-14/default b/meta/recipes-bsp/apmd/apmd-3.2.2-14/default deleted file mode 100644 index 4b7965abf8..0000000000 --- a/meta/recipes-bsp/apmd/apmd-3.2.2-14/default +++ /dev/null @@ -1,8 +0,0 @@ -# -# Default for /etc/init.d/apmd -# - -# As apmd can be called with arguments, we use the following variable -# to store them, e.g., APMD="-w 5 -p 2". -# See the manual page apmd(8) for details. -APMD="--proxy-timeout 30" diff --git a/meta/recipes-bsp/apmd/apmd-3.2.2-14/init b/meta/recipes-bsp/apmd/apmd-3.2.2-14/init deleted file mode 100755 index c0b41aa9d1..0000000000 --- a/meta/recipes-bsp/apmd/apmd-3.2.2-14/init +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: apmd -# Required-Start: $remote_fs -# Required-Stop: $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Advanced Power Management daemon -### END INIT INFO - -# Source function library. -. /etc/init.d/functions - -PATH=/bin:/usr/bin:/sbin:/usr/sbin - -[ -f /etc/default/rcS ] && . /etc/default/rcS -[ -f /etc/default/apmd ] && . /etc/default/apmd - -case "$1" in - start) - echo -n "Starting advanced power management daemon: " - start-stop-daemon -S -x /usr/sbin/apmd -- \ - -P /etc/apm/apmd_proxy $APMD - if [ $? = 0 ]; then - echo "apmd." - else - echo "(failed.)" - fi - ;; - stop) - echo -n "Stopping advanced power management daemon: " - start-stop-daemon -K \ - -x /usr/sbin/apmd - echo "apmd." - ;; - status) - status /usr/sbin/apmd; - exit $? - ;; - restart|force-reload) - $0 stop - $0 start - exit - ;; - *) - echo "Usage: /etc/init.d/apmd {start|stop|status|restart|force-reload}" - exit 1 - ;; -esac - -exit 0 diff --git a/meta/recipes-bsp/apmd/apmd-3.2.2-14/libtool.patch b/meta/recipes-bsp/apmd/apmd-3.2.2-14/libtool.patch deleted file mode 100644 index 834ee080a1..0000000000 --- a/meta/recipes-bsp/apmd/apmd-3.2.2-14/libtool.patch +++ /dev/null @@ -1,33 +0,0 @@ -Add by RP to address "unable to infer tagged configuration" error: - commit 35de05e61b88c0808a5e885bb0efdf420555d5ad - Author: Richard Purdie - Date: Sun Jun 1 16:13:38 2008 +0000 - - apmd: Use libtool --tag options to avoid problems with libtool 2.2.4 (from poky) - -However I didn't see same issue with current libtool-2.2.10. Also per my understanding, -the default tag, if not specified, falls back to CC. So disable it from patching, but -keep it here. If we encounter similar issue in the future, we could then push upstream - -Comment added by Kevin Tian , 2010-07-16 - -Upstream-Status: Pending - -Signed-off-by: Scott Garman - -Index: apmd-3.2.2.orig/Makefile -=================================================================== ---- apmd-3.2.2.orig.orig/Makefile 2004-01-04 08:13:18.000000000 +0000 -+++ apmd-3.2.2.orig/Makefile 2008-04-21 17:10:03.000000000 +0100 -@@ -58,9 +57,8 @@ - #CFLAGS=-O3 -m486 -fomit-frame-pointer - #LDFLAGS=-s - --LIBTOOL=libtool --quiet --LT_COMPILE = $(LIBTOOL) --mode=compile $(CC) --LT_LINK = $(LIBTOOL) --mode=link $(CC) -+LT_COMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) -+LT_LINK = $(LIBTOOL) --tag=CC --mode=link $(CC) - LT_INSTALL = $(LIBTOOL) --mode=install install - LT_CLEAN = $(LIBTOOL) --mode=clean rm - diff --git a/meta/recipes-bsp/apmd/apmd-3.2.2-14/unlinux.patch b/meta/recipes-bsp/apmd/apmd-3.2.2-14/unlinux.patch deleted file mode 100644 index ec8206cf17..0000000000 --- a/meta/recipes-bsp/apmd/apmd-3.2.2-14/unlinux.patch +++ /dev/null @@ -1,25 +0,0 @@ -copy OE commit message here: - commit 9456cdc1cf43e3ba9e6d88c63560c1b6fdee4359 - Author: Michael Krelin - Date: Tue May 29 12:27:45 2007 +0000 - - apmd: prevent build from interferring with host kernel headers. Closes #1257 - -comment added by Kevin Tian , 2010-07-13 - -Upstream-Status: Pending - -Signed-off-by: Scott Garman - ---- apmd-3.2.2.orig/Makefile -+++ apmd-3.2.2/Makefile -@@ -43,8 +43,7 @@ - - CC=gcc - CFLAGS=-O -g --XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \ -- -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \ -+XTRACFLAGS=-Wall -pipe -I. \ - -DVERSION=\"$(VERSION)\" \ - -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\" - LDFLAGS= diff --git a/meta/recipes-bsp/apmd/apmd/apmd.service b/meta/recipes-bsp/apmd/apmd/apmd.service new file mode 100644 index 0000000000..ffab82334f --- /dev/null +++ b/meta/recipes-bsp/apmd/apmd/apmd.service @@ -0,0 +1,7 @@ +[Unit] +Description=Advanced Power Management daemon +After=remote-fs.target + +[Service] +EnvironmentFile=-@SYSCONFDIR@/default/apmd +ExecStart=@SBINDIR@/apmd -P @SYSCONFDIR@/apm/apmd_proxy $APMD diff --git a/meta/recipes-bsp/apmd/apmd/apmd_proxy b/meta/recipes-bsp/apmd/apmd/apmd_proxy new file mode 100644 index 0000000000..c48ee4e5d5 --- /dev/null +++ b/meta/recipes-bsp/apmd/apmd/apmd_proxy @@ -0,0 +1,91 @@ +#!/bin/sh +# +# apmd_proxy - program dispatcher for APM daemon +# +# Written by Craig Markwardt (craigm@lheamail.gsfc.nasa.gov) 21 May 1999 +# Modified for Debian by Avery Pennarun +# +# This shell script is called by the APM daemon (apmd) when a power +# management event occurs. Its first and second arguments describe the +# event. For example, apmd will call "apmd_proxy suspend system" just +# before the system is suspended. +# +# Here are the possible arguments: +# +# start - APM daemon has started +# stop - APM daemon is shutting down +# suspend critical - APM system indicates critical suspend (++) +# suspend system - APM system has requested suspend mode +# suspend user - User has requested suspend mode +# standby system - APM system has requested standby mode +# standby user - User has requested standby mode +# resume suspend - System has resumed from suspend mode +# resume standby - System has resumed from standby mode +# resume critical - System has resumed from critical suspend +# change battery - APM system reported low battery +# change power - APM system reported AC/battery change +# change time - APM system reported time change (*) +# change capability - APM system reported config. change (+) +# +# (*) - APM daemon may be configured to not call these sequences +# (+) - Available if APM kernel supports it. +# (++) - "suspend critical" is never passed to apmd from the kernel, +# so we will never see it here. Scripts that process "resume +# critical" events need to take this into account. +# +# It is the proxy script's responsibility to examine the APM status +# (via /proc/apm) or other status and to take appropriate actions. +# For example, the script might unmount network drives before the +# machine is suspended. +# +# In Debian, the usual way of adding functionality to the proxy is to +# add a script to /etc/apm/event.d. This script will be called by +# apmd_proxy (via run-parts) with the same arguments. +# +# If it is important that a certain set of script be run in a certain +# order on suspend and in a different order on resume, then put all +# the scripts in /etc/apm/scripts.d instead of /etc/apm/event.d and +# symlink to these from /etc/apm/suspend.d, /etc/apm/resume.d and +# /etc/apm/other.d using names whose lexicographical order is the same +# as the desired order of execution. +# +# If the kernel's APM driver supports it, apmd_proxy can return a non-zero +# exit status on suspend and standby events, indicating that the suspend +# or standby event should be rejected. +# +# ******************************************************************* + +set -e + +# The following doesn't yet work, because current kernels (up to at least +# 2.4.20) do not support rejection of APM events. Supporting this would +# require substantial modifications to the APM driver. We will re-enable +# this feature if the driver is ever modified. -- cph@debian.org +# +#SUSPEND_ON_AC=false +#[ -r /etc/apm/apmd_proxy.conf ] && . /etc/apm/apmd_proxy.conf +# +#if [ "${SUSPEND_ON_AC}" = "false" -a "${2}" = "system" ] \ +# && on_ac_power >/dev/null; then +# # Reject system suspends and standbys if we are on AC power +# exit 1 # Reject (NOTE kernel support must be enabled) +#fi + +if [ "${1}" = "suspend" -o "${1}" = "standby" ]; then + run-parts -a "${1}" -a "${2}" /etc/apm/event.d + if [ -d /etc/apm/suspend.d ]; then + run-parts -a "${1}" -a "${2}" /etc/apm/suspend.d + fi +elif [ "${1}" = "resume" ]; then + if [ -d /etc/apm/resume.d ]; then + run-parts -a "${1}" -a "${2}" /etc/apm/resume.d + fi + run-parts -a "${1}" -a "${2}" /etc/apm/event.d +else + run-parts -a "${1}" -a "${2}" /etc/apm/event.d + if [ -d /etc/apm/other.d ]; then + run-parts -a "${1}" -a "${2}" /etc/apm/other.d + fi +fi + +exit 0 diff --git a/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf b/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf new file mode 100644 index 0000000000..751145c522 --- /dev/null +++ b/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf @@ -0,0 +1,16 @@ +# /etc/apm/apmd_proxy.conf: configuration file for apmd. +# +# This file is managed by debconf when installing or reconfiguring the +# package. It is generated by merging the answers gathered by debconf +# into the template file "/usr/share/apmd/apmd_proxy.conf". + +# The following doesn't yet work, because current kernels (up to at least +# 2.4.20) do not support rejection of APM events. Supporting this would +# require substantial modifications to the APM driver. We will re-enable +# this feature if the driver is ever modified. -- cph@debian.org +# +# Set the following to "false" if you want to reject system suspend or +# system standby requests when the computer is running on AC power. +# Otherwise set this to "true". Such requests are never rejected when +# the computer is running on battery power. +#SUSPEND_ON_AC=true diff --git a/meta/recipes-bsp/apmd/apmd/default b/meta/recipes-bsp/apmd/apmd/default new file mode 100644 index 0000000000..4b7965abf8 --- /dev/null +++ b/meta/recipes-bsp/apmd/apmd/default @@ -0,0 +1,8 @@ +# +# Default for /etc/init.d/apmd +# + +# As apmd can be called with arguments, we use the following variable +# to store them, e.g., APMD="-w 5 -p 2". +# See the manual page apmd(8) for details. +APMD="--proxy-timeout 30" diff --git a/meta/recipes-bsp/apmd/apmd/init b/meta/recipes-bsp/apmd/apmd/init new file mode 100755 index 0000000000..c0b41aa9d1 --- /dev/null +++ b/meta/recipes-bsp/apmd/apmd/init @@ -0,0 +1,51 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: apmd +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Advanced Power Management daemon +### END INIT INFO + +# Source function library. +. /etc/init.d/functions + +PATH=/bin:/usr/bin:/sbin:/usr/sbin + +[ -f /etc/default/rcS ] && . /etc/default/rcS +[ -f /etc/default/apmd ] && . /etc/default/apmd + +case "$1" in + start) + echo -n "Starting advanced power management daemon: " + start-stop-daemon -S -x /usr/sbin/apmd -- \ + -P /etc/apm/apmd_proxy $APMD + if [ $? = 0 ]; then + echo "apmd." + else + echo "(failed.)" + fi + ;; + stop) + echo -n "Stopping advanced power management daemon: " + start-stop-daemon -K \ + -x /usr/sbin/apmd + echo "apmd." + ;; + status) + status /usr/sbin/apmd; + exit $? + ;; + restart|force-reload) + $0 stop + $0 start + exit + ;; + *) + echo "Usage: /etc/init.d/apmd {start|stop|status|restart|force-reload}" + exit 1 + ;; +esac + +exit 0 diff --git a/meta/recipes-bsp/apmd/apmd/legacy.patch b/meta/recipes-bsp/apmd/apmd/legacy.patch new file mode 100644 index 0000000000..5db895e8fe --- /dev/null +++ b/meta/recipes-bsp/apmd/apmd/legacy.patch @@ -0,0 +1,133 @@ +From 3595933d221f0ba836917debc0776b8723972ec9 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Tue, 11 Aug 2015 17:40:50 +0300 +Subject: [PATCH 1/3] Patch with fixes provided by Debian. + +This patch is taken from +ftp://ftp.debian.org/debian/pool/main/a/apmd/apmd_3.2.2-15.debian.tar.xz + +Upstream-Status: Inappropriate [upstream is dead] +Signed-off-by: Alexander Kanavin + +--- + Makefile | 2 +- + apm.c | 3 ++- + apm.h | 9 +++++++++ + apmd.c | 15 ++++++++------- + 4 files changed, 20 insertions(+), 9 deletions(-) + +diff --git a/Makefile b/Makefile +index bf346d9..92fc0fd 100644 +--- a/Makefile ++++ b/Makefile +@@ -43,7 +43,7 @@ DESTDIR= + + CC=gcc + CFLAGS=-O -g +-XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include \ ++XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \ + -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \ + -DVERSION=\"$(VERSION)\" \ + -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\" +diff --git a/apm.c b/apm.c +index b21c057..0359b1c 100644 +--- a/apm.c ++++ b/apm.c +@@ -219,12 +219,13 @@ int main(int argc, char **argv) + } + } + +- ++#if 0 + if (!(i.apm_flags & APM_32_BIT_SUPPORT)) + { + fprintf(stderr, "32-bit APM interface not supported\n"); + exit(1); + } ++#endif + + if (verbose && (i.apm_flags & 0x10)) + printf("APM BIOS Power Management is currently disabled\n"); +diff --git a/apm.h b/apm.h +index fb24dfd..824cc06 100644 +--- a/apm.h ++++ b/apm.h +@@ -20,6 +20,13 @@ + * $Id: apm.h,v 1.7 1999/07/05 22:31:11 apenwarr Exp $ + * + */ ++#ifndef _APM_H ++#define _APM_H 1 ++ ++#ifndef __KERNEL_STRICT_NAMES ++#define __KERNEL_STRICT_NAMES ++#endif ++ + #include + #include + +@@ -93,3 +100,5 @@ extern int apm_reject(int fd); + #else + #define apm_reject(fd) (-EINVAL) + #endif ++ ++#endif +diff --git a/apmd.c b/apmd.c +index 49ed3a1..560f536 100644 +--- a/apmd.c ++++ b/apmd.c +@@ -343,7 +343,7 @@ static int call_proxy(apm_event_t event) + /* parent */ + int status, retval; + ssize_t len; +- time_t time_limit; ++ time_t countdown; + + if (pid < 0) { + /* Couldn't fork */ +@@ -356,8 +356,9 @@ static int call_proxy(apm_event_t event) + /* Capture the child's output, if any, but only until it terminates */ + close(fds[1]); + fcntl(fds[0], F_SETFL, O_RDONLY|O_NONBLOCK); +- time_limit = time(0) + proxy_timeout; ++ countdown = proxy_timeout; + do { ++ countdown -= 1; + while ((len = read(fds[0], line, sizeof(line)-1)) > 0) { + line[len] = 0; + APMD_SYSLOG(LOG_INFO, "+ %s", line); +@@ -372,16 +373,16 @@ static int call_proxy(apm_event_t event) + goto proxy_done; + } + +- sleep(1); ++ while (sleep(1) > 0) ; + } while ( +- (time(0) < time_limit) ++ (countdown >= 0) + || (proxy_timeout < 0) + ); + + APMD_SYSLOG(LOG_NOTICE, "Proxy has been running more than %d seconds; killing it", proxy_timeout); + + kill(pid, SIGTERM); +- time_limit = time(0) + 5; ++ countdown = 5; + do { + retval = waitpid(pid, &status, WNOHANG); + if (retval == pid) +@@ -392,9 +393,9 @@ static int call_proxy(apm_event_t event) + goto proxy_done; + } + +- sleep(1); ++ while (sleep(1) > 0) ; + +- } while (time(0) < time_limit); ++ } while (countdown >= 0); + + kill(pid, SIGKILL); + status = __W_EXITCODE(0, SIGKILL); +-- +2.1.4 + diff --git a/meta/recipes-bsp/apmd/apmd/libtool.patch b/meta/recipes-bsp/apmd/apmd/libtool.patch new file mode 100644 index 0000000000..834ee080a1 --- /dev/null +++ b/meta/recipes-bsp/apmd/apmd/libtool.patch @@ -0,0 +1,33 @@ +Add by RP to address "unable to infer tagged configuration" error: + commit 35de05e61b88c0808a5e885bb0efdf420555d5ad + Author: Richard Purdie + Date: Sun Jun 1 16:13:38 2008 +0000 + + apmd: Use libtool --tag options to avoid problems with libtool 2.2.4 (from poky) + +However I didn't see same issue with current libtool-2.2.10. Also per my understanding, +the default tag, if not specified, falls back to CC. So disable it from patching, but +keep it here. If we encounter similar issue in the future, we could then push upstream + +Comment added by Kevin Tian , 2010-07-16 + +Upstream-Status: Pending + +Signed-off-by: Scott Garman + +Index: apmd-3.2.2.orig/Makefile +=================================================================== +--- apmd-3.2.2.orig.orig/Makefile 2004-01-04 08:13:18.000000000 +0000 ++++ apmd-3.2.2.orig/Makefile 2008-04-21 17:10:03.000000000 +0100 +@@ -58,9 +57,8 @@ + #CFLAGS=-O3 -m486 -fomit-frame-pointer + #LDFLAGS=-s + +-LIBTOOL=libtool --quiet +-LT_COMPILE = $(LIBTOOL) --mode=compile $(CC) +-LT_LINK = $(LIBTOOL) --mode=link $(CC) ++LT_COMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) ++LT_LINK = $(LIBTOOL) --tag=CC --mode=link $(CC) + LT_INSTALL = $(LIBTOOL) --mode=install install + LT_CLEAN = $(LIBTOOL) --mode=clean rm + diff --git a/meta/recipes-bsp/apmd/apmd/unlinux.patch b/meta/recipes-bsp/apmd/apmd/unlinux.patch new file mode 100644 index 0000000000..ec8206cf17 --- /dev/null +++ b/meta/recipes-bsp/apmd/apmd/unlinux.patch @@ -0,0 +1,25 @@ +copy OE commit message here: + commit 9456cdc1cf43e3ba9e6d88c63560c1b6fdee4359 + Author: Michael Krelin + Date: Tue May 29 12:27:45 2007 +0000 + + apmd: prevent build from interferring with host kernel headers. Closes #1257 + +comment added by Kevin Tian , 2010-07-13 + +Upstream-Status: Pending + +Signed-off-by: Scott Garman + +--- apmd-3.2.2.orig/Makefile ++++ apmd-3.2.2/Makefile +@@ -43,8 +43,7 @@ + + CC=gcc + CFLAGS=-O -g +-XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \ +- -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \ ++XTRACFLAGS=-Wall -pipe -I. \ + -DVERSION=\"$(VERSION)\" \ + -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\" + LDFLAGS= diff --git a/meta/recipes-bsp/apmd/apmd_3.2.2-14.bb b/meta/recipes-bsp/apmd/apmd_3.2.2-14.bb deleted file mode 100644 index 65dd01b229..0000000000 --- a/meta/recipes-bsp/apmd/apmd_3.2.2-14.bb +++ /dev/null @@ -1,80 +0,0 @@ -SUMMARY = "Utilities for Advanced Power Management" -DESCRIPTION = "The Advanced Power Management (APM) support provides \ -access to battery status information and a set of tools for managing \ -notebook power consumption." -HOMEPAGE = "http://apenwarr.ca/apmd/" -SECTION = "base" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ - file://apm.h;beginline=6;endline=18;md5=7d4acc1250910a89f84ce3cc6557c4c2" -DEPENDS = "libtool-cross" -PR = "r2" - -SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_3.2.2.orig.tar.gz;name=tarball \ - ${DEBIAN_MIRROR}/main/a/apmd/apmd_${PV}.diff.gz;name=patch \ - file://libtool.patch \ - file://unlinux.patch \ - file://init \ - file://default \ - file://apmd_proxy \ - file://apmd_proxy.conf \ - file://apmd.service" - -SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8" -SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d" - -SRC_URI[patch.md5sum] = "57e1b689264ea80f78353519eece0c92" -SRC_URI[patch.sha256sum] = "7905ff96be93d725544d0040e425c42f9c05580db3c272f11cff75b9aa89d430" - -S = "${WORKDIR}/apmd-3.2.2.orig" - -inherit update-rc.d systemd - -INITSCRIPT_NAME = "apmd" -INITSCRIPT_PARAMS = "defaults" - -SYSTEMD_SERVICE_${PN} = "apmd.service" -SYSTEMD_AUTO_ENABLE = "disable" - -do_compile() { - # apmd doesn't use whole autotools. Just libtool for installation - oe_runmake "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool" apm apmd -} - -do_install() { - install -d ${D}${sysconfdir} - install -d ${D}${sysconfdir}/apm - install -d ${D}${sysconfdir}/apm/event.d - install -d ${D}${sysconfdir}/apm/other.d - install -d ${D}${sysconfdir}/apm/suspend.d - install -d ${D}${sysconfdir}/apm/resume.d - install -d ${D}${sysconfdir}/apm/scripts.d - install -d ${D}${sysconfdir}/default - install -d ${D}${sysconfdir}/init.d - install -d ${D}${sbindir} - install -d ${D}${bindir} - install -d ${D}${libdir} - install -d ${D}${datadir}/apmd - install -d ${D}${includedir} - - install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm - install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd - install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/ - install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/ - install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd - oe_libinstall -so libapm ${D}${libdir} - install -m 0644 apm.h ${D}${includedir} - - sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/apmd - chmod 755 ${D}${sysconfdir}/init.d/apmd - - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/apmd.service ${D}${systemd_unitdir}/system/ - sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \ - -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apmd.service -} - -PACKAGES =+ "libapm apm" - -FILES_libapm = "${libdir}/libapm${SOLIBS}" -FILES_apm = "${bindir}/apm*" diff --git a/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb b/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb new file mode 100644 index 0000000000..ea105268a6 --- /dev/null +++ b/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb @@ -0,0 +1,76 @@ +SUMMARY = "Utilities for Advanced Power Management" +DESCRIPTION = "The Advanced Power Management (APM) support provides \ +access to battery status information and a set of tools for managing \ +notebook power consumption." +HOMEPAGE = "http://apenwarr.ca/apmd/" +SECTION = "base" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://apm.h;beginline=6;endline=18;md5=7d4acc1250910a89f84ce3cc6557c4c2" +DEPENDS = "libtool-cross" + +SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_3.2.2.orig.tar.gz;name=tarball \ + file://legacy.patch \ + file://libtool.patch \ + file://unlinux.patch \ + file://init \ + file://default \ + file://apmd_proxy \ + file://apmd_proxy.conf \ + file://apmd.service" + +SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8" +SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d" + +S = "${WORKDIR}/apmd-3.2.2.orig" + +inherit update-rc.d systemd + +INITSCRIPT_NAME = "apmd" +INITSCRIPT_PARAMS = "defaults" + +SYSTEMD_SERVICE_${PN} = "apmd.service" +SYSTEMD_AUTO_ENABLE = "disable" + +do_compile() { + # apmd doesn't use whole autotools. Just libtool for installation + oe_runmake "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool" apm apmd +} + +do_install() { + install -d ${D}${sysconfdir} + install -d ${D}${sysconfdir}/apm + install -d ${D}${sysconfdir}/apm/event.d + install -d ${D}${sysconfdir}/apm/other.d + install -d ${D}${sysconfdir}/apm/suspend.d + install -d ${D}${sysconfdir}/apm/resume.d + install -d ${D}${sysconfdir}/apm/scripts.d + install -d ${D}${sysconfdir}/default + install -d ${D}${sysconfdir}/init.d + install -d ${D}${sbindir} + install -d ${D}${bindir} + install -d ${D}${libdir} + install -d ${D}${datadir}/apmd + install -d ${D}${includedir} + + install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm + install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd + install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/ + install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/ + install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd + oe_libinstall -so libapm ${D}${libdir} + install -m 0644 apm.h ${D}${includedir} + + sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/apmd + chmod 755 ${D}${sysconfdir}/init.d/apmd + + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/apmd.service ${D}${systemd_unitdir}/system/ + sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apmd.service +} + +PACKAGES =+ "libapm apm" + +FILES_libapm = "${libdir}/libapm${SOLIBS}" +FILES_apm = "${bindir}/apm*" -- cgit v1.2.3-54-g00ecf