Skip to content

Commit dc74827

Browse files
saiarcot895yanjundeng
authored andcommitted
Switch from ntpd to chrony (sonic-net#20497)
This replaces ntpd with Chrony, as described in sonic-net/SONiC#1852. The advantages of this (among others) is control over enabling/disabling long jumps/steps and guaranteed updates of the real time clock. This PR also includes a submodule update of sonic-utilities, to bring in necessary changes there for chrony to work. The changelog for sonic-utilities is: Submodule src/sonic-utilities ce51df2..7cbb2f2: > [sfputil] add support for sfputil debug tx-output/rx-output {port} enable/disable (sonic-net#3811) > Switch to using chrony instead of ntpd (sonic-net#3574) > Added post commands for enabling fifos (sonic-net#3801) > kdump-Remote-SSH-Configurations (sonic-net#3400) Signed-off-by: Saikrishna Arcot <[email protected]>
1 parent cfbbf58 commit dc74827

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+278
-539
lines changed

build_debian.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,10 @@ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install pigz
161161
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install busybox linux-base
162162
echo '[INFO] Install SONiC linux kernel image'
163163
## Note: duplicate apt-get command to ensure every line return zero
164-
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/initramfs-tools-core_*.deb || \
165-
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
166-
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/initramfs-tools_*.deb || \
167-
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
168-
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/linux-image-${LINUX_KERNEL_VERSION}-*_${CONFIGURED_ARCH}.deb || \
169-
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
164+
sudo cp $debs_path/initramfs-tools-core_*.deb $debs_path/initramfs-tools_*.deb $debs_path/linux-image-${LINUX_KERNEL_VERSION}-*_${CONFIGURED_ARCH}.deb $FILESYSTEM_ROOT
165+
basename_deb_packages=$(basename -a $debs_path/initramfs-tools-core_*.deb $debs_path/initramfs-tools_*.deb $debs_path/linux-image-${LINUX_KERNEL_VERSION}-*_${CONFIGURED_ARCH}.deb | sed 's,^,./,')
166+
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt -y install $basename_deb_packages
167+
( cd $FILESYSTEM_ROOT; sudo rm -f $basename_deb_packages )
170168
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install acl
171169
if [[ $CONFIGURED_ARCH == amd64 ]]; then
172170
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install hdparm
@@ -233,7 +231,6 @@ echo '[INFO] Install docker'
233231
## Install apparmor utils since they're missing and apparmor is enabled in the kernel
234232
## Otherwise Docker will fail to start
235233
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install apparmor
236-
sudo cp files/image_config/ntp/ntp-apparmor $FILESYSTEM_ROOT/etc/apparmor.d/local/usr.sbin.ntpd
237234
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install apt-transport-https \
238235
ca-certificates \
239236
curl
@@ -333,7 +330,6 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
333330
vim \
334331
tcpdump \
335332
dbus \
336-
ntpstat \
337333
openssh-server \
338334
python3-apt \
339335
traceroute \
@@ -434,7 +430,7 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
434430
picocom \
435431
systemd \
436432
systemd-sysv \
437-
ntp
433+
chrony
438434

439435
if [[ $TARGET_BOOTLOADER == grub ]]; then
440436
if [[ $CONFIGURED_ARCH == amd64 ]]; then

files/build_templates/dhcp_relay.service.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Requires=config-setup.service
44
After=config-setup.service swss.service syncd.service teamd.service
55
BindsTo=sonic.target
66
After=sonic.target
7-
Before=ntp-config.service
87
StartLimitIntervalSec=1200
98
StartLimitBurst=3
109

files/build_templates/gnmi.service.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Description=GNMI container
33
Requires=database.service
44
After=database.service swss.service syncd.service
5-
Before=ntp-config.service
65
BindsTo=sonic.target
76
After=sonic.target
87
StartLimitIntervalSec=1200

files/build_templates/lldp.service.j2

Lines changed: 0 additions & 1 deletion
This file was deleted.

files/build_templates/mgmt-framework.service.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Requires=database.service
44
After=database.service swss.service syncd.service
55
BindsTo=sonic.target
66
After=sonic.target
7-
Before=ntp-config.service
87

98
[Service]
109
User={{ sonicadmin_user }}

files/build_templates/nat.service.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Requires=config-setup.service
44
After=config-setup.service swss.service syncd.service
55
BindsTo=sonic.target
66
After=sonic.target
7-
Before=ntp-config.service
87
StartLimitIntervalSec=1200
98
StartLimitBurst=3
109

files/build_templates/p4rt.service.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Requires=database.service
44
After=database.service swss.service
55
BindsTo=sonic.target
66
After=sonic.target
7-
Before=ntp-config.service
87
StartLimitIntervalSec=1200
98
StartLimitBurst=3
109

files/build_templates/per_namespace/bgp.service.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Requires=config-setup.service
66
After=config-setup.service
77
BindsTo=sonic.target
88
After=sonic.target
9-
Before=ntp-config.service
109
After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service
1110
After=interfaces-config.service
1211
StartLimitIntervalSec=1200

files/build_templates/per_namespace/gbsyncd.service.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ After=interfaces-config.service
77
After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service
88
BindsTo=sonic.target
99
After=sonic.target
10-
Before=ntp-config.service
1110

1211
[Service]
1312
User=root

files/build_templates/per_namespace/lldp.service.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ BindsTo=sonic.target
1010
After=sonic.target
1111
BindsTo=sonic.target
1212
After=sonic.target
13-
Before=ntp-config.service
1413
StartLimitIntervalSec=1200
1514
StartLimitBurst=3
1615

0 commit comments

Comments
 (0)