Adding NTP daemon on petalinux

1.2k Views Asked by At

I have added the ntp daemon on petalinux, but i am not getting ntpq command. Can someone guide me, how can I add/use the ntpq file on petalinux.

2

There are 2 best solutions below

0
On

ntpq exists as a separate package and requires that you explicitly call it out in your build.

open project-spec/meta-user/recipes-core/images/petalinux-image.bbappend
(filename may vary based on version of Petalinux you are using)

add this line
IMAGE_INSTALL_append = " ntpq"

petalinux-config -c rootfs
user packages --> [*] ntpq

petalinux-build

For how to use ntpq refer to the man pages or ntpq --help.

0
On

I got here from having a similar issue however the answer provided was insufficient for getting the rootfs configuration. The full answer seems to be:

  1. Locate project-spec/meta-user/conf/user-rootfsconfig and add the following lines:

    CONFIG_ntp

    CONFIG_ntpq

  2. Locate project-spec/meta-user/recipes-core/images/petalinux-image-full.bbappend and add the following line:

    IMAGE_INSTALL_append = "ntp ntpq"

  3. Run petalinux-config -c rootfs, navigate to the user packages section. You will now see ntp and ntpq as separate line items. Enable them both.

  4. Run petalinux-build and you'll see NTP downloaded and compiled.