diff options
author | James Thomas <james.thomas@codethink.co.uk> | 2012-09-18 12:46:14 +0000 |
---|---|---|
committer | James Thomas <james.thomas@codethink.co.uk> | 2012-09-18 12:46:14 +0000 |
commit | 9e833f5f2646a2ffb4d897e4dce0524b47060c67 (patch) | |
tree | 8daceafebf4784de5cc276e7005294cd0c003337 | |
parent | e37343389d21c840d8251d7896322248b9b661d2 (diff) | |
download | busybox-baserock/radiofree/ntpdscript.tar.gz |
Add a systemd unit for ntpdbaserock/radiofree/ntpdscript
Update morph file to copy service/script to correct locations
The service will be started with the multi-user.target
-rw-r--r-- | busybox.morph | 7 | ||||
-rw-r--r-- | systemd-units/ntpd.service.in | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/busybox.morph b/busybox.morph index a27a2ebe7..cc65d4400 100644 --- a/busybox.morph +++ b/busybox.morph @@ -47,15 +47,20 @@ ], "build-commands": [ "for f in systemd-units/ifup@.service; do sed -e 's|@rootprefix@||g' \"$f.in\" >\"$f\"; done", + "for f in systemd-units/ntpd.service; do sed -e 's|@userprefix@|/usr|g' \"$f.in\" >\"$f\"; done", "make" ], "install-commands": [ "if [ \"$PREFIX\" = /usr ]; then PREFIX=; fi && make CONFIG_PREFIX=\"$DESTDIR$PREFIX\" install && chmod 6755 \"$DESTDIR$PREFIX\"/bin/busybox", "mkdir -p \"$DESTDIR/lib/systemd/system/\"", "for f in systemd-units/ifup@.service; do install -m 644 \"$f\" \"$DESTDIR/lib/systemd/system\"; done", + "for f in systemd-units/ntpd.service; do install -m 644 \"$f\" \"$DESTDIR/lib/systemd/system\"; done", "mkdir -p \"$DESTDIR/lib/udev/rules.d\"", "for f in udev-rules/100-baserock.rules; do install -m 644 \"$f\" \"$DESTDIR/lib/udev/rules.d\"; done", "mkdir -p \"$DESTDIR$PREFIX\"/share/udhcpc", - "cp examples/udhcp/simple.script \"$DESTDIR$PREFIX\"/share/udhcpc/default.script" + "mkdir -p \"$DESTDIR/etc/systemd/system/multi-user.target.wants\"", + "ln -s $DESTDIR/lib/systemd/system/ntpd.service $DESTDIR/etc/systemd/system/multi-user.target.wants", + "cp examples/udhcp/simple.script \"$DESTDIR$PREFIX\"/share/udhcpc/default.script", + "cp scripts/ntpd-set.sh \"$DESTDIR$PREFIX\"/bin/ntpd-set.sh && chmod 6755 \"$DESTDIR$PREFIX\"/bin/ntpd-set.sh" ] } diff --git a/systemd-units/ntpd.service.in b/systemd-units/ntpd.service.in new file mode 100644 index 000000000..1abc4f3a7 --- /dev/null +++ b/systemd-units/ntpd.service.in @@ -0,0 +1,6 @@ +[Unit] +Description=Service to use ntpd to set the date and time + +[Service] +ExecStart=/usr/bin/ntpd-set.sh +RemainAfterExit=true |