浏览代码

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.

Signed-off-by: Eric Bénard <eric@eukrea.com>
Andreas Müller 12 年之前
父节点
当前提交
59c9953595
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      meta-oe/classes/systemd.bbclass

+ 4 - 2
meta-oe/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
 }