Arm-linux use Ntpdate to synchronize native time __linux

Source: Internet
Author: User
Tags openssl openssl library

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



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.