100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > linux ntpdate交叉编译 ARM-Linux使用ntpdate同步本机时间

linux ntpdate交叉编译 ARM-Linux使用ntpdate同步本机时间

时间:2020-11-12 01:27:59

相关推荐

linux ntpdate交叉编译 ARM-Linux使用ntpdate同步本机时间

1. 下载ntp-4.2.8p8.tar.gz(注:ntpdate依赖openssl,需现编译openssl)

2. 解压

tar -zxfntp-4.2.8p8.tar.gz

cdntp-4.2.8p8

3. 在ntpd/ntp_loopfilter.c文件末尾增加"MOD_NANO"宏定义

#ifndefMOD_NANO

#defineMOD_NANO 0x2000

#endif

4. 生成makefile文件

./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

说明:prefix为安装目录,host为目标板交叉编译工具链,--enable-openssl:ntpdate依赖openssl,CPPFLAGS:openssl头文件,LIBS:openssl库

5. 编译并安装

make

sudo make install

6. 编译好的工具位于安装目录的bin文件夹中,拷贝需要的工具到arm板的/usr/sbin目录中

遇到问题汇总:

1. 执行ntpdate ntp_server_IP,报错:

no server suitable for synchronization found

原因:选择的ntp时间服务器不合适,被服务器拒绝

解决方案: 选择公开的ntp时间服务器,如.cn

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。