1. Download ntp-4.2.8p8.tar.gz (Note: ntpdate rely on OpenSSL, need to compile OpenSSL)
2. Decompression
TAR-ZXF ntp-4.2.8p8.tar.gz
CD NTP-4.2.8P8
3. Add the "Mod_nano" macro definition at the end of the ntpd/ntp_loopfilter.c file
#ifndef Mod_nano
#define Mod_nano 0x2000
#endif
4. Generate Makefile Files
./configure--PREFIX=/USR/LOCAL/ARM/NTP--host=arm-hisiv100nptl-linux CC=ARM-HISIV100NPTL-LINUX-GCC-- With-yielding-select=yes--enable-openssl libs=-l/usr/local/arm/ssl/lib Cppflags=-i/usr/local/arm/ssl/include-- Exec-prefix=/usr/local/arm/ntp
Description: Prefix for the installation directory, host for the target Board cross-compile tool chain,--enable-openssl:ntpdate rely on Openssl,cppflags:openssl header files, Libs:openssl Library
5. Compile and install
Make
sudo make install
6. The compiled tool is located in the Bin folder of the installation directory and copies the required tools to the/usr/sbin directory of the ARM board
Problem rollup encountered:
1. Execute ntpdate ntp_server_ip, error:
No server suitable for synchronization found
Cause: The selected NTP time server is not appropriate and is rejected by the server
Solution: Choose a public NTP time server, such as us.ntp.org.cn