mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-16 16:27:27 +00:00
systemd-systemctl-native: extend systemctl wrapper to support mask action
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
This commit is contained in:
@@ -3,7 +3,7 @@ DESCRIPTION = "Wrapper to enable of systemd services"
|
|||||||
LICENSE = "MIT"
|
LICENSE = "MIT"
|
||||||
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
|
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
|
||||||
|
|
||||||
PR = "r3"
|
PR = "r4"
|
||||||
|
|
||||||
inherit native
|
inherit native
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,14 @@ while [ $# != 0 ]; do
|
|||||||
disable)
|
disable)
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
action="$opt"
|
||||||
|
services="$1"
|
||||||
|
cmd_args="1"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
mask)
|
||||||
|
shift
|
||||||
|
|
||||||
action="$opt"
|
action="$opt"
|
||||||
services="$1"
|
services="$1"
|
||||||
cmd_args="1"
|
cmd_args="1"
|
||||||
@@ -43,6 +51,16 @@ while [ $# != 0 ]; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
for service in $services; do
|
for service in $services; do
|
||||||
|
if [ "$action" = "mask" ]; then
|
||||||
|
if [ ! -d $ROOT/etc/systemd/system/ ]; then
|
||||||
|
mkdir -p $ROOT/etc/systemd/system/
|
||||||
|
fi
|
||||||
|
cmd="ln -s /dev/null $ROOT/etc/systemd/system/$service"
|
||||||
|
echo "$cmd"
|
||||||
|
$cmd
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Try to find location of $service..."
|
echo "Try to find location of $service..."
|
||||||
# find service file
|
# find service file
|
||||||
for p in $ROOT/etc/systemd/system \
|
for p in $ROOT/etc/systemd/system \
|
||||||
|
|||||||
Reference in New Issue
Block a user