summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2012-07-29 21:20:25 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-08-24 11:53:34 +0200
commit5a167af30fd0c3db9d92613bd68820c6716eff5b (patch)
tree1a15891a41f14ead90d8f299271326fd8f5c4d91
parent7eb5bf20e497b283541b79b77846f2945a08e2db (diff)
downloadptxdist-5a167af30fd0c3db9d92613bd68820c6716eff5b.tar.gz
ptxdist-5a167af30fd0c3db9d92613bd68820c6716eff5b.tar.xz
rc-one: use systemd system-update mechanism
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--generic/lib/systemd/system/rc-once.target8
-rw-r--r--generic/lib/systemd/systemd-rc-once4
-rw-r--r--rules/rc-once.make5
-rw-r--r--rules/rc-once.postinst4
4 files changed, 6 insertions, 15 deletions
diff --git a/generic/lib/systemd/system/rc-once.target b/generic/lib/systemd/system/rc-once.target
deleted file mode 100644
index 89f18c2ee..000000000
--- a/generic/lib/systemd/system/rc-once.target
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=System setup
-DefaultDependencies=no
-After=rc-once.service
-Requires=rc-once.service
-
-[Install]
-Alias=default.target
diff --git a/generic/lib/systemd/systemd-rc-once b/generic/lib/systemd/systemd-rc-once
index 5ecc5e5a3..42a9e04c0 100644
--- a/generic/lib/systemd/systemd-rc-once
+++ b/generic/lib/systemd/systemd-rc-once
@@ -6,7 +6,7 @@
start() {
mount_root_rw || exit 1
if run_rc_once; then
- systemctl disable --quiet rc-once.target
+ rm -f /system-update
fi
systemctl daemon-reexec
sleep 1
@@ -17,7 +17,7 @@ umount() {
if ! mount_root_restore; then
# remounting rw/ro during the second boot will flush anything
# left in the filesystem journal
- systemctl enable --quiet rc-once.target
+ ln -sf /etc/rc.once.d /system-update
systemctl reboot
else
systemctl default
diff --git a/rules/rc-once.make b/rules/rc-once.make
index f01bbe9d8..aaed7443b 100644
--- a/rules/rc-once.make
+++ b/rules/rc-once.make
@@ -48,9 +48,8 @@ ifdef PTXCONF_INITMETHOD_SYSTEMD
@$(call install_alternative, rc-once, 0, 0, 0644, \
/lib/systemd/system/rc-once.service)
- @$(call install_alternative, rc-once, 0, 0, 0644, \
- /lib/systemd/system/rc-once.target)
- @$(call install_copy, rc-once, 0, 0, 0755, /etc/systemd/system)
+ @$(call install_link, rc-once, ../rc-once.service, \
+ /lib/systemd/system/system-update.target.wants/rc-once.service)
endif
@$(call install_copy, rc-once, 0, 0, 0755, /etc/rc.once.d)
diff --git a/rules/rc-once.postinst b/rules/rc-once.postinst
index f80a334cb..a7368bde1 100644
--- a/rules/rc-once.postinst
+++ b/rules/rc-once.postinst
@@ -1,6 +1,6 @@
#!/bin/sh
-if [ -f "$DESTDIR/lib/systemd/system/rc-once.target" ]; then
- ln -sf /lib/systemd/system/rc-once.target $DESTDIR/etc/systemd/system/default.target
+if [ -f "$DESTDIR/lib/systemd/system/rc-once.service" ]; then
+ ln -sf etc/rc.once.d $DESTDIR/system-update
fi