Move all to deprecated folder.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
Partially roll back upstream commit 4711119089e1ad08dad206f4fded68f1972fdeed
|
||||
since released versions of uClibc don't support isfdtype().
|
||||
|
||||
Signed-off-by: Gustavo Zaarias <gustavo@zacarias.com.ar>
|
||||
|
||||
diff -Nura acpid-2.0.22.orig/sock.c acpid-2.0.22/sock.c
|
||||
--- acpid-2.0.22.orig/sock.c 2014-04-22 18:04:19.706841764 -0300
|
||||
+++ acpid-2.0.22/sock.c 2014-04-22 18:05:08.285479625 -0300
|
||||
@@ -53,7 +53,10 @@
|
||||
int
|
||||
is_socket(int fd)
|
||||
{
|
||||
- return (isfdtype(fd, S_IFSOCK) == 1);
|
||||
+ int v;
|
||||
+ socklen_t l = sizeof(int);
|
||||
+
|
||||
+ return (getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&v, &l) == 0);
|
||||
}
|
||||
|
||||
/* accept a new client connection */
|
||||
@@ -0,0 +1,40 @@
|
||||
Add missing MSG_CMSG_CLOEXEC
|
||||
|
||||
Unpatched uClibc toolchains, even using the latest 0.9.33.2, do not
|
||||
have the MSG_CMSG_CLOEXEC definition. Even though the Buildroot
|
||||
internal toolchain backend has a uClibc patch to provide it, it
|
||||
doesn't apply to external toolchains. This patch provides the
|
||||
definition of MSG_CMSG_CLOEXEC.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
|
||||
Index: b/libnetlink.h
|
||||
===================================================================
|
||||
--- a/libnetlink.h
|
||||
+++ b/libnetlink.h
|
||||
@@ -7,6 +7,10 @@
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
|
||||
+#ifndef MSG_CMSG_CLOEXEC
|
||||
+#define MSG_CMSG_CLOEXEC 0x40000000
|
||||
+#endif
|
||||
+
|
||||
struct rtnl_handle
|
||||
{
|
||||
int fd;
|
||||
Index: b/kacpimon/libnetlink.h
|
||||
===================================================================
|
||||
--- a/kacpimon/libnetlink.h
|
||||
+++ b/kacpimon/libnetlink.h
|
||||
@@ -7,6 +7,10 @@
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
|
||||
+#ifndef MSG_CMSG_CLOEXEC
|
||||
+#define MSG_CMSG_CLOEXEC 0x40000000
|
||||
+#endif
|
||||
+
|
||||
struct rtnl_handle
|
||||
{
|
||||
int fd;
|
||||
@@ -0,0 +1,184 @@
|
||||
From a3dac1c3cee169e52c7d644dd565235a1cd833e3 Mon Sep 17 00:00:00 2001
|
||||
From: Brendan Heading <brendanheading@gmail.com>
|
||||
Date: Wed, 22 Jul 2015 23:10:11 +0100
|
||||
Subject: [PATCH] support for non-glibc libcs
|
||||
|
||||
Added a TEMP_FAILURE_RETRY macro. This is a glibcism provided by
|
||||
glibc and uclibc, but missing from musl (& possibly other libcs).
|
||||
|
||||
Upstream-status: submitted (see https://sourceforge.net/p/acpid2/tickets/7/)
|
||||
---
|
||||
acpi_listen.c | 2 ++
|
||||
acpid.c | 1 +
|
||||
event.c | 2 ++
|
||||
input_layer.c | 1 +
|
||||
kacpimon/libnetlink.h | 2 ++
|
||||
libc_compat.h | 40 ++++++++++++++++++++++++++++++++++++++++
|
||||
libnetlink.c | 2 ++
|
||||
netlink.c | 1 +
|
||||
proc.c | 1 +
|
||||
ud_socket.c | 1 +
|
||||
10 files changed, 53 insertions(+)
|
||||
create mode 100644 libc_compat.h
|
||||
|
||||
diff --git a/acpi_listen.c b/acpi_listen.c
|
||||
index d0bc175..839e4f9 100644
|
||||
--- a/acpi_listen.c
|
||||
+++ b/acpi_listen.c
|
||||
@@ -39,6 +39,8 @@
|
||||
#include "acpid.h"
|
||||
#include "ud_socket.h"
|
||||
|
||||
+#include "libc_compat.h"
|
||||
+
|
||||
static int handle_cmdline(int *argc, char ***argv);
|
||||
static char *read_line(int fd);
|
||||
|
||||
diff --git a/acpid.c b/acpid.c
|
||||
index 23f1e58..8555c82 100644
|
||||
--- a/acpid.c
|
||||
+++ b/acpid.c
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "input_layer.h"
|
||||
#include "inotify_handler.h"
|
||||
#include "netlink.h"
|
||||
+#include "libc_compat.h"
|
||||
|
||||
static int handle_cmdline(int *argc, char ***argv);
|
||||
static void close_fds(void);
|
||||
diff --git a/event.c b/event.c
|
||||
index 324078f..3b069a2 100644
|
||||
--- a/event.c
|
||||
+++ b/event.c
|
||||
@@ -39,6 +39,8 @@
|
||||
#include "log.h"
|
||||
#include "sock.h"
|
||||
#include "ud_socket.h"
|
||||
+#include "libc_compat.h"
|
||||
+
|
||||
#include "event.h"
|
||||
/*
|
||||
* What is a rule? It's polymorphic, pretty much.
|
||||
diff --git a/input_layer.c b/input_layer.c
|
||||
index 9aa19c6..cbf8085 100644
|
||||
--- a/input_layer.c
|
||||
+++ b/input_layer.c
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "log.h"
|
||||
#include "connection_list.h"
|
||||
#include "event.h"
|
||||
+#include "libc_compat.h"
|
||||
|
||||
#include "input_layer.h"
|
||||
|
||||
diff --git a/kacpimon/libnetlink.h b/kacpimon/libnetlink.h
|
||||
index 6185cbc..0c61896 100644
|
||||
--- a/kacpimon/libnetlink.h
|
||||
+++ b/kacpimon/libnetlink.h
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <linux/netlink.h>
|
||||
#include <linux/rtnetlink.h>
|
||||
|
||||
+#include "libc_compat.h"
|
||||
+
|
||||
struct rtnl_handle
|
||||
{
|
||||
int fd;
|
||||
diff --git a/libc_compat.h b/libc_compat.h
|
||||
new file mode 100644
|
||||
index 0000000..39f2336
|
||||
--- /dev/null
|
||||
+++ b/libc_compat.h
|
||||
@@ -0,0 +1,40 @@
|
||||
+/*
|
||||
+ * libc_compat.h - implement defs/macros missing from some libcs
|
||||
+ *
|
||||
+ * Copyright (C) 1999-2000 Andrew Henroid
|
||||
+ * Copyright (C) 2001 Sun Microsystems
|
||||
+ * Portions Copyright (C) 2004 Tim Hockin (thockin@hockin.org)
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+ */
|
||||
+
|
||||
+#ifndef LIBC_COMPAT_H__
|
||||
+#define LIBC_COMPAT_H__
|
||||
+
|
||||
+/* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno'
|
||||
+ set to EINTR. This macro is present on glibc/uclibc but may not be in other cases. */
|
||||
+
|
||||
+#ifndef ____GLIBC__
|
||||
+#ifndef TEMP_FAILURE_RETRY
|
||||
+#define TEMP_FAILURE_RETRY(expression) \
|
||||
+ (__extension__ \
|
||||
+ ({ long int __result; \
|
||||
+ do __result = (long int) (expression); \
|
||||
+ while (__result == -1L && errno == EINTR); \
|
||||
+ __result; }))
|
||||
+#endif
|
||||
+#endif /* __GLIBC__ */
|
||||
+
|
||||
+#endif /* LIBC_COMPAT_H__ */
|
||||
diff --git a/libnetlink.c b/libnetlink.c
|
||||
index e61d417..cc7aedc 100644
|
||||
--- a/libnetlink.c
|
||||
+++ b/libnetlink.c
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <time.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
+#include "libc_compat.h"
|
||||
+
|
||||
#include "libnetlink.h"
|
||||
|
||||
void rtnl_close(struct rtnl_handle *rth)
|
||||
diff --git a/netlink.c b/netlink.c
|
||||
index c64e878..27e3536 100644
|
||||
--- a/netlink.c
|
||||
+++ b/netlink.c
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "libnetlink.h"
|
||||
#include "genetlink.h"
|
||||
#include "acpi_genetlink.h"
|
||||
+#include "libc_compat.h"
|
||||
|
||||
#include "acpi_ids.h"
|
||||
#include "connection_list.h"
|
||||
diff --git a/proc.c b/proc.c
|
||||
index 5bb8fa2..f96b913 100644
|
||||
--- a/proc.c
|
||||
+++ b/proc.c
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "log.h"
|
||||
#include "event.h"
|
||||
#include "connection_list.h"
|
||||
+#include "libc_compat.h"
|
||||
|
||||
#include "proc.h"
|
||||
|
||||
diff --git a/ud_socket.c b/ud_socket.c
|
||||
index 2790686..1790917 100644
|
||||
--- a/ud_socket.c
|
||||
+++ b/ud_socket.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "acpid.h"
|
||||
#include "log.h"
|
||||
#include "ud_socket.h"
|
||||
+#include "libc_compat.h"
|
||||
|
||||
int
|
||||
ud_create_socket(const char *name, mode_t socketmode)
|
||||
--
|
||||
2.4.3
|
||||
|
||||
10
deprecated/firmware/buildroot/package/acpid/Config.in
Normal file
10
deprecated/firmware/buildroot/package/acpid/Config.in
Normal file
@@ -0,0 +1,10 @@
|
||||
config BR2_PACKAGE_ACPID
|
||||
bool "acpid"
|
||||
depends on BR2_x86_64 || BR2_i386
|
||||
help
|
||||
Advanced Configuration and Power Interface event daemon.
|
||||
|
||||
Acpid is designed to notify user-space programs of ACPI events,
|
||||
and allows you to configure specific actions for specific events.
|
||||
|
||||
http://sourceforge.net/projects/acpid2/
|
||||
22
deprecated/firmware/buildroot/package/acpid/S02acpid
Executable file
22
deprecated/firmware/buildroot/package/acpid/S02acpid
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
printf "Starting acpid: "
|
||||
start-stop-daemon -S -q -m -b -p /var/run/acpid.pid --exec /usr/sbin/acpid -- -n
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
stop)
|
||||
printf "Stopping acpid: "
|
||||
start-stop-daemon -K -q -p /var/run/acpid.pid
|
||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||
;;
|
||||
restart)
|
||||
"$0" stop
|
||||
sleep 1
|
||||
"$0" start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
;;
|
||||
esac
|
||||
2
deprecated/firmware/buildroot/package/acpid/acpid.hash
Normal file
2
deprecated/firmware/buildroot/package/acpid/acpid.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
# Locally computed:
|
||||
sha256 3d11454f4283c8f771d8dbd5eb6b5f2bbd9d94d9f77d68bab89e35d98b67ab31 acpid-2.0.22.tar.xz
|
||||
26
deprecated/firmware/buildroot/package/acpid/acpid.mk
Normal file
26
deprecated/firmware/buildroot/package/acpid/acpid.mk
Normal file
@@ -0,0 +1,26 @@
|
||||
################################################################################
|
||||
#
|
||||
# acpid
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ACPID_VERSION = 2.0.22
|
||||
ACPID_SOURCE = acpid-$(ACPID_VERSION).tar.xz
|
||||
ACPID_SITE = http://downloads.sourceforge.net/project/acpid2
|
||||
ACPID_LICENSE = GPLv2+
|
||||
ACPID_LICENSE_FILES = COPYING
|
||||
|
||||
define ACPID_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -D -m 0755 package/acpid/S02acpid \
|
||||
$(TARGET_DIR)/etc/init.d/S02acpid
|
||||
endef
|
||||
|
||||
define ACPID_SET_EVENTS
|
||||
mkdir -p $(TARGET_DIR)/etc/acpi/events
|
||||
printf "event=button[ /]power\naction=/sbin/poweroff\n" \
|
||||
>$(TARGET_DIR)/etc/acpi/events/powerbtn
|
||||
endef
|
||||
|
||||
ACPID_POST_INSTALL_TARGET_HOOKS += ACPID_SET_EVENTS
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user