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
+28
View File
@@ -0,0 +1,28 @@
Fixes issues with glibc header files, see
http://bugs.gentoo.org/show_bug.cgi?id=270483
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Rebase to apply cleanly.
Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
diff -purN a/include/ntp_syscall.h b/include/ntp_syscall.h
--- a/include/ntp_syscall.h 2015-02-11 08:42:37.794576469 -0500
+++ b/include/ntp_syscall.h 2015-02-11 08:43:03.216957279 -0500
@@ -10,6 +10,14 @@
# include <sys/timex.h>
#endif
+#if defined(ADJ_NANO) && !defined(MOD_NANO)
+#define MOD_NANO ADJ_NANO
+#endif
+
+#if defined(ADJ_TAI) && !defined(MOD_TAI)
+#define MOD_TAI ADJ_TAI
+#endif
+
#ifndef NTP_SYSCALLS_LIBC
# ifdef NTP_SYSCALLS_STD
# define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
@@ -0,0 +1,27 @@
inline ntp syscalls fallback
Reference:
https://bugs.ntp.org/show_bug.cgi?id=769
Signed-off-by: James Knight <james.knight@rockwellcollins.com>
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1523,11 +1523,11 @@ AC_CACHE_CHECK(
[ntp_cv_var_ntp_syscalls],
[
ntp_cv_var_ntp_syscalls=no
- case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex" in
+ case "$ac_cv_func_ntp_adjtime$ac_cv_func_ntp_gettime$ac_cv_func___adjtimex$ac_cv_func_adjtimex" in
yesyes*)
ntp_cv_var_ntp_syscalls=libc
;;
- *yes)
+ *yesyes | *yesno | *noyes)
ntp_cv_var_ntp_syscalls=inline
;;
*)
+20
View File
@@ -0,0 +1,20 @@
sntp/libopts/m4/libopts.m4: allow override shell with POSIX_SHELL
Pull in fix from upstream AutoGen [1] to accept POSIX_SHELL from the
environment during the configure step.
[1] http://git.savannah.gnu.org/cgit/autogen.git/commit/?id=db064b9a252f3ef3d8db25411ea0edb0ff8ea758
Signed-off-by: James Byrne <james.byrne@origamienergy.com>
diff --git a/sntp/libopts/m4/libopts.m4 b/sntp/libopts/m4/libopts.m4
--- a/sntp/libopts/m4/libopts.m4
+++ b/sntp/libopts/m4/libopts.m4
@@ -114,6 +114,7 @@
AC_PROG_SED
[while :
do
+ test -x "$POSIX_SHELL" && break
POSIX_SHELL=`which bash`
test -x "$POSIX_SHELL" && break
POSIX_SHELL=`which dash`
@@ -0,0 +1,33 @@
From 082a504cfcc046c3d8adaae1164268bc94e5108a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 31 Jul 2021 10:51:41 -0700
Subject: [PATCH] libntp: Do not use PTHREAD_STACK_MIN on glibc
In glibc 2.34+ PTHREAD_STACK_MIN is not a compile-time constant which
could mean different stack sizes at runtime on different architectures
and it also causes compile failure. Default glibc thread stack size
or 64Kb set by ntp should be good in glibc these days.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
[Copied from https://github.com/openembedded/meta-openembedded/blob/master/meta-networking/recipes-support/ntp/ntp/0001-libntp-Do-not-use-PTHREAD_STACK_MIN-on-glibc.patch]
Signed-off-by: Alexey Brodkin <abrokdin@synopsys.com>
---
libntp/work_thread.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libntp/work_thread.c b/libntp/work_thread.c
index 03a5647..3ddd751 100644
--- a/libntp/work_thread.c
+++ b/libntp/work_thread.c
@@ -41,7 +41,7 @@
#ifndef THREAD_MINSTACKSIZE
# define THREAD_MINSTACKSIZE (64U * 1024)
#endif
-#ifndef __sun
+#if !defined(__sun) && !defined(__GLIBC__)
#if defined(PTHREAD_STACK_MIN) && THREAD_MINSTACKSIZE < PTHREAD_STACK_MIN
# undef THREAD_MINSTACKSIZE
# define THREAD_MINSTACKSIZE PTHREAD_STACK_MIN
--
2.32.0
+101
View File
@@ -0,0 +1,101 @@
config BR2_PACKAGE_NTP
bool "ntp"
select BR2_PACKAGE_LIBEVENT
help
Network Time Protocol suite/programs.
Provides things like ntpd, ntpdate, ntpq, etc...
http://www.ntp.org/
if BR2_PACKAGE_NTP
config BR2_PACKAGE_NTP_SNTP
bool "sntp"
help
Simple network time protocol program (a replacement
for the ntpdate tool)
A script is installed as S48sntp which will retrieve and
step the time if there is a large difference before ntpd
takes over the necessary slew adjustments in S49ntp.
config BR2_PACKAGE_NTP_NTP_KEYGEN
bool "ntp-keygen"
help
Create a NTP host key
config BR2_PACKAGE_NTP_NTP_SHM_CLK
bool "SHM clock support"
help
Compile ntp with support for a SHM clock attached through
shared memory.
config BR2_PACKAGE_NTP_NTP_WAIT
bool "ntp-wait"
depends on BR2_PACKAGE_PERL
help
ntp-wait waits until the locally running ntpd is in state 4
(synchronized). This could be useful at boot time, to delay
the boot sequence until after "ntpd -g" has set the time.
config BR2_PACKAGE_NTP_NTPD
bool "ntpd"
default y
help
ntpd is the time synchronization daemon keeping your local
system date and time in sync and optionally serving time and
date information on the network via the NTP protocol.
config BR2_PACKAGE_NTP_NTPD_ATOM_PPS
bool "PPS support"
depends on BR2_PACKAGE_NTP_NTPD
select BR2_PACKAGE_PPS_TOOLS
help
Compile ntpd with the ability to use an ATOM PPS source.
config BR2_PACKAGE_NTP_NTPDATE
bool "ntpdate"
help
The ntpdate utility program is used to set the local date
and time from an NTP server given as an argument.
config BR2_PACKAGE_NTP_NTPDC
bool "ntpdc"
help
The ntpdc utility program is used to query an NTP daemon about
its current state and to request changes in that state.
config BR2_PACKAGE_NTP_NTPQ
bool "ntpq"
help
The ntpq utility program is used to query NTP servers
requesting information about current state and/or changes in
that state.
config BR2_PACKAGE_NTP_NTPSNMPD
bool "ntpsnmpd"
depends on BR2_USE_MMU # netsnmp fork()
select BR2_PACKAGE_NETSNMP
help
Install ntpsnmpd NTP SNMP MIB agent.
config BR2_PACKAGE_NTP_NTPTIME
bool "ntptime"
help
The ntptime utility program is used to read and set kernel
time variables.
config BR2_PACKAGE_NTP_NTPTRACE
bool "ntptrace"
depends on BR2_PACKAGE_PERL
help
ntptrace is a perl script that uses the ntpq utility program
to follow the chain of NTP servers from a given host back to
the primary time source
config BR2_PACKAGE_NTP_TICKADJ
bool "tickadj"
help
set time-related kernel variables
endif
+55
View File
@@ -0,0 +1,55 @@
#!/bin/sh
DAEMON="sntp"
# sntp uses all the IPs resolved for the hostname (i.e. pool.ntp.org has 4).
# It will try each until they either all timeout or time has been set. Thus
# default to only providing one NTP pool host.
SNTP_SERVERS="pool.ntp.org"
# Step if time delta is greater then 128ms, otherwise slew
SNTP_ARGS="-Ss -M 128"
SNTP_KEY_CACHE="/tmp/kod"
# shellcheck source=/dev/null
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
start() {
printf 'Starting %s: ' "$DAEMON"
# Create key cache file to prevents warning that file is missing
touch $SNTP_KEY_CACHE
# shellcheck disable=SC2086 # we need the word splitting
/usr/bin/$DAEMON $SNTP_ARGS -K $SNTP_KEY_CACHE $SNTP_SERVERS
# sntp behavior
# - Does not background
# - Does not infinitely block
# - Time-out w/o network = ~2 sec
# - Time-out w/ network = ~5sec * # of servers
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"
else
echo "FAIL"
fi
return "$status"
}
stop() {
echo "Nothing to do, $DAEMON is not a daemon."
}
restart() {
stop
sleep 1
start
}
reload() {
echo "Nothing to do, $DAEMON does not support reload."
}
case "$1" in
start|stop|restart|reload)
"$1";;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac
+56
View File
@@ -0,0 +1,56 @@
#!/bin/sh
#
# Starts Network Time Protocol daemon
#
DAEMON="ntpd"
PIDFILE="/var/run/$DAEMON.pid"
NTPD_ARGS="-g"
# 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 "/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
+5
View File
@@ -0,0 +1,5 @@
# From http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p15.tar.gz.md5
md5 e1e6b23d2fc75cced41801dbcd6c2561 ntp-4.2.8p15.tar.gz
# Calculated based on the hash above
sha256 f65840deab68614d5d7ceb2d0bb9304ff70dcdedd09abb79754a87536b849c19 ntp-4.2.8p15.tar.gz
sha256 957e6a13445cc61ab1ca3dc80d8c269cf9b0a6d9eaec20f9f39639b0b3e66ee8 COPYRIGHT
+125
View File
@@ -0,0 +1,125 @@
################################################################################
#
# ntp
#
################################################################################
NTP_VERSION_MAJOR = 4.2
NTP_VERSION_MINOR = 8
NTP_VERSION_POINT = 15
NTP_VERSION = $(NTP_VERSION_MAJOR).$(NTP_VERSION_MINOR)p$(NTP_VERSION_POINT)
NTP_SITE = https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-$(NTP_VERSION_MAJOR)
NTP_DEPENDENCIES = host-pkgconf libevent
NTP_LICENSE = NTP
NTP_LICENSE_FILES = COPYRIGHT
NTP_CPE_ID_VENDOR = ntp
NTP_CPE_ID_VERSION = $(NTP_VERSION_MAJOR).$(NTP_VERSION_MINOR)
NTP_CPE_ID_UPDATE = p$(NTP_VERSION_POINT)
NTP_SELINUX_MODULES = ntp
NTP_CONF_ENV = ac_cv_lib_md5_MD5Init=no POSIX_SHELL=/bin/sh
NTP_CONF_OPTS = \
--with-shared \
--program-transform-name=s,,, \
--disable-tickadj \
--disable-debugging \
--with-yielding-select=yes \
--disable-local-libevent
# 0002-ntp-syscalls-fallback.patch
NTP_AUTORECONF = YES
ifeq ($(BR2_PACKAGE_OPENSSL),y)
NTP_CONF_OPTS += --with-crypto --enable-openssl-random
NTP_DEPENDENCIES += openssl
else
NTP_CONF_OPTS += --without-crypto --disable-openssl-random
endif
ifeq ($(BR2_TOOLCHAIN_HAS_SSP),y)
NTP_CONF_OPTS += --with-hardenfile=linux
else
NTP_CONF_OPTS += --with-hardenfile=default
endif
ifeq ($(BR2_PACKAGE_LIBCAP),y)
NTP_CONF_OPTS += --enable-linuxcaps
NTP_DEPENDENCIES += libcap
else
NTP_CONF_OPTS += --disable-linuxcaps
endif
ifeq ($(BR2_PACKAGE_LIBEDIT),y)
NTP_CONF_OPTS += --with-lineeditlibs=edit
NTP_DEPENDENCIES += libedit
else
NTP_CONF_OPTS += --without-lineeditlibs
endif
ifeq ($(BR2_PACKAGE_NTP_NTPSNMPD),y)
NTP_CONF_OPTS += \
--with-net-snmp-config=$(STAGING_DIR)/usr/bin/net-snmp-config
NTP_DEPENDENCIES += netsnmp
else
NTP_CONF_OPTS += --without-ntpsnmpd
endif
ifeq ($(BR2_PACKAGE_NTP_NTPD_ATOM_PPS),y)
NTP_CONF_OPTS += --enable-ATOM
NTP_DEPENDENCIES += pps-tools
else
NTP_CONF_OPTS += --disable-ATOM
endif
ifeq ($(BR2_PACKAGE_NTP_NTP_SHM_CLK),y)
NTP_CONF_OPTS += --enable-SHM
else
NTP_CONF_OPTS += --disable-SHM
endif
ifeq ($(BR2_PACKAGE_NTP_SNTP),y)
NTP_CONF_OPTS += --with-sntp
else
NTP_CONF_OPTS += --without-sntp
endif
NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_KEYGEN) += util/ntp-keygen
NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_WAIT) += scripts/ntp-wait/ntp-wait
NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDATE) += ntpdate/ntpdate
NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDC) += ntpdc/ntpdc
NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPQ) += ntpq/ntpq
NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPSNMPD) += ntpsnmpd/ntpsnmpd
NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPTIME) += util/ntptime
NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPTRACE) += scripts/ntptrace/ntptrace
NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_SNTP) += sntp/sntp
NTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_TICKADJ) += util/tickadj
define NTP_INSTALL_TARGET_CMDS
$(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd)
test -z "$(NTP_INSTALL_FILES_y)" || install -m 755 $(addprefix $(@D)/,$(NTP_INSTALL_FILES_y)) $(TARGET_DIR)/usr/bin/
$(INSTALL) -m 644 package/ntp/ntpd.etc.conf $(TARGET_DIR)/etc/ntp.conf
endef
# This script will step the time if there is a large difference
# before ntpd takes over the necessary slew adjustments
ifeq ($(BR2_PACKAGE_NTP_SNTP),y)
define NTP_INSTALL_INIT_SYSV_SNTP
$(INSTALL) -D -m 755 package/ntp/S48sntp $(TARGET_DIR)/etc/init.d/S48sntp
endef
endif
ifeq ($(BR2_PACKAGE_NTP_NTPD),y)
define NTP_INSTALL_INIT_SYSV_NTPD
$(INSTALL) -D -m 755 package/ntp/S49ntp $(TARGET_DIR)/etc/init.d/S49ntp
endef
define NTP_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/ntp/ntpd.service $(TARGET_DIR)/usr/lib/systemd/system/ntpd.service
endef
endif
define NTP_INSTALL_INIT_SYSV
$(NTP_INSTALL_INIT_SYSV_NTPD)
$(NTP_INSTALL_INIT_SYSV_SNTP)
endef
$(eval $(autotools-package))
+10
View File
@@ -0,0 +1,10 @@
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 3.pool.ntp.org iburst
# 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]
+15
View File
@@ -0,0 +1,15 @@
[Unit]
Description=Network Time Service
After=network.target
[Service]
Type=forking
PIDFile=/run/ntpd.pid
# Turn off DNSSEC validation for hostname look-ups, since those need the
# correct time to work, but we likely won't acquire that without NTP. Let's
# break this chicken-and-egg cycle here.
Environment=SYSTEMD_NSS_RESOLVE_VALIDATE=0
ExecStart=/usr/sbin/ntpd -g -p /run/ntpd.pid
[Install]
WantedBy=multi-user.target