initial buildroot for linux 5.15

This commit is contained in:
Huan.Feng
2021-12-06 14:12:13 +08:00
parent d7767d594e
commit 7b6fc358fa
12736 changed files with 508822 additions and 0 deletions
@@ -0,0 +1,48 @@
From f31eec323ae65124474664f8a0444f7c035556dd Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sun, 6 Sep 2020 22:31:12 +0200
Subject: [PATCH] olsrd: migrate to using bison 3.7.1
With the upgrade to bison 3.7.1 (openwrt commit 1cf842d) building
olsrd was failing. Now, instead of the contents of header files
being directly inserted into the generated source files, they are
instead included with a #include directive.
The local.mk has, until now, done some magic with *-tmp files,
which is not longer necessary and even causes builds to fail.
src/cfgparser/oparse.c:265:10: fatal error: oparse.h-tmp: No such file or directory
#include "oparse.h-tmp"
Suggested-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
[Retrieved from:
https://github.com/openwrt-routing/packages/commit/5cc8e058850acbc22fe92c5e2b24863efc577971]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/OLSR/olsrd/pull/87]
---
src/cfgparser/local.mk | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/cfgparser/local.mk b/src/cfgparser/local.mk
index e767abfc..56e594e4 100644
--- a/src/cfgparser/local.mk
+++ b/src/cfgparser/local.mk
@@ -74,12 +74,8 @@ $(C)oparse.c: $(C)oparse.y $(C)olsrd_conf.h $(C)Makefile
ifeq ($(VERBOSE),0)
@echo "[BISON] $@"
endif
- $(MAKECMDPREFIX)$(BISON) -d -o "$@-tmp" "$<"
- $(MAKECMDPREFIX)sed -e 's/register //' \
- -e '/^#line/s/$(call quote,$@-tmp)/$(call quote,$@)/' \
- < "$@-tmp" >"$@"
- $(MAKECMDPREFIX)mv "$(subst .c,.h,$@-tmp)" "$(subst .c,.h,$@)"
- $(MAKECMDPREFIX)$(RM) "$@-tmp" "$(subst .c,.h,$@-tmp)"
+ $(MAKECMDPREFIX)$(BISON) -d -o "$@" "$<"
+ $(MAKECMDPREFIX)sed -e 's/register //' "$@" > "$@.o" && mv "$@.o" "$@"
$(C)oparse.o: CFLAGS := $(filter-out -Wunreachable-code,$(CFLAGS))
--
2.28.0
@@ -0,0 +1,33 @@
From 2f9311668dfdeee0453f5fceb27e8c95c065c4b6 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sat, 18 Jan 2020 17:29:56 +0100
Subject: [PATCH] lib/pud/Makefile: fix parallel build
nmealib is needed to build olsrd_pud plugin otherwise build fails on:
[LD] olsrd_pud.so.3.0.0 (nmealib dynamically linked)
/home/fabrice/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.8.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lnmea
wireformat/lib/libOlsrdPudWireFormat.so: file not recognized: File truncated
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/OLSR/olsrd/pull/78]
---
lib/pud/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/pud/Makefile b/lib/pud/Makefile
index e2524421..28330d92 100644
--- a/lib/pud/Makefile
+++ b/lib/pud/Makefile
@@ -108,7 +108,7 @@ endif
default_target: nmealib library $(PLUGIN_FULLNAME)
-$(PLUGIN_FULLNAME): $(OBJS) version-script.txt
+$(PLUGIN_FULLNAME): $(OBJS) version-script.txt nmealib
ifeq ($(PUD_NMEALIB_STATICALLY_LINKED),)
ifeq ($(VERBOSE),0)
@echo "[LD] $@ (nmealib dynamically linked)"
--
2.24.1
@@ -0,0 +1,105 @@
From b2dfb6c27fcf4ddae87b0e99492f4bb8472fa39a Mon Sep 17 00:00:00 2001
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
Date: Thu, 13 Feb 2020 17:26:41 -0300
Subject: [PATCH] pud: adapt to API changes in gpsd 3.20
The timestamp fields were changed from double to struct timespec, and
the geoid separation field was moved to fix.geoid_sep.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
[Retrieved from:
https://github.com/OLSR/olsrd/commit/b2dfb6c27fcf4ddae87b0e99492f4bb8472fa39a]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
lib/pud/src/gpsdclient.c | 36 ++++++++++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 4 deletions(-)
diff --git a/lib/pud/src/gpsdclient.c b/lib/pud/src/gpsdclient.c
index 9e7fb708d..2a7a26eef 100644
--- a/lib/pud/src/gpsdclient.c
+++ b/lib/pud/src/gpsdclient.c
@@ -79,6 +79,23 @@ static void gpsdError(const char *s) {
syslog(LOG_ERR, "gpsd error: %s", s);
}
+#if GPSD_API_MAJOR_VERSION >= 9
+static double time_as_double(struct timespec *ts) {
+ return (ts->tv_sec + ts->tv_nsec * 1e-9);
+}
+
+static bool is_online(struct gps_data_t *gpsdata) {
+ return !!gpsdata->online.tv_sec;
+}
+#else
+
+#define time_as_double(x) *(x)
+
+static bool is_online(struct gps_data_t *gpsdata) {
+ return !!gpsdata->online;
+}
+#endif
+
/* standard parsing of a GPS data source spec */
void gpsdParseSourceSpec(char *arg, GpsDaemon *gpsDaemon) {
if (!arg //
@@ -298,8 +315,8 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
8, //
dev->parity, //
dev->stopbits, //
- dev->cycle, //
- dev->mincycle);
+ time_as_double(&dev->cycle), //
+ time_as_double(&dev->mincycle));
connectionTracking->devSeen[i] = true;
connectionTracking->dev[i] = *dev;
@@ -367,11 +384,18 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
nmeaInfoSetPresent(&info->present, NMEALIB_PRESENT_SMASK);
/* date & time */
+#if GPSD_API_MAJOR_VERSION >= 9
+ if (gpsdata->fix.time.tv_sec > 0) {
+ struct tm *time = gmtime(&gpsdata->fix.time.tv_sec);
+ unsigned int hsec = (unsigned int) (gpsdata->fix.time.tv_nsec / 10000000);
+#else
if (!isNaN(gpsdata->fix.time)) {
double seconds;
double fraction = modf(fabs(gpsdata->fix.time), &seconds);
long sec = lrint(seconds);
struct tm *time = gmtime(&sec);
+ unsigned int hsec = (unsigned int) lrint(fraction * 100);
+#endif
if (time) {
info->utc.year = (unsigned int) time->tm_year + 1900;
info->utc.mon = (unsigned int) time->tm_mon + 1;
@@ -379,7 +403,7 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
info->utc.hour = (unsigned int) time->tm_hour;
info->utc.min = (unsigned int) time->tm_min;
info->utc.sec = (unsigned int) time->tm_sec;
- info->utc.hsec = (unsigned int) lrint(fraction * 100);
+ info->utc.hsec = hsec;
nmeaInfoSetPresent(&info->present, NMEALIB_PRESENT_UTCDATE | NMEALIB_PRESENT_UTCTIME);
}
@@ -387,7 +411,7 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
gpsdata->set &= ~TIME_SET;
/* sig & fix */
- if (!gpsdata->online) {
+ if (!is_online(gpsdata)) {
gpsdata->fix.mode = MODE_NO_FIX;
}
@@ -454,7 +478,11 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
if ((gpsdata->fix.mode >= MODE_3D) //
&& !isNaN(gpsdata->fix.altitude)) {
info->elevation = gpsdata->fix.altitude;
+#if GPSD_API_MAJOR_VERSION >= 9
+ info->height = gpsdata->fix.geoid_sep;
+#else
info->height = gpsdata->separation;
+#endif
nmeaInfoSetPresent(&info->present, NMEALIB_PRESENT_ELV | NMEALIB_PRESENT_HEIGHT);
}
gpsdata->set &= ~ALTITUDE_SET;
@@ -0,0 +1,35 @@
From 2f9ee6079b20fb5d3884472825a40c5c65550fa2 Mon Sep 17 00:00:00 2001
From: Nick Hainke <vincent@systemli.org>
Date: Sun, 30 May 2021 19:13:48 +0200
Subject: [PATCH] pud: adapt gpsdclient.c to new gpsd 3.21
As mentioned:
"Move gps_data_t->status to gps_fix_t.status for better fix merging"
https://gitlab.com/gpsd/gpsd/-/commit/29991d6ffeb41ecfc8297db68bb68be0128c8514
Signed-off-by: Nick Hainke <vincent@systemli.org>
Upstream: 79a28cdb4083b66c5d3a5f9c0d70dbdc86c0420c
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
lib/pud/src/gpsdclient.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/pud/src/gpsdclient.c b/lib/pud/src/gpsdclient.c
index 2a7a26ee..a2a9cee0 100644
--- a/lib/pud/src/gpsdclient.c
+++ b/lib/pud/src/gpsdclient.c
@@ -370,7 +370,11 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
);
gpsdata->set &= ~STATUS_SET; /* always valid */
+ #if GPSD_API_MAJOR_VERSION >= 10
+ if (gpsdata->fix.status == STATUS_NO_FIX) {
+ #else
if (gpsdata->status == STATUS_NO_FIX) {
+ #endif
nmeaInfoClear(info);
nmeaTimeSet(&info->utc, &info->present, NULL);
return;
--
2.31.1
@@ -0,0 +1,49 @@
From 665051a845464c0f95edb81432104dac39426f79 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sat, 6 Nov 2021 15:50:58 +0100
Subject: [PATCH] lib/pud/src/gpsdclient.c: drop handling of
gpsdata->fix.status
Here is an extract of https://gpsd.gitlab.io/gpsd/gpsd_json.html:
The optional "status" field (aka fix type), is a modifier (adjective) to
mode. It is not a replacement for, or superset of, the "mode" field. It
is almost, but not quite, the same as the NMEA 4.x xxGGA GPS Quality
Indicator Values. Many GNSS receivers do not supply it. Those that do
interpret the specification in various incompatible ways.
So status field is optional and STATUS_NO_FIX has been explicitly
renamed into STATUS_UNK to avoid confusion with MODE_NO_FIX (which is
already handled by gpsdclient.c) so drop the if block to fix the build
failure with gpsd >= 3.23.1.
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream: https://github.com/OLSR/olsrd/commit/665051a845464c0f95edb81432104dac39426f79]
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
lib/pud/src/gpsdclient.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/lib/pud/src/gpsdclient.c b/lib/pud/src/gpsdclient.c
index a2a9cee0..d448867d 100644
--- a/lib/pud/src/gpsdclient.c
+++ b/lib/pud/src/gpsdclient.c
@@ -370,15 +370,6 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
);
gpsdata->set &= ~STATUS_SET; /* always valid */
- #if GPSD_API_MAJOR_VERSION >= 10
- if (gpsdata->fix.status == STATUS_NO_FIX) {
- #else
- if (gpsdata->status == STATUS_NO_FIX) {
- #endif
- nmeaInfoClear(info);
- nmeaTimeSet(&info->utc, &info->present, NULL);
- return;
- }
if (!gpsdata->set) {
return;
--
2.33.1
+24
View File
@@ -0,0 +1,24 @@
config BR2_PACKAGE_OLSR
bool "olsr"
depends on BR2_USE_MMU # fork()
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on !BR2_STATIC_LIBS
# https://github.com/OLSR/olsrd/issues/6
depends on !BR2_TOOLCHAIN_USES_MUSL || BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
help
The Optimized Link State Routing protocol (OLSR) is a
routing protocol that is optimised for mobile ad-hoc
networks, sometimes called wireless mesh networks. It is a
proactive link-state routing protocol that floods a full
topology table to all nodes in the network which then
compute optimal forwarding paths locally.
http://www.olsr.org/
comment "olsr needs a toolchain w/ threads, dynamic library"
depends on BR2_USE_MMU
depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
comment "olsr needs a musl toolchain w/ headers >= 4.15"
depends on BR2_TOOLCHAIN_USES_MUSL
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
case "$1" in
start)
printf "Starting oslrd daemon: "
start-stop-daemon -S -q -x /usr/sbin/olsrd -- -d 0 -pidfile /run/olsrd.pid
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
stop)
printf "Stopping olsrd daemon: "
start-stop-daemon -K -q -p /run/olsrd.pid
[ $? = 0 ] && echo "OK" || echo "FAIL"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
+4
View File
@@ -0,0 +1,4 @@
# Locally computed
sha256 ee9e524224e5d5304dcf61f1dc5485c569da09d382934ff85b233be3e24821a3 olsr-0.9.8.tar.gz
sha256 7dcf1fb93ef105e2708b02603bb6ee443115d4819fbf2c5a3a001b46887acb9a license.txt
sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 lib/pud/nmealib/LICENSE
+60
View File
@@ -0,0 +1,60 @@
################################################################################
#
# olsr
#
################################################################################
OLSR_VERSION = 0.9.8
OLSR_SITE = $(call github,OLSR,olsrd,v$(OLSR_VERSION))
OLSR_PLUGINS = arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo jsoninfo \
mdns nameservice netjson poprouting p2pd pgraph secure txtinfo watchdog
# Doesn't really need quagga but not very useful without it
OLSR_PLUGINS += $(if $(BR2_PACKAGE_QUAGGA),quagga)
OLSR_LICENSE = BSD-3-Clause
OLSR_LICENSE_FILES = license.txt
OLSR_DEPENDENCIES = host-flex host-bison
OLSR_CFLAGS = $(TARGET_CFLAGS)
# it needs -fPIC to link on lot of architectures
OLSR_CFLAGS += -fPIC
ifeq ($(BR2_PACKAGE_GPSD),y)
OLSR_LICENSE += , LGPL-2.1+ (nmealib)
OLSR_LICENSE_FILES += lib/pud/nmealib/LICENSE
OLSR_DEPENDENCIES += gpsd
OLSR_PLUGINS += pud
endif
define OLSR_BUILD_CMDS
$(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) \
CFLAGS="$(OLSR_CFLAGS)" -C $(@D) olsrd
$(foreach p,$(OLSR_PLUGINS), \
$(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) \
CFLAGS="$(OLSR_CFLAGS)" -C $(@D)/lib/$(p)
)
endef
define OLSR_INSTALL_TARGET_CMDS
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) \
prefix="/usr" install_bin
$(foreach p,$(OLSR_PLUGINS), \
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/lib/$(p) \
LDCONFIG=/bin/true DESTDIR=$(TARGET_DIR) \
prefix="/usr" install
)
$(INSTALL) -D -m 0644 $(@D)/files/olsrd.conf.default.lq \
$(TARGET_DIR)/etc/olsrd/olsrd.conf
endef
define OLSR_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/olsr/S50olsr \
$(TARGET_DIR)/etc/init.d/S50olsr
endef
define OLSR_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/olsr/olsr.service \
$(TARGET_DIR)/usr/lib/systemd/system/olsr.service
endef
$(eval $(generic-package))
+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=Ad-hoc wireless mesh routing daemon
After=network.target
[Service]
ExecStart=/usr/sbin/olsrd -nofork
Restart=always
[Install]
WantedBy=multi-user.target