ARM移植ntp

移植openssl:
版本:openssl-1.1.0
Openss(openssl-1.1.0i.tar.gz)下载地址:https://www.openssl.org/source/
参考:https://blog.csdn.net/miaodichiyou/article/details/50385049
补充:

  1. Makefile中CC/AR等路径引用是通过CROSS_COMPILE前缀索引的,所以只要设置CROSS_COMPILE的值为你的交叉编译器前缀即可,如:”arm-none-linux-gnueabi-“
  2. 要删掉CFLAGS中-m32选项,(我的)交叉编译器没有此选项。
  3. Make install后,到安装目录的bin目录下,看到有openssl和c_rehash两个可执行文件,我们执行下./openssl,如果提示文件格式错误,说明设置的交叉编译器起作用了,再把openssl复制到目标板上,加上权限,运行下,如果进入openssl命令行下,说明openssl移植就ok了。
    使用:把lib目录下的libcrypto.*和libssl.*文件复制到目标板用户库文件位置,确保上电后应用程序可以访问到。
    注:
  4. 通过apt-get sourse获取的源码,编译成so文件后,在编译ntp时一直出错(libcrypto不兼容、dlopen等函数未声明等各种问题,后来用上面这个源码一次就成功了)
  5. 编译器相关配置更改后,在make之前先make clean,避免出现新旧两种平台目标文件重叠,从而ld命令提示文件格式错误之类提示。

移植ntp:
版本:ntp-4.2.8p12
ntp(Ntp-4.2.8p12.tar.gz)下载地址:http://www.ntp.org/downloads.html
参考1:https://blog.csdn.net/xcl113/article/details/53394617/
参考2:https://blog.csdn.net/u013485792/article/details/51154583
补充:

  1. Configure命令来自参考1;MOD_NANO定义来自参考2;
  2. 我的配置命令:
    我的配置命令其中,”—with-yielding-select=yes”、”—host=”选项不能少,”–with-openssl-incdir/libdir”必选(指明依赖的openssl库所在位置)
  3. 执行完configure命令后,打开Makefile文件确认下CC等是否编程我们期待的交叉编译器路径。
    使用:将ntpdate目录下的ntpdate文件复制到目标板上并添加执行权限,确保上面的openssl库文件已经存在且ntp server服务已开启!执行”ntpdate ntp-server-ip”命令,观察运行结果。
    正常运行结果:
    缺少openssl的运行结果
    缺少openssl的执行结果:
    正常执行结果

注:
1.在Ubuntu14.04上运行ntpdate命令,从局域网内电脑ntp server获取时间时,提示:
“no server suitable for synchronization found debian”
google以后,看到的解决方法都没能解决,大多数提到的都是下面这种错误(https://askubuntu.com/questions/429306/ntpdate-no-server-suitable-for-synchronization-found):
“ntpdate -d Server dropped Strata too high"关于strata这个值的设定,然而,最后才发现是ntp server上的w32time服务没有启动。
2.在arm板上运行ntpdate命令,对应的提示为:” no server suitable for synchronization found”
3.此版本ntp不能用openssl-0.9.8,编译时会提示"NID_cmac undeclared”,在https://github.com/openssl/openssl/blob/master/include/openssl/evp.h发现是老版本的openssl的evp.h中缺少对NIC_cmac的宏定义,暂时不能用!

猜你喜欢

转载自blog.csdn.net/yanlutian/article/details/82912998
今日推荐