cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sigvarth
Visitor
Visitor
3,937 Views
Registered: ‎05-02-2018

Adding NTP deamon to petalinux

Jump to solution

Any suggestions on how to add NTP deamon to petalinux, I've tried to add the bitbake recipe from here https://layers.openembedded.org/layerindex/recipe/2299/

but it doesn't show up in petalinux-config -c rootfs or kernel. I don't get what I'm doing wrong. Like it looks like the kernel has ntp support from https://github.com/Xilinx/linux-xlnx/blob/master/kernel/time/ntp.c

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
aravindb
Moderator
Moderator
4,129 Views
Registered: ‎02-07-2018

Hi,

 

Please follow below steps to add ntp as a part of your rootfs.

 

vim project-spec/meta-user/recipes-core/images/petalinux-image.bbappend

add below line
IMAGE_INSTALL_append = " ntp"

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

petalinux-build

 

Thanks & regards

Aravind

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

View solution in original post

7 Replies
aravindb
Moderator
Moderator
4,130 Views
Registered: ‎02-07-2018

Hi,

 

Please follow below steps to add ntp as a part of your rootfs.

 

vim project-spec/meta-user/recipes-core/images/petalinux-image.bbappend

add below line
IMAGE_INSTALL_append = " ntp"

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

petalinux-build

 

Thanks & regards

Aravind

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

View solution in original post

sigvarth
Visitor
Visitor
3,867 Views
Registered: ‎05-02-2018

Thank you so much. This worked and NTP deamon is now available in petalinux :)

0 Kudos
shustik
Observer
Observer
2,911 Views
Registered: ‎07-14-2017

Than you very much for your answer!

But I can't understand 2 moments:

1. I would like to use ntpq, but I don't get it together with ntpd. Is it possible to correct it?

2. I can't change server list in /etc/ntp.conf. I created my config file in rootfs/etc/ntp.conf (SD card), but when petalinux starts, I see default configuration at /etc/ntp.conf. What to do?

0 Kudos
cbureriu
Visitor
Visitor
1,692 Views
Registered: ‎08-04-2019

in Petalinux 2020 it is a little different. You need to edit the file:

<project_name>/project-spec/meta-user/conf

adding the line(s):

CONFIG_ntp

(or CONFIG_<whatever-package>)

then the package to be enabled should show up in:

petalinux-config -c rootfs -> user apps

0 Kudos
WilliamMarchant
Visitor
Visitor
718 Views
Registered: ‎01-07-2021

Could you explain the "user packages --> [*] ntp" step, please?

0 Kudos
vanmierlo
Mentor
Mentor
641 Views
Registered: ‎06-10-2008

Did you type the following?

petalinux-config -c rootfs
WilliamMarchant
Visitor
Visitor
629 Views
Registered: ‎01-07-2021

Thank you!  That makes sense now.

My board now boots and sets the correct date and an approximate time.  It's about 8 minutes slow.  I waited more than five minutes but the daemon doesn't appear to be slewing the clock.  I assume the /etc/ntp.conf file needs to be updated. 

After some searching I was able to edit ~/petalinux/pltools/components/yocto/source/aarch64/layers/meta-networking/recipes-support/ntp/ntp/ntp.conf and, after a petalinux-build and petalinux-package cycle, that edited ntp.conf showed up in the booted system at /etc/ntp.conf.  The system successfully updated its time after the five minute NTP cycle.  So I think I'm past this hurdle.  Thanks for the help!

0 Kudos