From patchwork Tue Aug 7 23:04:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [meta-systemd,1/2] systemd-systemctl-native: handle ALIAS tag Date: Tue, 07 Aug 2012 23:04:24 -0000 From: =?utf-8?q?Andreas_M=C3=BCller_=3Cschnitzeltony=40googlemail=2Ecom=3E?= X-Patchwork-Id: 34059 Message-Id: <1344380665-3759-2-git-send-email-schnitzeltony@googlemail.com> To: openembedded-devel@lists.openembedded.org Signed-off-by: Andreas Müller --- .../systemd/systemd-systemctl-native.bb | 2 +- .../systemd/systemd-systemctl-native/systemctl | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletions(-) diff --git a/meta-systemd/recipes-core/systemd/systemd-systemctl-native.bb b/meta-systemd/recipes-core/systemd/systemd-systemctl-native.bb index 5f23e98..25ddbda 100644 --- a/meta-systemd/recipes-core/systemd/systemd-systemctl-native.bb +++ b/meta-systemd/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-systemd/recipes-core/systemd/systemd-systemctl-native/systemctl b/meta-systemd/recipes-core/systemd/systemd-systemctl-native/systemctl index a5bd770..5c21e7f 100755 --- a/meta-systemd/recipes-core/systemd/systemd-systemctl-native/systemctl +++ b/meta-systemd/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' \