在petalinux上添加NTP守护程序



我已经在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配置。完整的答案似乎是:

  1. 找到project-spec/meta-user/conf/user-rootfsconfig并添加以下行:

    CONFIG_ntp

    CONFIG_ntpq

  2. 找到project-spec/meta-user/recipes-core/images/petalinux-image-full.bbappend并添加以下行:

    IMAGE_INSTALL_append = "ntp ntpq"

  3. 运行petalinux-config -c rootfs,导航到user packages部分。现在,您将看到ntpntpq作为单独的行项目。同时启用它们。

  4. 运行petalinux-build,您将看到NTP已下载并已编译。

相关内容

最新更新