The sfptpd daemon can be built by make all
and used from the build
directory without installation. This page offers some examples of how sfptpd
can be installed or packaged in various scenarios.
(c) Copyright 2022-2024 Advanced Micro Devices, Inc.
sudo make prefix=/usr install
sudo make prefix=/usr INST_OMIT=sfptpmon install
Init scripts are no longer installed by the make install
target or shipped
as examples. However, the following options are available.
- A modern init script is provided to Debian standards as
debian/sfptpd.init
and this is included in packages for Debian and derivatives. - A legacy generic init script suitable for any init-based distribution is
available as
scripts/rpm/el6/sfptpd.init
but this is not maintained.
Users of other distributions are encouraged to define and contribute up-to-date startup scripts and packaging definitions suitable for their preferred init system.
Installs to /usr/local
sudo make install
debuild -i -us -uc -b
make DESTDIR=../staging INST_INITS= install
make build_srpm
Read more about RPM builds.
RPM_OSVER=el6 make build_srpm
Then invoke rpmbuild --rebuild
on the generated el6.src.rpm
make patch_version
docker build -f Containerfile .
This example feeds a local configuration into the container via stdin for convenience. In production it would be appropriate to map a configuration file through instead.
sudo docker run \
--network=host \
--cap-add NET_BIND_SERVICE,NET_ADMIN,NET_RAW,SYS_TIME \
$(for d in $(ls /dev/{ptp*,pps*}); do echo "--device $d"; done) \
-i sfptpd:latest \
-v -f - < config/default.cfg
This one-line quick start example invokes a built-in example configuration, specifying a default interface and PTP domain on the command line.
sudo docker run \
--network=host \
--cap-add NET_BIND_SERVICE,NET_ADMIN,NET_RAW,SYS_TIME \
$(for d in $(ls /dev/ptp*); do echo "--device $d"; done) \
ghcr.io/xilinx-cns/sfptpd:master-dev -f /config/ptp_master_freerun.cfg \
-i bond0 -D 100
Host networking is not required if a MACVLAN or IPVLAN is mapped through to the container but due to security limitations in the kernel hardware timetamping needs to be enabled in the host namespace if this is done.
Note that the sfptpd running within a container cannot communicate with chronyd, so chronyd must be disabled.