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,73 @@
From 54fbeaa68a59f536819d1cfb2e9204176fbff54b Mon Sep 17 00:00:00 2001
From: Peter Seiderer <ps.report@gmx.net>
Date: Thu, 16 Dec 2021 23:27:35 +0100
Subject: [PATCH] wscript: remove checks for bsd/string.h, fixes host-compile
failure
Fixes the following host-compile failure while cross-compiling
in case target libbsd is found:
[2/2] Compiling build/host/ntpd/ntp_parser.tab.c
In file included from ../../include/ntp.h:15,
from .../build/ntpsec-1_2_1/ntpd/ntp_parser.y:16:
../../include/ntp_stdlib.h:20:10: fatal error: bsd/string.h: No such file or directory
20 | #include <bsd/string.h>
| ^~~~~~~~~~~~~~
compilation terminated.
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
include/ntp_stdlib.h | 4 ----
wscript | 14 --------------
2 files changed, 18 deletions(-)
diff --git a/include/ntp_stdlib.h b/include/ntp_stdlib.h
index fe4d78e5c..73d97084f 100644
--- a/include/ntp_stdlib.h
+++ b/include/ntp_stdlib.h
@@ -16,10 +16,6 @@
#include "ntp_malloc.h"
#include "ntp_syslog.h"
-#ifdef HAVE_BSD_STRING_H
-#include <bsd/string.h>
-#endif
-
#ifdef __GNUC__
#define NTP_PRINTF(fmt, args) __attribute__((__format__(__printf__, fmt, args)))
#else
diff --git a/wscript b/wscript
index 641073f00..aa04b1d1c 100644
--- a/wscript
+++ b/wscript
@@ -660,19 +660,6 @@ int main(int argc, char **argv) {
prerequisites=ft[1], use=ft[2],
mandatory=ft[3])
- # check for BSD versions outside of libc
- if not ctx.get_define("HAVE_STRLCAT"):
- ret = probe_function(ctx, function='strlcat',
- prerequisites=['bsd/string.h'])
- if ret:
- ctx.define("HAVE_STRLCAT", 1, comment="Using bsd/strlcat")
-
- if not ctx.get_define("HAVE_STRLCPY"):
- ret = probe_function(ctx, function='strlcpy',
- prerequisites=['bsd/string.h'])
- if ret:
- ctx.define("HAVE_STRLCPY", 1, comment="Using bsd/strlcpy")
-
# Nobody uses the symbol, but this seems like a good sanity check.
ctx.check_cc(header_name="stdbool.h", mandatory=True,
comment="Sanity check.")
@@ -691,7 +678,6 @@ int main(int argc, char **argv) {
optional_headers = (
"alloca.h",
("arpa/nameser.h", ["sys/types.h"]),
- "bsd/string.h", # bsd emulation
("ifaddrs.h", ["sys/types.h"]),
("linux/if_addr.h", ["sys/socket.h"]),
("linux/rtnetlink.h", ["sys/socket.h"]),
--
2.34.1

View File

@@ -0,0 +1,26 @@
From 712675fbd2a736df817fecd7bfb39055946ef85b Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <wbx@openadk.org>
Date: Sun, 13 Aug 2023 13:48:03 +0200
Subject: [PATCH] disable PIE support
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Upstream: N/A Not upstreamable
---
wscript | 1 -
1 file changed, 1 deletion(-)
diff --git a/wscript b/wscript
index 292e3a45b..105c7eac2 100644
--- a/wscript
+++ b/wscript
@@ -299,7 +299,6 @@ def configure(ctx):
cc_test_flags = [
('PIC', '-fPIC'),
- ('PIE', '-pie -fPIE'),
# this quiets most of macOS warnings on -fpie
('unused', '-Qunused-arguments'),
# This is a useless warning on any architecture with a barrel
--
2.39.2

View File

@@ -0,0 +1,47 @@
From 904983bf9465017753c6f5b602fc9c98458615f7 Mon Sep 17 00:00:00 2001
From: "Gary E. Miller" <gem@rellim.com>
Date: Mon, 27 Oct 2025 12:35:35 -0700
Subject: [PATCH] ntpd/refclock_gpsd.c: Add missing time.h for strptime()
Upstream: https://gitlab.com/NTPsec/ntpsec/-/commit/5137c155d8895cfc50fb577ee720b3b23589c662
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
ntpd/refclock_gpsd.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/ntpd/refclock_gpsd.c b/ntpd/refclock_gpsd.c
index 1dfec3103..0a2987d84 100644
--- a/ntpd/refclock_gpsd.c
+++ b/ntpd/refclock_gpsd.c
@@ -100,20 +100,20 @@ typedef unsigned long int json_uint;
* header stuff we need
*/
-#include <netdb.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
#include <ctype.h>
+#include <fcntl.h>
#include <math.h>
+#include <netdb.h>
+#include <string.h>
+#include <time.h> // for strptime()
+#include <unistd.h>
-#include <sys/types.h>
+#include <sys/select.h>
#include <sys/socket.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <netinet/tcp.h>
-#include <sys/select.h>
-
#include "ntpd.h"
#include "ntp_io.h"
#include "ntp_refclock.h"
--
2.47.3

View File

@@ -0,0 +1,32 @@
From 55c230d61ece7213506f1dccac76c21aefbade9e Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd@kuhls.net>
Date: Mon, 27 Oct 2025 19:18:13 +0100
Subject: [PATCH] refclock_gpsd: add build fix for gcc => 14.x
../../ntpd/refclock_gpsd.c:2076:14: error: implicit declaration of
function 'strptime'; did you mean 'strftime'?
[-Wimplicit-function-declaration]
Upstream: https://gitlab.com/NTPsec/ntpsec/-/merge_requests/1484
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
ntpd/refclock_gpsd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ntpd/refclock_gpsd.c b/ntpd/refclock_gpsd.c
index a4a6f7095..a3995896a 100644
--- a/ntpd/refclock_gpsd.c
+++ b/ntpd/refclock_gpsd.c
@@ -59,6 +59,8 @@
*/
+#define _XOPEN_SOURCE
+#define _DEFAULT_SOURCE
#include "config.h"
#include "ntp.h"
#include "ntp_types.h"
--
2.47.3

44
package/ntpsec/Config.in Normal file
View File

@@ -0,0 +1,44 @@
config BR2_PACKAGE_NTPSEC
bool "ntpsec"
depends on BR2_USE_MMU # python3
depends on BR2_USE_WCHAR # python3
depends on BR2_TOOLCHAIN_HAS_THREADS # python3
depends on !BR2_STATIC_LIBS # python3
select BR2_PACKAGE_LIBCAP
select BR2_PACKAGE_OPENSSL
select BR2_PACKAGE_PYTHON3
help
NTPsec project - a secure, hardened, and improved
implementation of Network Time Protocol derived
from NTP Classic, Dave Mills’s original.
Provides things like ntpd, ntpdate, ntpq, etc...
https://www.ntpsec.org/
if BR2_PACKAGE_NTPSEC
config BR2_PACKAGE_NTPSEC_CLASSIC_MODE
bool "classic-mode"
help
Enable strict configuration and log-format compatibility
with NTP Classic.
config BR2_PACKAGE_NTPSEC_NTS
bool "NTS support"
help
Enable Network Time Security (NTS) support.
config BR2_PACKAGE_NTPSEC_REFCLOCK_ALL
bool "refclock-all"
select BR2_PACKAGE_PPS_TOOLS
help
Enable all refclocks (hardware, sync source and discplined
clocks)
endif
comment "ntpsec needs a toolchain w/ wchar, threads, dynamic library"
depends on BR2_USE_MMU
depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
BR2_STATIC_LIBS

58
package/ntpsec/S49ntpd Normal file
View File

@@ -0,0 +1,58 @@
#!/bin/sh
#
# Starts Network Time Protocol daemon
#
DAEMON="ntpd"
PIDFILE="/var/run/$DAEMON.pid"
NTPD_ARGS="-g -u ntp:ntp -s /var/run/ntp"
# shellcheck source=/dev/null
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
mkdir -p /var/run/ntp && chown ntp:ntp /var/run/ntp
start() {
printf 'Starting %s: ' "$DAEMON"
# shellcheck disable=SC2086 # we need the word splitting
start-stop-daemon -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \
-- $NTPD_ARGS -p "$PIDFILE"
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"
status=$?
if [ "$status" -eq 0 ]; then
rm -f "$PIDFILE"
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
restart() {
stop
sleep 1
start
}
case "$1" in
start|stop|restart)
"$1";;
reload)
# Restart, since there is no true "reload" feature.
restart;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac

View File

@@ -0,0 +1,33 @@
#
# legacy NTP configuration
#
pool 0.pool.ntp.org iburst
pool 1.pool.ntp.org iburst
pool 2.pool.ntp.org iburst
pool 3.pool.ntp.org iburst
#
# NTS configuration
#
# Notes:
# - uncomment the following lines to enable NTS support (but
# make sure the initial clock is up-to-date (otherwise the
# NTS certificate validation will fail with 'NTSc: certificate invalid:
# 9=>certificate is not yet valid' as on boards without RTC support)
# and/or keep at least one line from the legacy NTP lines
# - enable BR2_PACKAGE_CA_CERTIFICATES to gain access to the certificate
# files
#
# server time.cloudflare.com nts # Global, anycast
# server nts.ntp.se:4443 nts # Sweden
# server ntpmon.dcs1.biz nts # Singapore
# server ntp1.glypnod.com nts # San Francisco
# server ntp2.glypnod.com nts # London
#
# ca /usr/share/ca-certificates/mozilla
# Allow only time queries, at a limited rate, sending KoD when in excess.
# Allow all local queries (IPv4, IPv6)
restrict default nomodify nopeer noquery limited kod
restrict 127.0.0.1
restrict [::1]

View File

@@ -0,0 +1,12 @@
# Locally calculated
sha256 3abc1b057a252d214ef2e76aa375fe0d81432c626e75304b17850d68eee0c54f ntpsec-NTPsec_1_2_4.tar.bz2
sha256 074e6e32c86a4c0ef8b3ed25b721ca23aca83df277cd88106ef7177c354615ff LICENSES/Apache-2.0.txt
sha256 991d8a58e0b4be84a174a9bd333a8ca33807a0c1ce6d23a2e25a21f7ece482d0 LICENSES/Beerware.txt
sha256 899261d6eb6c922cf8f051225411f27b738ba0014be18c2eaf6afbf30d421bb1 LICENSES/BSD-2-Clause.txt
sha256 5fe38d8724c53ff4e69f0a3492a368b4a6719700ac16f706efeb01a45c62f2b5 LICENSES/BSD-3-Clause.txt
sha256 c80d927f03db7212ba43a869a383e249c19b40859ff0d9e2e2f968e4fdcf005f LICENSES/BSD-4-Clause.txt
sha256 9ba9550ad48438d0836ddab3da480b3b69ffa0aac7b7878b5a0039e7ab429411 LICENSES/CC-BY-4.0.txt
sha256 f2ec607f67bb0dd3053b49835b02110d5cd0f8eb6da3aac4dc0b142a6b299be9 LICENSES/ISC.txt
sha256 074415b57c6ba1780483d89e55f40dec3ded96c28aaf47d63c486683ba553e7c LICENSES/MIT.txt
sha256 62fec6cd79721af81b7c12f1a679535235fdd22800ab17653042f024187ff274 LICENSES/NTP.txt
sha256 d3b21470adadd9abd9c6d675378f8c371ac5a4ea6dbec91859e02fadca3c0856 docs/copyright.adoc

91
package/ntpsec/ntpsec.mk Normal file
View File

@@ -0,0 +1,91 @@
################################################################################
#
# ntpsec
#
################################################################################
NTPSEC_VERSION = 1.2.4
NTPSEC_SOURCE = ntpsec-NTPsec_$(subst .,_,$(NTPSEC_VERSION)).tar.bz2
NTPSEC_SITE = https://gitlab.com/NTPsec/ntpsec/-/archive/NTPsec_$(subst .,_,$(NTPSEC_VERSION))
NTPSEC_LICENSE = Apache-2.0, \
Beerware, \
BSD-2-Clause.txt, \
BSD-3-Clause.txt, \
BSD-4-Clause.txt, \
ISC.txt, \
MIT.txt, \
NTP.txt, \
CC-BY-4.0.txt (docs)
NTPSEC_LICENSE_FILES = \
LICENSES/Apache-2.0.txt \
LICENSES/Beerware.txt \
LICENSES/BSD-2-Clause.txt \
LICENSES/BSD-3-Clause.txt \
LICENSES/BSD-4-Clause.txt \
LICENSES/ISC.txt \
LICENSES/MIT.txt \
LICENSES/NTP.txt \
LICENSES/CC-BY-4.0.txt \
docs/copyright.adoc
NTPSEC_CPE_ID_VENDOR = ntpsec
NTPSEC_DEPENDENCIES = \
host-bison \
host-pkgconf \
python3 \
libcap \
openssl
NTPSEC_CONF_ENV = \
CC="$(HOSTCC)" \
CFLAGS="$(HOST_CFLAGS)" \
PYTHON_CONFIG="$(STAGING_DIR)/usr/bin/python3-config"
# CC="$(HOSTCC)" is strange but needed to build some host tools, the
# cross-compiler will properly be used to build target code thanks to
# --cross-compiler
NTPSEC_CONF_OPTS = \
--libdir=/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/ntp \
--cross-compiler="$(TARGET_CC)" \
--cross-cflags="$(TARGET_CFLAGS) -std=gnu99" \
--cross-ldflags="$(TARGET_LDFLAGS)" \
--notests \
--enable-early-droproot \
--disable-mdns-registration \
--enable-pylib=ffi \
--nopyc \
--nopyo \
--nopycache \
--disable-doc \
--disable-manpage
ifeq ($(BR2_PACKAGE_NTPSEC_CLASSIC_MODE),y)
NTPSEC_CONF_OPTS += --enable-classic-mode
endif
# no '--enable-nts' option available
ifeq ($(BR2_PACKAGE_NTPSEC_NTS),)
NTPSEC_CONF_OPTS += --disable-nts
endif
# refclocks are disabled by default, can only be enabled
ifeq ($(BR2_PACKAGE_NTPSEC_REFCLOCK_ALL),y)
NTPSEC_DEPENDENCIES += pps-tools
NTPSEC_CONF_OPTS += --refclock=all
endif
define NTPSEC_INSTALL_NTPSEC_CONF
$(INSTALL) -m 644 package/ntpsec/ntpd.etc.conf $(TARGET_DIR)/etc/ntp.conf
endef
NTPSEC_POST_INSTALL_TARGET_HOOKS += NTPSEC_INSTALL_NTPSEC_CONF
define NTPSEC_INSTALL_INIT_SYSV
$(INSTALL) -D -m 755 package/ntpsec/S49ntpd $(TARGET_DIR)/etc/init.d/S49ntpd
endef
define NTPSEC_USERS
ntp -1 ntp -1 * - - - ntpd user
endef
$(eval $(waf-package))