summaryrefslogtreecommitdiff
path: root/update-rtc-with-system-clock-when-shutdown.patch
blob: ba4dff64b5c2258e103eb849d97a4794b3e90bd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From a13f14c6a2da55b9f797b6f33449ba523c07dd46 Mon Sep 17 00:00:00 2001
From: update-rtc-with-system-clock-when-shutdown
Date: Sat, 2 Feb 2019 02:54:52 -0500
Subject: [PATCH] Module: modification summary
---
 units/hwclock-save.service.in | 19 +++++++++++++++++++
 units/meson.build             |  4 ++++
 2 files changed, 23 insertions(+)
 create mode 100644 units/hwclock-save.service.in

diff --git a/units/hwclock-save.service.in b/units/hwclock-save.service.in
new file mode 100644
index 0000000..db33418
--- /dev/null
+++ b/units/hwclock-save.service.in
@@ -0,0 +1,19 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it+
+#  under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Update RTC With System Clock
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/true
+ExecStop=/sbin/hwclock --systohc
+RemainAfterExit=yes
+
+[Install]
+WantedBy=default.target
+
diff --git a/units/meson.build b/units/meson.build
index e7bfb7f..159d337 100644
--- a/units/meson.build
+++ b/units/meson.build
@@ -653,6 +653,10 @@ units = [
           'file' : 'systemd-update-done.service.in',
           'symlinks' : ['sysinit.target.wants/'],
         },
+        {
+          'file' : 'hwclock-save.service.in',
+          'symlinks' : ['sysinit.target.wants/'],
+        },
         {
           'file' : 'systemd-update-utmp-runlevel.service.in',
           'conditions' : ['ENABLE_UTMP', 'HAVE_SYSV_COMPAT'],
-- 
2.33.0