update buildroot to 2017.02.11

This commit is contained in:
jbnadal
2018-05-22 15:35:47 +02:00
parent 4bf1f5e091
commit a3c10bd762
9257 changed files with 433426 additions and 1701 deletions

View File

@@ -0,0 +1,21 @@
Preserve the cflags settings, because buildroot clobbers them.
--- a/Makefile 2010-10-05 00:06:38.000000000 -0700
+++ b/Makefile 2010-10-05 00:15:27.000000000 -0700
@@ -11,11 +11,14 @@ mandir ?= $(prefix)/usr/share/man
install_opts :=
-CFLAGS += -Wall -std=gnu99 -DNP_ETC_DIR='"$(etcdir)"' \
+NETPLUG_CFLAGS += -Wall -std=gnu99 -DNP_ETC_DIR='"$(etcdir)"' \
-DNP_SCRIPT_DIR='"$(scriptdir)"' -ggdb3 -O3 -DNP_VERSION='"$(version)"'
+%.o: %.c
+ $(CC) $(NETPLUG_CFLAGS) $(CFLAGS) -c -o $@ $<
+
netplugd: config.o netlink.o lib.o if_info.o main.o
- $(CC) $(LDFLAGS) -o $@ $^
+ $(CC) $(LDFLAGS) -o $@ $(NETPLUG_CFLAGS) $^
install:
install -d $(install_opts) -m 755 \

View File

@@ -0,0 +1,20 @@
Add missing <time.h> include
netplug.h uses time_t, so it must include <time.h>. This fixes a build
issue with the musl C library.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/netplug.h
===================================================================
--- a/netplug.h
+++ b/netplug.h
@@ -20,7 +20,7 @@
#ifndef __netplug_h
#define __netplug_h
-
+#include <time.h>
#include <asm/types.h>
#include <sys/socket.h>
#include <linux/netlink.h>

View File

@@ -0,0 +1,51 @@
Remove __assert_fail()
The netplug code uses the assert() macro in various places. In glibc
internally, assert() uses a function called __assert_fail() to print a
message and abort. Relying on internal glibc details, netplug
re-defines __assert_fail() in the hope that it will get called instead
of glibc internal version.
This attempt:
* Doesn't work with uClibc, which doesn't use any __assert_fail()
function at all. It doesn't fail to build, but it is entirely
useless.
* Fails to build with musl, which also defines __assert_fail(), but
with a different prototype.
We simply remove the __assert_fail() implementation, so that the C
library implementation of assert() just does its normal work. The only
functionality lost is that the message is displayed on the standard
output rather than in netplug's logs (and this was only working with
glibc anyway).
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/lib.c
===================================================================
--- a/lib.c
+++ b/lib.c
@@ -199,21 +199,6 @@
return x;
}
-
-void
-__assert_fail(const char *assertion, const char *file,
- unsigned int line, const char *function)
-{
- do_log(LOG_CRIT, "%s:%u: %s%sAssertion `%s' failed",
- file, line,
- function ? function : "",
- function ? ": " : "",
- assertion);
-
- abort();
-}
-
-
/*
* Local variables:
* c-file-style: "stroustrup"

View File

@@ -0,0 +1,8 @@
config BR2_PACKAGE_NETPLUG
bool "netplug"
depends on BR2_USE_MMU # fork()
help
A Linux daemon that manages network interfaces in
response to network cables being plugged in and out.
http://www.red-bean.com/~bos/

View File

@@ -0,0 +1,72 @@
#!/bin/sh
#
# netplugd This shell script takes care of starting and stopping
# the network plug management daemon.
#
# chkconfig: - 11 89
# description: netplugd is a daemon for managing non-static network \
# interfaces.
# processname: netplugd
# pidfile: /var/run/netplugd.pid
# Copyright 2003 Key Research, Inc.
# Create needed directories
mkdir -p /var/lock/subsys
# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
fi
# Source networking configuration.
if [ -f /etc/sysconfig/network ]; then
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
elif [ ! -f /etc/network/interfaces ]; then
# No network support
exit 0
fi
[ -x /sbin/netplugd ] || exit 0
if [ -f /etc/sysconfig/netplugd ]; then
. /etc/sysconfig/netplugd
fi
# See how we were called.
case "$1" in
start)
# Start daemon.
printf "Starting network plug daemon: "
start-stop-daemon -S -q -p /var/run/netplugd.pid -x /sbin/netplugd ${NETPLUGDARGS}
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/netplugd
;;
stop)
# Stop daemon.
printf "Shutting down network plug daemon: "
start-stop-daemon -K -n netplugd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netplugd
;;
restart|reload)
$0 stop
$0 start
;;
condrestart)
[ -f /var/lock/subsys/netplugd ] && $0 restart || :
;;
*)
echo "Usage: $0 {start|stop|restart}"
RETVAL=1
;;
esac
exit $RETVAL

View File

@@ -0,0 +1,57 @@
#!/bin/sh
#
# netplug - policy agent for netplugd
#
# Copyright 2003 Key Research, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2, as
# published by the Free Software Foundation. You are forbidden from
# redistributing or modifying it under the terms of any other license,
# including other versions of the GNU General Public License.
#
# 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.
PATH=/usr/bin:/bin:/usr/sbin:/sbin
export PATH
dev="$1"
action="$2"
case "$action" in
in)
if [ -x /sbin/ifup ]; then
exec /sbin/ifup $dev
else
echo "Please teach me how to plug in an interface!" 1>&2
exit 1
fi
;;
out)
if [ -x /sbin/ifdown ]; then
# At least on Fedora Core 1, the call to ip addr flush infloops
# /sbin/ifdown $dev && exec /sbin/ip addr flush $dev
exec /sbin/ifdown $dev
else
echo "Please teach me how to unplug an interface!" 1>&2
exit 1
fi
;;
probe)
# exec /sbin/ip link set $dev up >/dev/null 2>&1
if [ -x /sbin/ifconfig ]; then
exec /sbin/ifconfig $dev up >/dev/null 2>&1
else
echo "Failed to probe an interface!" 1>&2
exit 1
fi
;;
*)
echo "I have been called with a funny action of '%s'!" 1>&2
exit 1
;;
esac

View File

@@ -0,0 +1,2 @@
# Locally calculated
sha256 5180dfd9a7d3d0633a027b0a04f01b45a6a64623813cd48bd54423b90814864e netplug-1.2.9.2.tar.bz2

View File

@@ -0,0 +1,34 @@
################################################################################
#
# netplug
#
################################################################################
NETPLUG_VERSION = 1.2.9.2
NETPLUG_SOURCE = netplug-$(NETPLUG_VERSION).tar.bz2
NETPLUG_SITE = http://www.red-bean.com/~bos/netplug
NETPLUG_LICENSE = GPLv2
NETPLUG_LICENSE_FILES = COPYING
define NETPLUG_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
endef
define NETPLUG_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install
endef
define NETPLUG_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D package/netplug/S29netplug \
$(TARGET_DIR)/etc/init.d/S29netplug
endef
define NETPLUG_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/netplug/netplug.service \
$(TARGET_DIR)/usr/lib/systemd/system/netplug.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -sf ../../../../usr/lib/systemd/system/netplug.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/netplug.service
endef
$(eval $(generic-package))

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Network cable hotplug management daemon
After=syslog.target network.target
[Service]
ExecStart=/sbin/netplugd -F
Restart=always
[Install]
WantedBy=multi-user.target