summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/apmd
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/apmd')
-rw-r--r--meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd.service7
-rw-r--r--meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy91
-rw-r--r--meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy.conf16
-rw-r--r--meta/recipes-bsp/apmd/apmd-3.2.2-14/default8
-rwxr-xr-xmeta/recipes-bsp/apmd/apmd-3.2.2-14/init51
-rw-r--r--meta/recipes-bsp/apmd/apmd-3.2.2-14/libtool.patch33
-rw-r--r--meta/recipes-bsp/apmd/apmd-3.2.2-14/unlinux.patch25
-rw-r--r--meta/recipes-bsp/apmd/apmd_3.2.2-14.bb82
8 files changed, 313 insertions, 0 deletions
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
new file mode 100644
index 0000000000..ffab82334f
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd.service
@@ -0,0 +1,7 @@
1[Unit]
2Description=Advanced Power Management daemon
3After=remote-fs.target
4
5[Service]
6EnvironmentFile=-@SYSCONFDIR@/default/apmd
7ExecStart=@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
new file mode 100644
index 0000000000..c48ee4e5d5
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy
@@ -0,0 +1,91 @@
1#!/bin/sh
2#
3# apmd_proxy - program dispatcher for APM daemon
4#
5# Written by Craig Markwardt (craigm@lheamail.gsfc.nasa.gov) 21 May 1999
6# Modified for Debian by Avery Pennarun
7#
8# This shell script is called by the APM daemon (apmd) when a power
9# management event occurs. Its first and second arguments describe the
10# event. For example, apmd will call "apmd_proxy suspend system" just
11# before the system is suspended.
12#
13# Here are the possible arguments:
14#
15# start - APM daemon has started
16# stop - APM daemon is shutting down
17# suspend critical - APM system indicates critical suspend (++)
18# suspend system - APM system has requested suspend mode
19# suspend user - User has requested suspend mode
20# standby system - APM system has requested standby mode
21# standby user - User has requested standby mode
22# resume suspend - System has resumed from suspend mode
23# resume standby - System has resumed from standby mode
24# resume critical - System has resumed from critical suspend
25# change battery - APM system reported low battery
26# change power - APM system reported AC/battery change
27# change time - APM system reported time change (*)
28# change capability - APM system reported config. change (+)
29#
30# (*) - APM daemon may be configured to not call these sequences
31# (+) - Available if APM kernel supports it.
32# (++) - "suspend critical" is never passed to apmd from the kernel,
33# so we will never see it here. Scripts that process "resume
34# critical" events need to take this into account.
35#
36# It is the proxy script's responsibility to examine the APM status
37# (via /proc/apm) or other status and to take appropriate actions.
38# For example, the script might unmount network drives before the
39# machine is suspended.
40#
41# In Debian, the usual way of adding functionality to the proxy is to
42# add a script to /etc/apm/event.d. This script will be called by
43# apmd_proxy (via run-parts) with the same arguments.
44#
45# If it is important that a certain set of script be run in a certain
46# order on suspend and in a different order on resume, then put all
47# the scripts in /etc/apm/scripts.d instead of /etc/apm/event.d and
48# symlink to these from /etc/apm/suspend.d, /etc/apm/resume.d and
49# /etc/apm/other.d using names whose lexicographical order is the same
50# as the desired order of execution.
51#
52# If the kernel's APM driver supports it, apmd_proxy can return a non-zero
53# exit status on suspend and standby events, indicating that the suspend
54# or standby event should be rejected.
55#
56# *******************************************************************
57
58set -e
59
60# The following doesn't yet work, because current kernels (up to at least
61# 2.4.20) do not support rejection of APM events. Supporting this would
62# require substantial modifications to the APM driver. We will re-enable
63# this feature if the driver is ever modified. -- cph@debian.org
64#
65#SUSPEND_ON_AC=false
66#[ -r /etc/apm/apmd_proxy.conf ] && . /etc/apm/apmd_proxy.conf
67#
68#if [ "${SUSPEND_ON_AC}" = "false" -a "${2}" = "system" ] \
69# && on_ac_power >/dev/null; then
70# # Reject system suspends and standbys if we are on AC power
71# exit 1 # Reject (NOTE kernel support must be enabled)
72#fi
73
74if [ "${1}" = "suspend" -o "${1}" = "standby" ]; then
75 run-parts -a "${1}" -a "${2}" /etc/apm/event.d
76 if [ -d /etc/apm/suspend.d ]; then
77 run-parts -a "${1}" -a "${2}" /etc/apm/suspend.d
78 fi
79elif [ "${1}" = "resume" ]; then
80 if [ -d /etc/apm/resume.d ]; then
81 run-parts -a "${1}" -a "${2}" /etc/apm/resume.d
82 fi
83 run-parts -a "${1}" -a "${2}" /etc/apm/event.d
84else
85 run-parts -a "${1}" -a "${2}" /etc/apm/event.d
86 if [ -d /etc/apm/other.d ]; then
87 run-parts -a "${1}" -a "${2}" /etc/apm/other.d
88 fi
89fi
90
91exit 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
new file mode 100644
index 0000000000..751145c522
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd-3.2.2-14/apmd_proxy.conf
@@ -0,0 +1,16 @@
1# /etc/apm/apmd_proxy.conf: configuration file for apmd.
2#
3# This file is managed by debconf when installing or reconfiguring the
4# package. It is generated by merging the answers gathered by debconf
5# into the template file "/usr/share/apmd/apmd_proxy.conf".
6
7# The following doesn't yet work, because current kernels (up to at least
8# 2.4.20) do not support rejection of APM events. Supporting this would
9# require substantial modifications to the APM driver. We will re-enable
10# this feature if the driver is ever modified. -- cph@debian.org
11#
12# Set the following to "false" if you want to reject system suspend or
13# system standby requests when the computer is running on AC power.
14# Otherwise set this to "true". Such requests are never rejected when
15# the computer is running on battery power.
16#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
new file mode 100644
index 0000000000..4b7965abf8
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd-3.2.2-14/default
@@ -0,0 +1,8 @@
1#
2# Default for /etc/init.d/apmd
3#
4
5# As apmd can be called with arguments, we use the following variable
6# to store them, e.g., APMD="-w 5 -p 2".
7# See the manual page apmd(8) for details.
8APMD="--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
new file mode 100755
index 0000000000..c0b41aa9d1
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd-3.2.2-14/init
@@ -0,0 +1,51 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: apmd
4# Required-Start: $remote_fs
5# Required-Stop: $remote_fs
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Advanced Power Management daemon
9### END INIT INFO
10
11# Source function library.
12. /etc/init.d/functions
13
14PATH=/bin:/usr/bin:/sbin:/usr/sbin
15
16[ -f /etc/default/rcS ] && . /etc/default/rcS
17[ -f /etc/default/apmd ] && . /etc/default/apmd
18
19case "$1" in
20 start)
21 echo -n "Starting advanced power management daemon: "
22 start-stop-daemon -S -x /usr/sbin/apmd -- \
23 -P /etc/apm/apmd_proxy $APMD
24 if [ $? = 0 ]; then
25 echo "apmd."
26 else
27 echo "(failed.)"
28 fi
29 ;;
30 stop)
31 echo -n "Stopping advanced power management daemon: "
32 start-stop-daemon -K \
33 -x /usr/sbin/apmd
34 echo "apmd."
35 ;;
36 status)
37 status /usr/sbin/apmd;
38 exit $?
39 ;;
40 restart|force-reload)
41 $0 stop
42 $0 start
43 exit
44 ;;
45 *)
46 echo "Usage: /etc/init.d/apmd {start|stop|status|restart|force-reload}"
47 exit 1
48 ;;
49esac
50
51exit 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
new file mode 100644
index 0000000000..834ee080a1
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd-3.2.2-14/libtool.patch
@@ -0,0 +1,33 @@
1Add by RP to address "unable to infer tagged configuration" error:
2 commit 35de05e61b88c0808a5e885bb0efdf420555d5ad
3 Author: Richard Purdie <rpurdie@rpsys.net>
4 Date: Sun Jun 1 16:13:38 2008 +0000
5
6 apmd: Use libtool --tag options to avoid problems with libtool 2.2.4 (from poky)
7
8However I didn't see same issue with current libtool-2.2.10. Also per my understanding,
9the default tag, if not specified, falls back to CC. So disable it from patching, but
10keep it here. If we encounter similar issue in the future, we could then push upstream
11
12Comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-16
13
14Upstream-Status: Pending
15
16Signed-off-by: Scott Garman <scott.a.garman@intel.com>
17
18Index: apmd-3.2.2.orig/Makefile
19===================================================================
20--- apmd-3.2.2.orig.orig/Makefile 2004-01-04 08:13:18.000000000 +0000
21+++ apmd-3.2.2.orig/Makefile 2008-04-21 17:10:03.000000000 +0100
22@@ -58,9 +57,8 @@
23 #CFLAGS=-O3 -m486 -fomit-frame-pointer
24 #LDFLAGS=-s
25
26-LIBTOOL=libtool --quiet
27-LT_COMPILE = $(LIBTOOL) --mode=compile $(CC)
28-LT_LINK = $(LIBTOOL) --mode=link $(CC)
29+LT_COMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC)
30+LT_LINK = $(LIBTOOL) --tag=CC --mode=link $(CC)
31 LT_INSTALL = $(LIBTOOL) --mode=install install
32 LT_CLEAN = $(LIBTOOL) --mode=clean rm
33
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
new file mode 100644
index 0000000000..ec8206cf17
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd-3.2.2-14/unlinux.patch
@@ -0,0 +1,25 @@
1copy OE commit message here:
2 commit 9456cdc1cf43e3ba9e6d88c63560c1b6fdee4359
3 Author: Michael Krelin <hacker@klever.net>
4 Date: Tue May 29 12:27:45 2007 +0000
5
6 apmd: prevent build from interferring with host kernel headers. Closes #1257
7
8comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-13
9
10Upstream-Status: Pending
11
12Signed-off-by: Scott Garman <scott.a.garman@intel.com>
13
14--- apmd-3.2.2.orig/Makefile
15+++ apmd-3.2.2/Makefile
16@@ -43,8 +43,7 @@
17
18 CC=gcc
19 CFLAGS=-O -g
20-XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \
21- -I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \
22+XTRACFLAGS=-Wall -pipe -I. \
23 -DVERSION=\"$(VERSION)\" \
24 -DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\"
25 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
new file mode 100644
index 0000000000..8c4b75eb6d
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd_3.2.2-14.bb
@@ -0,0 +1,82 @@
1SUMMARY = "Utilities for Advanced Power Management"
2DESCRIPTION = "The Advanced Power Management (APM) support provides \
3access to battery status information and a set of tools for managing \
4notebook power consumption."
5HOMEPAGE = "http://apenwarr.ca/apmd/"
6SECTION = "base"
7LICENSE = "GPLv2+"
8LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
9 file://apm.h;beginline=6;endline=18;md5=7d4acc1250910a89f84ce3cc6557c4c2"
10DEPENDS = "libtool-cross"
11PR = "r2"
12
13SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_3.2.2.orig.tar.gz;name=tarball \
14 ${DEBIAN_MIRROR}/main/a/apmd/apmd_${PV}.diff.gz;name=patch \
15 file://libtool.patch \
16 file://unlinux.patch \
17 file://init \
18 file://default \
19 file://apmd_proxy \
20 file://apmd_proxy.conf \
21 file://apmd.service"
22
23SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8"
24SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d"
25
26SRC_URI[patch.md5sum] = "57e1b689264ea80f78353519eece0c92"
27SRC_URI[patch.sha256sum] = "7905ff96be93d725544d0040e425c42f9c05580db3c272f11cff75b9aa89d430"
28
29S = "${WORKDIR}/apmd-3.2.2.orig"
30
31inherit update-rc.d systemd
32
33INITSCRIPT_NAME = "apmd"
34INITSCRIPT_PARAMS = "defaults"
35
36SYSTEMD_SERVICE_${PN} = "apmd.service"
37SYSTEMD_AUTO_ENABLE = "disable"
38
39do_compile() {
40 # apmd doesn't use whole autotools. Just libtool for installation
41 oe_runmake "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool" apm apmd
42}
43
44do_install() {
45 install -d ${D}${sysconfdir}
46 install -d ${D}${sysconfdir}/apm
47 install -d ${D}${sysconfdir}/apm/event.d
48 install -d ${D}${sysconfdir}/apm/other.d
49 install -d ${D}${sysconfdir}/apm/suspend.d
50 install -d ${D}${sysconfdir}/apm/resume.d
51 install -d ${D}${sysconfdir}/apm/scripts.d
52 install -d ${D}${sysconfdir}/default
53 install -d ${D}${sysconfdir}/init.d
54 install -d ${D}${sbindir}
55 install -d ${D}${bindir}
56 install -d ${D}${libdir}
57 install -d ${D}${datadir}/apmd
58 install -d ${D}${includedir}
59
60 install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm
61 install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd
62 install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/
63 install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/
64 install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd
65 oe_libinstall -so libapm ${D}${libdir}
66 install -m 0644 apm.h ${D}${includedir}
67
68 cat ${WORKDIR}/init | sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' > ${D}${sysconfdir}/init.d/apmd
69 chmod 755 ${D}${sysconfdir}/init.d/apmd
70
71 install -d ${D}${systemd_unitdir}/system
72 install -m 0644 ${WORKDIR}/apmd.service ${D}${systemd_unitdir}/system/
73 sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
74 -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apmd.service
75}
76
77PACKAGES =+ "libapm libapm-dev libapm-staticdev apm"
78
79FILES_libapm = "${libdir}/libapm${SOLIBS}"
80FILES_libapm-dev = "${libdir}/libapm${SOLIBSDEV} ${includedir} ${libdir}/libapm.la"
81FILES_libapm-staticdev = "${libdir}/libapm.a"
82FILES_apm = "${bindir}/apm*"