initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
From 947bf03ec3d9eaa0bfc0269eed86b9364e94bc1a Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Date: Sun, 5 Aug 2018 15:25:53 +0200
|
||||
Subject: [PATCH] missing.h: drop clock_nanosleep() replacement
|
||||
|
||||
Since uClibc-ng commits 68628fe7d463541bf3c33da6b214e63c0cc9feed
|
||||
("librt: declare clock_nanosleep not only for NPTL") and
|
||||
ddbb03e77ac1a48740688814b82f45c97ee81f37 ("librt: clock_nanosleep
|
||||
could be even used without threads"), clock_nanosleep() is always
|
||||
provided by uClibc, regardless of the thread implementation (none,
|
||||
linuxthreads, nptl). These commits will be part of the upcoming 1.0.31
|
||||
release of uClibc-ng.
|
||||
|
||||
Thanks to this, we can drop the replacement clock_nanosleep()
|
||||
implementation added by linuxptp. Without this, linuxptp fails to
|
||||
build with:
|
||||
|
||||
missing.h:117:19: error: static declaration of 'clock_nanosleep' follows non-static declaration
|
||||
static inline int clock_nanosleep(clockid_t clock_id, int flags,
|
||||
^~~~~~~~~~~~~~~
|
||||
In file included from clockadj.h:24:0,
|
||||
from clockadj.c:24:
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
missing.h | 7 -------
|
||||
1 file changed, 7 deletions(-)
|
||||
|
||||
diff --git a/missing.h b/missing.h
|
||||
index 2f7adb9..60f89a3 100644
|
||||
--- a/missing.h
|
||||
+++ b/missing.h
|
||||
@@ -129,13 +129,6 @@ enum {
|
||||
|
||||
#define TFD_TIMER_ABSTIME (1 << 0)
|
||||
|
||||
-static inline int clock_nanosleep(clockid_t clock_id, int flags,
|
||||
- const struct timespec *request,
|
||||
- struct timespec *remain)
|
||||
-{
|
||||
- return syscall(__NR_clock_nanosleep, clock_id, flags, request, remain);
|
||||
-}
|
||||
-
|
||||
static inline int timerfd_create(int clockid, int flags)
|
||||
{
|
||||
return syscall(__NR_timerfd_create, clockid, flags);
|
||||
--
|
||||
2.14.4
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
config BR2_PACKAGE_LINUXPTP
|
||||
bool "linuxptp"
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
help
|
||||
The Linux PTP Project is the Precision Time Protocol
|
||||
implementation according to IEEE standard 1588 for Linux.
|
||||
|
||||
The dual design goals are to provide a robust implementation
|
||||
of the standard and to use the most relevant and modern
|
||||
Application Programming Interfaces (API) offered by the
|
||||
Linux kernel. Supporting legacy APIs and other platforms is
|
||||
not a goal.
|
||||
|
||||
http://linuxptp.sourceforge.net/
|
||||
|
||||
comment "linuxptp needs a toolchain w/ threads"
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Start linuxptp
|
||||
#
|
||||
|
||||
DAEMON="ptp4l"
|
||||
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
PTP4L_ARGS="-f /etc/linuxptp.cfg"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/ptp4l" ] && . "/etc/default/ptp4l"
|
||||
|
||||
start() {
|
||||
printf "Starting linuxptp daemon: "
|
||||
start-stop-daemon -S -b -q -m -p $PIDFILE \
|
||||
-x /usr/sbin/$DAEMON -- $PTP4L_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping linuxptp 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
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Start linuxptp
|
||||
#
|
||||
|
||||
DAEMON="phc2sys"
|
||||
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
PHC2SYS_ARGS="-a -r -S 1.0"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/phc2sys" ] && . "/etc/default/phc2sys"
|
||||
|
||||
start() {
|
||||
printf "Starting linuxptp system clock synchronization: "
|
||||
start-stop-daemon -S -b -q -m -p $PIDFILE \
|
||||
-x /usr/sbin/$DAEMON -- $PHC2SYS_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping linuxptp system clock synchronization: "
|
||||
start-stop-daemon -K -q -p $PIDFILE
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
@@ -0,0 +1,19 @@
|
||||
# LinuxPTP configuration file for synchronizing the system clock to
|
||||
# a remote PTP master in slave-only mode.
|
||||
#
|
||||
# By default synchronize time in slave-only mode using UDP and hardware time
|
||||
# stamps on eth0. If the difference to master is >1.0 second correct by
|
||||
# stepping the clock instead of adjusting the frequency.
|
||||
#
|
||||
# If you change the configuration don't forget to update the phc2sys
|
||||
# parameters accordingly in linuxptp-system-clock.service (systemd)
|
||||
# or the linuxptp SysV init script.
|
||||
|
||||
[global]
|
||||
slaveOnly 1
|
||||
delay_mechanism Auto
|
||||
network_transport UDPv4
|
||||
time_stamping hardware
|
||||
step_threshold 1.0
|
||||
|
||||
[eth0]
|
||||
@@ -0,0 +1,9 @@
|
||||
# From https://sourceforge.net/projects/linuxptp/files/v3.1.1/
|
||||
sha1 f905eabc6fd0f03c6a353f9c4ba188a3bd1b774c linuxptp-3.1.1.tgz
|
||||
md5 3b79ab5e77c5b5cf06bc1c8350d405bb linuxptp-3.1.1.tgz
|
||||
|
||||
# Locally computed:
|
||||
sha256 94d6855f9b7f2d8e9b0ca6d384e3fae6226ce6fc012dbad02608bdef3be1c0d9 linuxptp-3.1.1.tgz
|
||||
|
||||
# Hash for license file:
|
||||
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
|
||||
@@ -0,0 +1,50 @@
|
||||
################################################################################
|
||||
#
|
||||
# linuxptp
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LINUXPTP_VERSION = 3.1.1
|
||||
LINUXPTP_SOURCE = linuxptp-$(LINUXPTP_VERSION).tgz
|
||||
LINUXPTP_SITE = http://downloads.sourceforge.net/linuxptp
|
||||
LINUXPTP_LICENSE = GPL-2.0+
|
||||
LINUXPTP_LICENSE_FILES = COPYING
|
||||
LINUXPTP_CPE_ID_VENDOR = linuxptp_project
|
||||
|
||||
LINUXPTP_MAKE_ENV = \
|
||||
$(TARGET_MAKE_ENV) \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
KBUILD_OUTPUT=$(STAGING_DIR)
|
||||
|
||||
LINUXPTP_MAKE_OPTS = \
|
||||
prefix=/usr \
|
||||
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
|
||||
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
define LINUXPTP_BUILD_CMDS
|
||||
$(LINUXPTP_MAKE_ENV) $(MAKE) $(LINUXPTP_MAKE_OPTS) -C $(@D) all
|
||||
endef
|
||||
|
||||
define LINUXPTP_INSTALL_TARGET_CMDS
|
||||
$(LINUXPTP_MAKE_ENV) $(MAKE) $(LINUXPTP_MAKE_OPTS) \
|
||||
DESTDIR=$(TARGET_DIR) -C $(@D) install
|
||||
|
||||
$(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/linuxptp.cfg \
|
||||
$(TARGET_DIR)/etc/linuxptp.cfg
|
||||
endef
|
||||
|
||||
define LINUXPTP_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 755 -D $(LINUXPTP_PKGDIR)/S65ptp4l \
|
||||
$(TARGET_DIR)/etc/init.d/S65ptp4l
|
||||
$(INSTALL) -m 755 -D $(LINUXPTP_PKGDIR)/S66phc2sys \
|
||||
$(TARGET_DIR)/etc/init.d/S66phc2sys
|
||||
endef
|
||||
|
||||
define LINUXPTP_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/ptp4l.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/ptp4l.service
|
||||
$(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/phc2sys.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/phc2sys.service
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Precision Time Protocol system clock synchronization
|
||||
After=ptp4l.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/phc2sys -s /dev/ptp0 -c CLOCK_REALTIME -w -S 1.0
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Precision Time Protocol daemon
|
||||
After=syslog.target network.target
|
||||
Before=time-sync.target
|
||||
Wants=time-sync.target
|
||||
Wants=phc2sys.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp.cfg
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user