我已经在petalinux上添加了ntp守护进程,但我没有得到ntpq命令。有人能指导我吗,我如何在petalinux上添加/使用ntpq文件。
ntpq作为一个单独的包存在,需要在构建中显式调用它。
打开项目规范/meta-user/precipes-core/images/petalinux-image.bappend
(文件名可能因您使用的petalinux版本而异(
添加此行
IMAGE_INSTALL_append="ntpq";
petalinux config-c rootfs
用户包-->[*]ntpq
petalinux构建
有关如何使用ntpq,请参阅手册页或ntpq-help。
我遇到了类似的问题,但提供的答案不足以获得rootfs
配置。完整的答案似乎是:
-
找到
project-spec/meta-user/conf/user-rootfsconfig
并添加以下行:CONFIG_ntp
CONFIG_ntpq
-
找到
project-spec/meta-user/recipes-core/images/petalinux-image-full.bbappend
并添加以下行:IMAGE_INSTALL_append = "ntp ntpq"
-
运行
petalinux-config -c rootfs
,导航到user packages
部分。现在,您将看到ntp
和ntpq
作为单独的行项目。同时启用它们。 -
运行
petalinux-build
,您将看到NTP已下载并已编译。