Skip to content

Commit 65a1a8e

Browse files
authored
feat!: remove ntpd-based clock service implementation (#5790)
* feat!: remove ntpd-based clock service implementation * style: fix copyright header * feat: remove dependency on ntpdate * feat: remove ntpd from drop-down selector * style: fix whitespaces * style: retab * docs: fix ntpd reference in metatype * fix: NPE when NTPD is selected
1 parent c95efe1 commit 65a1a8e

9 files changed

Lines changed: 64 additions & 218 deletions

File tree

kura/distrib/src/main/resources/aarch64-nn/deb/control/control

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2023, 2024 Eurotech and/or its affiliates and others
2+
# Copyright (c) 2023, 2025 Eurotech and/or its affiliates and others
33
#
44
# This program and the accompanying materials are made
55
# available under the terms of the Eclipse Public License 2.0
@@ -18,7 +18,7 @@ Depends: openjdk-17-jre-headless | temurin-17-jdk,
1818
setserial, zip, gzip, unzip, procps, usbutils, socat, gawk, sed, inetutils-telnet,
1919
polkit | policykit-1, ssh | openssh, openssl, busybox, openvpn,
2020
bluez | bluez5, bluez-hcidump | bluez5-noinst-tools,
21-
ntpdate, chrony, chronyc | chrony, cron | cronie, logrotate, gpsd, python3
21+
chrony, chronyc | chrony, cron | cronie, logrotate, gpsd, python3
2222
Architecture: arm64
2323
Maintainer: Eclipse Kura Developers <kura-dev@eclipse.org>
2424
Homepage: https://eclipse-kura.github.io/kura/
@@ -27,4 +27,4 @@ Description: Open-source IoT edge framework based on Java/OSGi
2727
between the operating system and the customer application, with industry
2828
standard interfaces that shorten custom development time, simplified coding
2929
and software that can be easily ported from one hardware platform
30-
to another.
30+
to another.

kura/distrib/src/main/resources/aarch64/deb/control/control

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2023, 2024 Eurotech and/or its affiliates and others
2+
# Copyright (c) 2023, 2025 Eurotech and/or its affiliates and others
33
#
44
# This program and the accompanying materials are made
55
# available under the terms of the Eclipse Public License 2.0
@@ -18,7 +18,7 @@ Depends: openjdk-17-jre-headless | temurin-17-jdk,
1818
setserial, zip, gzip, unzip, procps, usbutils, socat, gawk, sed, inetutils-telnet,
1919
polkit | policykit-1, ssh | openssh, openssl, busybox, openvpn,
2020
bluez | bluez5, bluez-hcidump | bluez5-noinst-tools,
21-
ntpdate, chrony, chronyc | chrony, cron | cronie,
21+
chrony, chronyc | chrony, cron | cronie,
2222
network-manager | networkmanager, bind9 | bind, dnsmasq | isc-dhcp-server, isc-dhcp-client | dhcpcd, iw, iptables, modemmanager,
2323
logrotate, gpsd, python3
2424
Architecture: arm64
@@ -29,4 +29,4 @@ Description: Open-source IoT edge framework based on Java/OSGi
2929
between the operating system and the customer application, with industry
3030
standard interfaces that shorten custom development time, simplified coding
3131
and software that can be easily ported from one hardware platform
32-
to another.
32+
to another.

kura/distrib/src/main/resources/docker-x86_64-nn/deb/control/control

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2024 Eurotech and/or its affiliates and others
2+
# Copyright (c) 2025 Eurotech and/or its affiliates and others
33
#
44
# This program and the accompanying materials are made
55
# available under the terms of the Eclipse Public License 2.0
@@ -14,9 +14,9 @@ Package: kura-nn
1414
Version: [[project.version]]
1515
Section: admin
1616
Priority: optional
17-
Depends: dos2unix, unzip,
18-
telnet, bluez-hcidump,
19-
bluez, chrony, ntpdate,
17+
Depends: dos2unix, unzip,
18+
telnet, bluez-hcidump,
19+
bluez, chrony,
2020
openjdk-17-jre-headless | temurin-17-jdk,
2121
cron
2222
Architecture: amd64

kura/distrib/src/main/resources/x86_64-nn/deb/control/control

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2023, 2024 Eurotech and/or its affiliates and others
2+
# Copyright (c) 2023, 2025 Eurotech and/or its affiliates and others
33
#
44
# This program and the accompanying materials are made
55
# available under the terms of the Eclipse Public License 2.0
@@ -18,7 +18,7 @@ Depends: openjdk-17-jre-headless | temurin-17-jdk,
1818
setserial, zip, gzip, unzip, procps, usbutils, socat, gawk, sed, inetutils-telnet,
1919
polkit | policykit-1, ssh | openssh, openssl, busybox, openvpn,
2020
bluez | bluez5, bluez-hcidump | bluez5-noinst-tools,
21-
ntpdate, chrony, chronyc | chrony, cron | cronie, logrotate, gpsd, python3
21+
chrony, chronyc | chrony, cron | cronie, logrotate, gpsd, python3
2222
Architecture: amd64
2323
Maintainer: Eclipse Kura Developers <kura-dev@eclipse.org>
2424
Homepage: https://eclipse-kura.github.io/kura/
@@ -27,4 +27,4 @@ Description: Open-source IoT edge framework based on Java/OSGi
2727
between the operating system and the customer application, with industry
2828
standard interfaces that shorten custom development time, simplified coding
2929
and software that can be easily ported from one hardware platform
30-
to another.
30+
to another.

kura/distrib/src/main/resources/x86_64/deb/control/control

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2023, 2024 Eurotech and/or its affiliates and others
2+
# Copyright (c) 2023, 2025 Eurotech and/or its affiliates and others
33
#
44
# This program and the accompanying materials are made
55
# available under the terms of the Eclipse Public License 2.0
@@ -18,7 +18,7 @@ Depends: openjdk-17-jre-headless | temurin-17-jdk,
1818
setserial, zip, gzip, unzip, procps, usbutils, socat, gawk, sed, inetutils-telnet,
1919
polkit | policykit-1, ssh | openssh, openssl, busybox, openvpn,
2020
bluez | bluez5, bluez-hcidump | bluez5-noinst-tools,
21-
ntpdate, chrony, chronyc | chrony, cron | cronie,
21+
chrony, chronyc | chrony, cron | cronie,
2222
network-manager | networkmanager, bind9 | bind, dnsmasq | isc-dhcp-server, isc-dhcp-client | dhcpcd, iw, iptables, modemmanager,
2323
logrotate, gpsd, python3
2424
Architecture: amd64
@@ -29,4 +29,4 @@ Description: Open-source IoT edge framework based on Java/OSGi
2929
between the operating system and the customer application, with industry
3030
standard interfaces that shorten custom development time, simplified coding
3131
and software that can be easily ported from one hardware platform
32-
to another.
32+
to another.

kura/org.eclipse.kura.linux.clock/OSGI-INF/metatype/org.eclipse.kura.clock.ClockService.xml

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,121 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright (c) 2011, 2020 Eurotech and/or its affiliates and others
5-
4+
Copyright (c) 2011, 2025 Eurotech and/or its affiliates and others
5+
66
This program and the accompanying materials are made
77
available under the terms of the Eclipse Public License 2.0
88
which is available at https://www.eclipse.org/legal/epl-2.0/
9-
10-
SPDX-License-Identifier: EPL-2.0
11-
12-
Contributors:
13-
Eurotech
9+
10+
SPDX-License-Identifier: EPL-2.0
11+
12+
Contributors:
13+
Eurotech
1414
1515
-->
1616
<MetaData xmlns="http://www.osgi.org/xmlns/metatype/v1.2.0" localization="en_us">
17-
<OCD id="org.eclipse.kura.clock.ClockService"
18-
name="ClockService"
17+
<OCD id="org.eclipse.kura.clock.ClockService"
18+
name="ClockService"
1919
description="ClockService Configuration">
20-
20+
2121
<Icon resource="ClockService" size="32"/>
22-
23-
<AD id="enabled"
22+
23+
<AD id="enabled"
2424
name="enabled"
2525
type="Boolean"
2626
cardinality="0"
2727
required="true"
2828
default="true"
2929
description="Whether or not to enable the ClockService"/>
30-
31-
<AD id="clock.set.hwclock"
30+
31+
<AD id="clock.set.hwclock"
3232
name="clock.set.hwclock"
3333
type="Boolean"
34-
cardinality="0"
34+
cardinality="0"
3535
required="true"
36-
default="true"
36+
default="true"
3737
description="Whether or not to sync the system hardware clock after the system time gets set"/>
38-
39-
<AD id="clock.provider"
38+
39+
<AD id="clock.provider"
4040
name="clock.provider"
4141
type="String"
42-
cardinality="0"
42+
cardinality="0"
4343
required="true"
44-
default="java-ntp"
44+
default="java-ntp"
4545
description="Source for setting the system clock. Verify the availabiliy of the selected provider before activate it. Using chrony-advanced causes all fields, except Chrony Configuration, to be ignored.">
4646

4747
<Option label="java-ntp" value="java-ntp"/>
48-
<Option label="ntpd" value="ntpd"/>
4948
<Option label="chrony-advanced" value="chrony-advanced"/>
5049
</AD>
5150

52-
<AD id="clock.ntp.host"
51+
<AD id="clock.ntp.host"
5352
name="clock.ntp.host"
5453
type="String"
55-
cardinality="0"
54+
cardinality="0"
5655
required="true"
57-
default="0.pool.ntp.org"
56+
default="0.pool.ntp.org"
5857
description="The hostname that provides the system time via NTP"/>
5958

60-
<AD id="clock.ntp.port"
59+
<AD id="clock.ntp.port"
6160
name="clock.ntp.port"
6261
type="Integer"
63-
cardinality="0"
62+
cardinality="0"
6463
required="true"
6564
min="1"
6665
max="65535"
67-
default="123"
68-
description="The port number that provides the system time via NTP (not supported by ntpd, use the port 123 in that case)"/>
66+
default="123"
67+
description="The port number that provides the system time via NTP"/>
6968

70-
<AD id="clock.ntp.timeout"
69+
<AD id="clock.ntp.timeout"
7170
name="clock.ntp.timeout"
7271
type="Integer"
73-
cardinality="0"
72+
cardinality="0"
7473
required="true"
7574
min="1000"
76-
default="10000"
75+
default="10000"
7776
description="The NTP timeout in milliseconds"/>
7877

79-
<AD id="clock.ntp.max-retry"
78+
<AD id="clock.ntp.max-retry"
8079
name="clock.ntp.max-retry"
8180
type="Integer"
82-
cardinality="0"
81+
cardinality="0"
8382
required="true"
8483
min="0"
85-
default="0"
84+
default="0"
8685
description="The maximum number of retries for the initial synchronization (with interval clock.ntp.retry.interval). If set to 0 the service will retry forever."/>
8786

88-
<AD id="clock.ntp.retry.interval"
87+
<AD id="clock.ntp.retry.interval"
8988
name="clock.ntp.retry.interval"
9089
type="Integer"
91-
cardinality="0"
90+
cardinality="0"
9291
required="true"
9392
min="1"
94-
default="5"
93+
default="5"
9594
description="When sync fails, interval in seconds between each retry."/>
9695

97-
<AD id="clock.ntp.refresh-interval"
96+
<AD id="clock.ntp.refresh-interval"
9897
name="clock.ntp.refresh-interval"
9998
type="Integer"
100-
cardinality="0"
99+
cardinality="0"
101100
required="true"
102-
default="3600"
101+
default="3600"
103102
description="Whether or not to sync the clock and if so, the frequency in seconds. If less than zero - no update, if equal to zero - sync once at startup, if greater than zero - the frequency in seconds to perform a new clock sync"/>
104-
105-
<AD id="rtc.filename"
103+
104+
<AD id="rtc.filename"
106105
name="RTC File Name"
107106
type="String"
108-
cardinality="0"
107+
cardinality="0"
109108
required="true"
110-
default="/dev/rtc0"
109+
default="/dev/rtc0"
111110
description="The RTC File Name. It defaults to /dev/rtc0. This option is not used if chrony-advanced option is selected in clock.provider."/>
112-
111+
113112
<AD id="chrony.advanced.config"
114113
name="Chrony Configuration"
115114
type="String"
116115
cardinality="0"
117116
required="false"
118117
description="Chrony configuration file. All fields above will be ignored.|TextArea" />
119-
118+
120119
</OCD>
121120
<Designate pid="org.eclipse.kura.clock.ClockService">
122121
<Object ocdref="org.eclipse.kura.clock.ClockService"/>

kura/org.eclipse.kura.linux.clock/src/main/java/org/eclipse/kura/linux/clock/ClockServiceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2011, 2021 Eurotech and/or its affiliates and others
2+
* Copyright (c) 2011, 2025 Eurotech and/or its affiliates and others
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -172,8 +172,8 @@ private void startClockSyncProvider() throws KuraException {
172172
this.provider = new JavaNtpClockSyncProvider();
173173
break;
174174
case NTPD:
175-
this.provider = new NtpdClockSyncProvider(this.executorService);
176-
break;
175+
logger.error("NTPD clock provider is not supported anymore. Use JAVA_NTP or CHRONY_ADVANCED instead.");
176+
return;
177177
case CHRONY_ADVANCED:
178178
this.provider = new ChronyClockSyncProvider(this.executorService, this.cryptoService);
179179
break;

kura/org.eclipse.kura.linux.clock/src/main/java/org/eclipse/kura/linux/clock/NtpdClockSyncProvider.java

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)