From patchwork Mon Sep 17 10:58:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [for-denzil, systemd, update, 3/6] systemd-systemctl-native: handle ALIAS tag Date: Mon, 17 Sep 2012 10:58:08 -0000 From: Koen Kooi X-Patchwork-Id: 36609 Message-Id: <1347879491-2425-4-git-send-email-koen@dominion.thruhere.net> To: openembedded-devel@lists.openembedded.org Cc: Koen Kooi , =?UTF-8?q?Eric=20B=C3=A9nard?= From: Andreas Müller Signed-off-by: Andreas Müller Signed-off-by: Koen Kooi --- .../systemd/systemd-systemctl-native.bb | 2 +- .../systemd/systemd-systemctl-native/systemctl | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/meta-oe/recipes-core/systemd/systemd-systemctl-native.bb b/meta-oe/recipes-core/systemd/systemd-systemctl-native.bb index 5f23e98..25ddbda 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 = "r4" +PR = "r5" 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 f74adf6..196e729 100755 --- a/meta-oe/recipes-core/systemd/systemd-systemctl-native/systemctl +++ b/meta-oe/recipes-core/systemd/systemd-systemctl-native/systemctl @@ -96,6 +96,23 @@ for service in $services; do fi done + # create the required symbolic 'Alias' links + alias=$(grep Alias $ROOT/$service_file \ + | sed 's,Alias=,,g' \ + | tr ',' '\n' \ + | grep '\.service$') + + for r in $alias; do + if [ "$action" = "enable" ]; then + mkdir -p $ROOT/etc/systemd/system + ln -s $service_file $ROOT/etc/systemd/system/$r + echo "Enabled $service for $alias." + else + rm -f $ROOT/etc/systemd/system/$r + echo "Disabled $service for $alias." + fi + done + # call us for the other required scripts also=$(grep Also $ROOT/$service_file \ | sed 's,Also=,,g' \