Skip to contentSkip to conversation

systemd: enable resolved and add clock synchronization service

PATCH New Denys Dmytriyenko 1 participant 1 message Jun 2, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: enable resolved and add clock synchronization service

From: Denys Dmytriyenko <[email protected]>

---
 .../recipes-core/systemd/systemd/sync-clocks.service     | 16 ++++++++++++++++
 .../recipes-core/systemd/systemd_%.bbappend              | 15 ++++++++++-----
 2 files changed, 26 insertions(+), 5 deletions(-)
 create mode 100644 meta-arago-distro/recipes-core/systemd/systemd/sync-clocks.service
meta-arago-distro/recipes-core/systemd/systemd/sync-clocks.service new file +16 -0
new file mode 100644
index 0000000..3d506a3
@@ -0,0 +1,16 @@
+[Unit]
+Description=Synchronize System and HW clocks
+DefaultDependencies=no
+Wants=sysinit.target
+Conflicts=shutdown.target
+After=systemd-timesyncd.service
+Before=sysinit.target shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/sbin/hwclock --systohc
+StandardOutput=syslog
+
+[Install]
+WantedBy=sysinit.target
meta-arago-distro/recipes-core/systemd/systemd_%.bbappend +10 -5
index ca67eee..123d1ad 100644
@@ -1,9 +1,10 @@
-PR_append = ".arago2"
+PR_append = ".arago3"
 
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 
-PACKAGECONFIG_append = " networkd"
+PACKAGECONFIG_append = " networkd resolved"
 USERADD_PARAM_${PN} += "--system -d / -M --shell /bin/nologin systemd-network;"
+USERADD_PARAM_${PN} += "--system -d / -M --shell /bin/nologin systemd-resolve;"
 
 SRC_URI_append = " \
     file://local.rules \
@@ -12,6 +13,7 @@ SRC_URI_append = " \
     file://10-eth.network \
     file://30-wlan.network \
     file://60-usb.network \
+    file://sync-clocks.service \
 "
 
 do_install_append() {
@@ -19,16 +21,19 @@ do_install_append() {
     install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/
 
     install -d ${D}${sysconfdir}/udev/scripts/
-    install -m 0755 ${WORKDIR}/usb1-rules.sh ${D}${sysconfdir}/udev/scripts/usb1-rules.sh
-    install -m 0755 ${WORKDIR}/usb2-rules.sh ${D}${sysconfdir}/udev/scripts/usb2-rules.sh
+    install -m 0755 ${WORKDIR}/usb1-rules.sh ${D}${sysconfdir}/udev/scripts/
+    install -m 0755 ${WORKDIR}/usb2-rules.sh ${D}${sysconfdir}/udev/scripts/
 
     install -d ${D}${sysconfdir}/systemd/network/
     install -m 0644 ${WORKDIR}/10-eth.network ${D}${sysconfdir}/systemd/network/
     install -m 0644 ${WORKDIR}/30-wlan.network ${D}${sysconfdir}/systemd/network/
     install -m 0644 ${WORKDIR}/60-usb.network ${D}${sysconfdir}/systemd/network/
 
-    # Allow automount from udev
     install -d ${D}${sysconfdir}/systemd/system/
+    install -m 0644 ${WORKDIR}/sync-clocks.service ${D}${sysconfdir}/systemd/system/
+    ln -sf ../sync-clocks.service ${D}${sysconfdir}/systemd/system/sysinit.target.wants/sync-clocks.service
+
+    # Allow automount from udev
     install -m 0644 ${D}${systemd_system_unitdir}/systemd-udevd.service ${D}${sysconfdir}/systemd/system/
     sed -i 's/MountFlags=slave/MountFlags=shared/g' ${D}${sysconfdir}/systemd/system/systemd-udevd.service
 
Signature · 1 line
2.2.0