aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-core
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2012-04-04 12:32:54 +0000
committerKoen Kooi <koen@dominion.thruhere.net>2012-04-04 20:36:47 +0200
commit3f79074a70a0476b0b66cbd374f2359cc9c09fb7 (patch)
tree548092ddf0ae26bc115f681299e02a3ce4c7d1e8 /meta-oe/recipes-core
parent294a0b5cee0ccb752a73092d4548dac0ecc6c4c4 (diff)
downloadmeta-openembedded-3f79074a70a0476b0b66cbd374f2359cc9c09fb7.tar.gz
meta-openembedded-3f79074a70a0476b0b66cbd374f2359cc9c09fb7.tar.bz2
meta-openembedded-3f79074a70a0476b0b66cbd374f2359cc9c09fb7.zip
systemd-systemctl-native: add support to disable services
This adds support to disable services making possible to it to be done during rootfs generation. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/recipes-core')
-rw-r--r--meta-oe/recipes-core/systemd/systemd-systemctl-native.bb2
-rwxr-xr-xmeta-oe/recipes-core/systemd/systemd-systemctl-native/systemctl32
2 files changed, 26 insertions, 8 deletions
diff --git a/meta-oe/recipes-core/systemd/systemd-systemctl-native.bb b/meta-oe/recipes-core/systemd/systemd-systemctl-native.bb
index dcd67ee54..78eb8f36b 100644
--- a/meta-oe/recipes-core/systemd/systemd-systemctl-native.bb
+++ b/meta-oe/recipes-core/systemd/systemd-systemctl-native.bb
@@ -3,7 +3,7 @@ DESCRIPTION = "Wrapper to enable of systemd services"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
-PR = "r1"
+PR = "r2"
inherit native
diff --git a/meta-oe/recipes-core/systemd/systemd-systemctl-native/systemctl b/meta-oe/recipes-core/systemd/systemd-systemctl-native/systemctl
index b86f3cd74..c4a0a3fad 100755
--- a/meta-oe/recipes-core/systemd/systemd-systemctl-native/systemctl
+++ b/meta-oe/recipes-core/systemd/systemd-systemctl-native/systemctl
@@ -3,6 +3,7 @@
ROOT=
# parse command line params
+action=
while [ $# != 0 ]; do
opt="$1"
@@ -10,17 +11,26 @@ while [ $# != 0 ]; do
enable)
shift
+ action="$opt"
services="$1"
- in_enable="1"
+ cmd_args="1"
+ shift
+ ;;
+ disable)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
shift
;;
--root=*)
ROOT=${opt##--root=}
- in_enable="0"
+ cmd_args="0"
shift
;;
*)
- if [ "$in_enable" = "1" ]; then
+ if [ "$cmd_args" = "1" ]; then
services="$services $opt"
shift
else
@@ -53,9 +63,15 @@ for service in $services; do
| grep '\.target$')
for r in $wanted_by; do
- mkdir -p $ROOT/etc/systemd/system/$r.wants
- ln -s $service_file $ROOT/etc/systemd/system/$r.wants
- echo "Enabled $service for $wanted_by."
+ if [ "$action" = "enable" ]; then
+ mkdir -p $ROOT/etc/systemd/system/$r.wants
+ ln -s $service_file $ROOT/etc/systemd/system/$r.wants
+ echo "Enabled $service for $wanted_by."
+ else
+ rm -f $ROOT/etc/systemd/system/$r.wants/$service_file
+ rmdirs -p $ROOT/etc/systemd/system/$r.wants
+ echo "Disabled $service for $wanted_by."
+ fi
done
# call us for the other required scripts
@@ -63,6 +79,8 @@ for service in $services; do
| sed 's,Also=,,g' \
| tr ',' '\n')
for a in $also; do
- $0 --root=$ROOT enable $a
+ if [ "$action" = "enable" ]; then
+ $0 --root=$ROOT enable $a
+ fi
done
done