initial buildroot for linux 5.15
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,11 @@
|
||||
config BR2_PACKAGE_ACPID
|
||||
bool "acpid"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
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/
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON="acpid"
|
||||
EXEC="/usr/sbin/$DAEMON"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
ACPID_ARGS=""
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
start() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -S -q -p "$PIDFILE" -x "$EXEC" \
|
||||
-- -n $ACPID_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon -K -q -p "$PIDFILE" -x "$EXEC"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
# Give acpid time to send dying gasp to syslog
|
||||
sleep 1
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
"$1";;
|
||||
reload)
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
@@ -0,0 +1,7 @@
|
||||
# From https://sourceforge.net/projects/acpid2/files/
|
||||
md5 b2f2ca633b30ae893c47981fa4d3b258 acpid-2.0.33.tar.xz
|
||||
sha1 b3e06c3f2213db8ee1a9024cf372fb30e2fab637 acpid-2.0.33.tar.xz
|
||||
|
||||
# Locally computed
|
||||
sha256 0856f71b3eb34a1b663d0a8e6363dfcbc519e63d847330498898658e2972dbe8 acpid-2.0.33.tar.xz
|
||||
sha256 91df39d1816bfb17a4dda2d3d2c83b1f6f2d38d53e53e41e8f97ad5ac46a0cad COPYING
|
||||
@@ -0,0 +1,40 @@
|
||||
################################################################################
|
||||
#
|
||||
# acpid
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ACPID_VERSION = 2.0.33
|
||||
ACPID_SOURCE = acpid-$(ACPID_VERSION).tar.xz
|
||||
ACPID_SITE = http://downloads.sourceforge.net/project/acpid2
|
||||
ACPID_LICENSE = GPL-2.0+
|
||||
ACPID_LICENSE_FILES = COPYING
|
||||
ACPID_CPE_ID_VENDOR = tedfelix
|
||||
ACPID_CPE_ID_PRODUCT = acpid2
|
||||
ACPID_SELINUX_MODULES = acpi
|
||||
|
||||
define ACPID_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 0644 package/acpid/acpid.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/acpid.service
|
||||
endef
|
||||
|
||||
define ACPID_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -D -m 0755 package/acpid/S02acpid \
|
||||
$(TARGET_DIR)/etc/init.d/S02acpid
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_INIT_SYSV)$(BR2_INIT_SYSTEMD),y)
|
||||
ACPID_POWEROFF_CMD = /sbin/shutdown -hP now
|
||||
else
|
||||
ACPID_POWEROFF_CMD = /sbin/poweroff
|
||||
endif
|
||||
|
||||
define ACPID_SET_EVENTS
|
||||
mkdir -p $(TARGET_DIR)/etc/acpi/events
|
||||
printf 'event=button[ /]power\naction=%s\n' '$(ACPID_POWEROFF_CMD)' \
|
||||
>$(TARGET_DIR)/etc/acpi/events/powerbtn
|
||||
endef
|
||||
|
||||
ACPID_POST_INSTALL_TARGET_HOOKS += ACPID_SET_EVENTS
|
||||
|
||||
$(eval $(autotools-package))
|
||||
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=ACPI event daemon
|
||||
Documentation=man:acpid(8)
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/acpid --foreground --netlink
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user