Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
From dde68ed77114d7b19bfed3068edefc9dc0644445 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sun, 16 Aug 2020 10:21:46 +0200
Subject: [PATCH] src/bandwidthd.h: fix build with gcc 10
Remove SubnetTable[SUBNET_NUM] and IpTable[IP_NUM] from bandwidthd.h as
they are already in bandwidthd.c otherwise the build with gcc 10 will
fail on:
/home/buildroot/autobuild/instance-2/output-1/host/bin/arm-buildroot-linux-gnueabihf-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -o bandwidthd bandwidthd.o graph.o extensions.o sqlight.o parser.o lexer.o pgsql.o -lpcap -lgd -lm -lresolv -L/home/buildroot/autobuild/instance-2/output-1/host/bin/../arm-buildroot-linux-gnueabihf/sysroot/usr/lib -lpng16 -lz -L/home/buildroot/autobuild/instance-2/output-1/host/arm-buildroot-linux-gnueabihf/sysroot/usr/bin/../../../../arm-buildroot-linux-gnueabihf/sysroot/usr/lib/.libs -lnl-genl-3 -lnl-3
/home/buildroot/autobuild/instance-2/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: graph.o:(.bss+0x4b0): multiple definition of `IpTable'; bandwidthd.o:(.bss+0x3e0): first defined here
/home/buildroot/autobuild/instance-2/output-1/host/lib/gcc/arm-buildroot-linux-gnueabihf/10.2.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: graph.o:(.bss+0x18c): multiple definition of `SubnetTable'; bandwidthd.o:(.bss+0x88): first defined here
Fixes:
- http://autobuild.buildroot.org/results/6308c8ee38b6017215038d47c009b238113bd36f
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Upstream: https://github.com/nroach44/bandwidthd/commit/dde68ed77114d7b19bfed3068edefc9dc0644445
---
src/bandwidthd.h | 4 ++--
src/graph.c | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/bandwidthd.h b/src/bandwidthd.h
index 870fdf7..eb4c830 100644
--- a/src/bandwidthd.h
+++ b/src/bandwidthd.h
@@ -134,7 +134,7 @@ struct SubnetData
{
uint32_t ip;
uint32_t mask;
-} SubnetTable[SUBNET_NUM];
+};
struct Statistics
{
@@ -157,7 +157,7 @@ struct IPData
uint32_t ip; // Host byte order
struct Statistics Send;
struct Statistics Receive;
-} IpTable[IP_NUM];
+};
struct SummaryData
{
diff --git a/src/graph.c b/src/graph.c
index b4b68f0..058e8c7 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -18,6 +18,7 @@
#include <resolv.h>
#endif
+extern struct SubnetData SubnetTable[SUBNET_NUM];
extern unsigned int SubnetCount;
extern struct config config;
--
2.27.0

View File

@@ -0,0 +1,36 @@
From 96f5ad56b1bb872c2c24f0c83d06d94ae2936838 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Mon, 22 Jul 2024 14:08:45 +0200
Subject: [PATCH] src/parser.y: fix build with gcc >= 14
Fix the following build failure with gcc >= 14:
parser.c: In function 'yyparse':
parser.c:1196:16: error: implicit declaration of function 'yylex' [-Wimplicit-function-declaration]
1196 | yychar = yylex ();
| ^~~~~
Fixes:
- http://autobuild.buildroot.org/results/33364071de4e5e51a2ac2337b82d145f71e0e64a
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Upstream: https://github.com/nroach44/bandwidthd/pull/3
---
src/parser.y | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/parser.y b/src/parser.y
index d9acc10..15ce61c 100644
--- a/src/parser.y
+++ b/src/parser.y
@@ -11,6 +11,7 @@
#include <arpa/inet.h>
#include "bandwidthd.h"
+extern int yylex (void);
extern unsigned int SubnetCount;
extern struct SubnetData SubnetTable[];
extern struct config config;
--
2.43.0

View File

@@ -0,0 +1,66 @@
config BR2_PACKAGE_BANDWIDTHD
bool "bandwidthd"
depends on BR2_USE_MMU # fork()
select BR2_PACKAGE_LIBPNG
select BR2_PACKAGE_LIBPCAP
select BR2_PACKAGE_GD
help
BandwidthD - Bandwidth monitoring
Provides a method to measure the bandwidth that travels
through the machine, grouped by subnet and IP. This
information can be stored locally in /var/lib/bandwidthd and
can be configured to generate static HTML pages which can be
hosted by a web server.
It is highly recommended that the target has some way of
retaining the time between reboots. (e.g. NTP on boot or an
RTC)
It is suggested to use sqlite for logfile storage but works
fine without, and can be completely ignored if the
postgresql portion is used.
As upstream is no longer actively maintained, a fork is
available on github that works on making BandwidthD's build
process more compatible with buildroot's.
Upstream:
http://bandwidthd.sourceforge.net/
Github fork:
http://github.com/nroach44/bandwidthd
if BR2_PACKAGE_BANDWIDTHD
config BR2_PACKAGE_BANDWIDTHD_POSTGRESQL
bool "enable postgresql log target support"
depends on BR2_USE_MMU # postgresql
depends on !BR2_sparc # postgresql
depends on BR2_USE_WCHAR # postgresql
depends on BR2_ENABLE_LOCALE # postgresql
depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # postgresql
depends on !BR2_STATIC_LIBS # postgresql
depends on !BR2_OPTIMIZE_FAST # postgresql
select BR2_PACKAGE_POSTGRESQL
help
Enable support for logging the bandwidthd data to a remote
(or local) postgresql server. This data can then be viewed
through a php site. See README in the source code
(github.com/nroach44/bandwidthd) for more information.
comment "postgresql support needs a toolchain w/ dynamic library, wchar"
depends on !BR2_sparc
depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR
comment "postgresql support can't be built with Optimize for fast"
depends on !BR2_sparc
depends on BR2_OPTIMIZE_FAST
config BR2_PACKAGE_BANDWIDTHD_SQLITE3
bool "enable sqlite3 log storage"
select BR2_PACKAGE_SQLITE
help
Enable support for storing the aggregated data in an sqlite
db instead of a plain text file.
endif

View File

@@ -0,0 +1,3 @@
# Locally calculated
sha256 0270d0def6cc53c8d47d59a9dd093d51fbca1620adeef85c15e35a32010e26ab bandwidthd-2.0.1-auto-r11.tar.gz
sha256 58573c40770e0c0b91f3eef8192952832321a344f66a4fb2d966095cbbfc86c2 README

View File

@@ -0,0 +1,40 @@
################################################################################
#
# bandwidthd
#
################################################################################
BANDWIDTHD_VERSION = 2.0.1-auto-r11
BANDWIDTHD_SITE = $(call github,nroach44,bandwidthd,v$(BANDWIDTHD_VERSION))
# Specified as "any version of the GPL that is current as of your
# download" by upstream.
BANDWIDTHD_LICENSE = GPL
BANDWIDTHD_LICENSE_FILES = README
BANDWIDTHD_DEPENDENCIES = gd libpng libpcap host-pkgconf
BANDWIDTHD_AUTORECONF = YES
BANDWIDTHD_CONF_OPTS += --with-pcap-config=$(STAGING_DIR)/usr/bin/pcap-config
ifeq ($(BR2_PACKAGE_BANDWIDTHD_POSTGRESQL),y)
BANDWIDTHD_DEPENDENCIES += postgresql
BANDWIDTHD_CONF_OPTS += --with-postgresql-logging=true
else
BANDWIDTHD_CONF_OPTS += --with-postgresql-logging=false
endif
ifeq ($(BR2_PACKAGE_BANDWIDTHD_SQLITE3),y)
BANDWIDTHD_DEPENDENCIES += sqlite
BANDWIDTHD_CONF_OPTS += --with-sqlite-storage=true
else
BANDWIDTHD_CONF_OPTS += --with-sqlite-storage=false
endif
define BANDWIDTHD_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/bandwidthd/bandwidthd.service \
$(TARGET_DIR)/usr/lib/systemd/system/bandwidthd.service
endef
$(eval $(autotools-package))

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Bandwidth usage monitor and reporter
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/bandwidthd
PIDFile=/run/bandwidthd.pid
[Install]
WantedBy=multi-user.target