[oe-commits] Andreas Müller : systemd.bbclass: introduce SYSTEMD_AUTO_ENABLE variable

git at git.openembedded.org git at git.openembedded.org
Mon Jul 16 07:43:05 UTC 2012


Module: meta-openembedded.git
Branch: master
Commit: 6e6bd9af71047e6f3b867d23bbbcca320ae2f1e8
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=6e6bd9af71047e6f3b867d23bbbcca320ae2f1e8

Author: Andreas Müller <schnitzeltony at googlemail.com>
Date:   Fri Jul 13 12:40:50 2012 +0200

systemd.bbclass: introduce SYSTEMD_AUTO_ENABLE variable

Currently all services introduced are enabled and started at installation. By
setting SYSTEMD_AUTO_ENABLE = "disable" the default behaviour can be
overridden.

---

 meta-systemd/classes/systemd.bbclass |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta-systemd/classes/systemd.bbclass b/meta-systemd/classes/systemd.bbclass
index 8af0d58..38b9ed5 100644
--- a/meta-systemd/classes/systemd.bbclass
+++ b/meta-systemd/classes/systemd.bbclass
@@ -1,5 +1,7 @@
 DEPENDS_append = " systemd-systemctl-native"
 
+SYSTEMD_AUTO_ENABLE ??= "enable"
+
 systemd_postinst() {
 OPTS=""
 
@@ -7,9 +9,9 @@ if [ -n "$D" ]; then
     OPTS="--root=$D"
 fi
 
-systemctl $OPTS enable ${SYSTEMD_SERVICE}
+systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
 
-if [ -z "$D" ]; then
+if [ -z "$D" -a ${SYSTEMD_AUTO_ENABLE} = "enable" ]; then
     systemctl start ${SYSTEMD_SERVICE}
 fi
 }





More information about the Openembedded-commits mailing list