diff options
author | Andrey V.Kosteltsev <AKosteltsev@IBS.RU> | 2022-09-05 09:08:25 +0300 |
---|---|---|
committer | Andrey V.Kosteltsev <AKosteltsev@IBS.RU> | 2022-09-05 09:09:30 +0300 |
commit | 4db00b7c923c825f7602942015d1b92cfcc64071 (patch) | |
tree | 7a68e6f8ae9451427d4006773d9d8abe3efa2777 /meta-ibs/meta-common | |
parent | 07619638df84416095bc0c0c9411cf369eaab9f1 (diff) | |
download | openbmc-4db00b7c923c825f7602942015d1b92cfcc64071.tar.xz |
systemd patches for version 251.3
Diffstat (limited to 'meta-ibs/meta-common')
-rw-r--r-- | meta-ibs/meta-common/recipes-core/systemd/systemd/0001-Add-event-log-for-time-synchronization.patch (renamed from meta-ibs/meta-common/recipes-core/systemd/systemd/0001-Add-event-log-for-system-time-synchronization.patch) | 35 | ||||
-rw-r--r-- | meta-ibs/meta-common/recipes-core/systemd/systemd/0002-Add-additional-logs-for-timesyncd.patch | 13 | ||||
-rw-r--r-- | meta-ibs/meta-common/recipes-core/systemd/systemd_%.bbappend | 4 |
3 files changed, 27 insertions, 25 deletions
diff --git a/meta-ibs/meta-common/recipes-core/systemd/systemd/0001-Add-event-log-for-system-time-synchronization.patch b/meta-ibs/meta-common/recipes-core/systemd/systemd/0001-Add-event-log-for-time-synchronization.patch index a9c90de850..e17bf905c5 100644 --- a/meta-ibs/meta-common/recipes-core/systemd/systemd/0001-Add-event-log-for-system-time-synchronization.patch +++ b/meta-ibs/meta-common/recipes-core/systemd/systemd/0001-Add-event-log-for-time-synchronization.patch @@ -1,4 +1,4 @@ -From 5be7b53e598faa7605add3f9856d3b3eb4b50fe1 Mon Sep 17 00:00:00 2001 +From 6150e2c1d8442f91148181d2ee6d60dd5c8a4329 Mon Sep 17 00:00:00 2001 From: Joshi-Mansi <mansi.joshi@linux.intel.com> Date: Thu, 13 May 2021 03:09:24 +0530 Subject: [PATCH] Add event log for time synchronization @@ -12,13 +12,14 @@ Confirmed that the event is getting logged correctly in Redfish. Signed-off-by: Joshi-Mansi <mansi.joshi@linux.intel.com> Change-Id: I8901227990ee7bc41de30af13c775cc45016a626 +Signed-off-by: Andrey V.Kosteltsev <AKosteltsev@IBS.RU> --- src/timedate/timedated.c | 14 ++++++++++++++ src/timesync/timesyncd-manager.c | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c -index 66b454269d..67cc4e0020 100644 +index 9ca5d37b75..03d91b98c6 100644 --- a/src/timedate/timedated.c +++ b/src/timedate/timedated.c @@ -9,6 +9,7 @@ @@ -29,7 +30,7 @@ index 66b454269d..67cc4e0020 100644 #include "alloc-util.h" #include "bus-common-errors.h" -@@ -830,6 +831,8 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro +@@ -831,6 +832,8 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro struct timespec ts; usec_t start; struct tm tm; @@ -38,7 +39,7 @@ index 66b454269d..67cc4e0020 100644 assert(m); assert(c); -@@ -844,6 +847,9 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro +@@ -845,6 +848,9 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro if (context_ntp_service_is_active(c) > 0) return sd_bus_error_set(error, BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED, "Automatic time synchronization is enabled"); @@ -48,7 +49,7 @@ index 66b454269d..67cc4e0020 100644 /* this only gets used if dbus does not provide a timestamp */ start = now(CLOCK_MONOTONIC); -@@ -911,6 +917,14 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro +@@ -912,6 +918,14 @@ static int method_set_time(sd_bus_message *m, void *userdata, sd_bus_error *erro "REALTIME="USEC_FMT, timespec_load(&ts), LOG_MESSAGE("Changed local time to %s", strnull(format_timestamp(buf, sizeof(buf), timespec_load(&ts))))); @@ -64,7 +65,7 @@ index 66b454269d..67cc4e0020 100644 } diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c -index 918da195d8..24940c449b 100644 +index 9325523838..0d8831b2f7 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c @@ -11,6 +11,7 @@ @@ -72,19 +73,19 @@ index 918da195d8..24940c449b 100644 #include "sd-daemon.h" +#include "sd-journal.h" + #include "sd-messages.h" #include "alloc-util.h" - #include "dns-domain.h" -@@ -436,6 +437,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re +@@ -419,6 +420,8 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re + double origin, receive, trans, dest, delay, offset, root_distance; bool spike; - int leap_sec; - int r; + int leap_sec, r; + char olddate[FORMAT_TIMESTAMP_MAX]; + char newdate[FORMAT_TIMESTAMP_MAX]; assert(source); assert(m); -@@ -526,6 +529,9 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re +@@ -497,6 +500,9 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re return manager_connect(m); } @@ -94,10 +95,10 @@ index 918da195d8..24940c449b 100644 /* valid packet */ m->pending = false; m->retry_interval = 0; -@@ -628,6 +634,14 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re +@@ -612,6 +618,14 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re + + (void) server_address_pretty(m->current_server_address, &pretty); - server_address_pretty(m->current_server_address, &pretty); - /* "Initial", as further successful syncs will not be logged. */ + /* Log an event for NTP Synchronization from older date to newly synced date. */ + usec_t newtime = now(CLOCK_REALTIME); + format_timestamp(newdate, sizeof(newdate), newtime); @@ -106,9 +107,9 @@ index 918da195d8..24940c449b 100644 + "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.BMCTimeUpdatedViaNTP", + "REDFISH_MESSAGE_ARGS=%s,%s", newdate, olddate, NULL); + - log_info("Initial synchronization to time server %s (%s).", strna(pretty), m->current_server_name->string); - sd_notifyf(false, "STATUS=Initial synchronization to time server %s (%s).", strna(pretty), m->current_server_name->string); + log_info("Contacted time server %s (%s).", strna(pretty), m->current_server_name->string); + (void) sd_notifyf(false, "STATUS=Contacted time server %s (%s).", strna(pretty), m->current_server_name->string); } -- -2.33.0 +2.35.1 diff --git a/meta-ibs/meta-common/recipes-core/systemd/systemd/0002-Add-additional-logs-for-timesyncd.patch b/meta-ibs/meta-common/recipes-core/systemd/systemd/0002-Add-additional-logs-for-timesyncd.patch index 960805b95c..16cea17ddc 100644 --- a/meta-ibs/meta-common/recipes-core/systemd/systemd/0002-Add-additional-logs-for-timesyncd.patch +++ b/meta-ibs/meta-common/recipes-core/systemd/systemd/0002-Add-additional-logs-for-timesyncd.patch @@ -1,18 +1,19 @@ -From 932fa3e67c99a0aa99c6a6acc9ae7a3c7707d959 Mon Sep 17 00:00:00 2001 +From be48dc337f58da6dce12e61ebbdd2d97e11364ed Mon Sep 17 00:00:00 2001 From: Nikita Kosenkov <NKosenkov@IBS.RU> Date: Mon, 15 Aug 2022 09:32:25 +0300 Subject: [PATCH] Add additional logs for timesyncd +Signed-off-by: Andrey V.Kosteltsev <AKosteltsev@IBS.RU> --- src/timesync/timesyncd-manager.c | 7 +++++++ src/timesync/timesyncd.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c -index 24940c449b..59d15a896c 100644 +index 0d8831b2f7..25be16fdab 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c -@@ -92,6 +92,13 @@ static int manager_timeout(sd_event_source *source, usec_t usec, void *userdata) +@@ -96,6 +96,13 @@ static int manager_timeout(sd_event_source *source, usec_t usec, void *userdata) server_address_pretty(m->current_server_address, &pretty); log_info("Timed out waiting for reply from %s (%s).", strna(pretty), m->current_server_name->string); @@ -27,7 +28,7 @@ index 24940c449b..59d15a896c 100644 } diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c -index 6f316746f5..2f18c97dc2 100644 +index 999d1d3852..cd622f32fb 100644 --- a/src/timesync/timesyncd.c +++ b/src/timesync/timesyncd.c @@ -5,6 +5,7 @@ @@ -38,7 +39,7 @@ index 6f316746f5..2f18c97dc2 100644 #include "capability-util.h" #include "clock-util.h" -@@ -78,6 +79,11 @@ settime: +@@ -75,6 +76,11 @@ settime: log_info("System clock time unset or jumped backwards, restoring from recorded timestamp: %s", format_timestamp(date, sizeof(date), min)); @@ -47,7 +48,7 @@ index 6f316746f5..2f18c97dc2 100644 + "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.BMCTimeRestoringFromTimestamp", + "REDFISH_MESSAGE_ARGS=%s", format_timestamp(date, sizeof(date), min), NULL); + - if (clock_settime(CLOCK_REALTIME, timespec_store(&ts, min)) < 0) + if (clock_settime(CLOCK_REALTIME, TIMESPEC_STORE(min)) < 0) log_error_errno(errno, "Failed to restore system clock, ignoring: %m"); } -- diff --git a/meta-ibs/meta-common/recipes-core/systemd/systemd_%.bbappend b/meta-ibs/meta-common/recipes-core/systemd/systemd_%.bbappend index c1f3eeda1a..c96fcce15b 100644 --- a/meta-ibs/meta-common/recipes-core/systemd/systemd_%.bbappend +++ b/meta-ibs/meta-common/recipes-core/systemd/systemd_%.bbappend @@ -2,8 +2,8 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -SRC_URI += "file://0001-Add-event-log-for-system-time-synchronization.patch \ - file://0002-Add-additional-logs-for-timesyncd.patch \ +SRC_URI += "file://0001-Add-event-log-for-time-synchronization.patch \ + file://0002-Add-additional-logs-for-timesyncd.patch \ " # We don't support loadable modules in kernel config |