From: "Denys Dmytriyenko" <denis@denix.org>
To: Joshua Watt <JPEWhacker@gmail.com>
Cc: meta-arm@lists.yoctoproject.org
Subject: Re: [meta-arm][PATCH v2 2/3] optee-client: Add sysVinit service
Date: Sun, 17 May 2020 12:44:23 -0400 [thread overview]
Message-ID: <20200517164423.GJ11927@denix.org> (raw)
In-Reply-To: <20200515160240.16395-3-JPEWhacker@gmail.com>
On Fri, May 15, 2020 at 11:02:39AM -0500, Joshua Watt wrote:
> Adds a sysVinit service to start tee-supplicant so that the optee-client
> package can be used on distros where systemd is not used. Also does some
> cleanup of the recipe including:
> 1) Using @path@ tokens for replacemane in the .service file instead of
> paths
> 2) Replacing tokens in the .service file after it is installed instead
> of editing the source file in ${WORKDIR}
Overall looks fine. Quick question - if both sysvinit and systemd are in
DISTRO_FEATURES - will it start tee-supplicant twice? This was never clear
to me - I see some recipes go the extra mile to check the DISTRO_FEATURES
and only install/enable the service accordingly, while some completely rely
on the corresponding bbclass.
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
> .../optee/optee-client/tee-supplicant.service | 4 +-
> .../optee/optee-client/tee-supplicant.sh | 46 +++++++++++++++++++
> .../optee/optee-client_git.bb | 24 +++++++---
> 3 files changed, 65 insertions(+), 9 deletions(-)
> create mode 100644 meta-arm/recipes-security/optee/optee-client/tee-supplicant.sh
>
> diff --git a/meta-arm/recipes-security/optee/optee-client/tee-supplicant.service b/meta-arm/recipes-security/optee/optee-client/tee-supplicant.service
> index ffb54d3..c273832 100644
> --- a/meta-arm/recipes-security/optee/optee-client/tee-supplicant.service
> +++ b/meta-arm/recipes-security/optee/optee-client/tee-supplicant.service
> @@ -3,8 +3,8 @@ Description=TEE Supplicant
>
> [Service]
> User=root
> -EnvironmentFile=-/etc/default/tee-supplicant
> -ExecStart=/usr/sbin/tee-supplicant $OPTARGS
> +EnvironmentFile=-@sysconfdir@/default/tee-supplicant
> +ExecStart=@sbindir@/tee-supplicant $OPTARGS
>
> [Install]
> WantedBy=basic.target
> diff --git a/meta-arm/recipes-security/optee/optee-client/tee-supplicant.sh b/meta-arm/recipes-security/optee/optee-client/tee-supplicant.sh
> new file mode 100644
> index 0000000..b4d2195
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-client/tee-supplicant.sh
> @@ -0,0 +1,46 @@
> +#!/bin/sh
> +
> +# Source function library
> +. /etc/init.d/functions
> +
> +NAME=tee-supplicant
> +PATH=/sbin:/bin:/usr/sbin:/usr/bin
> +DESC="OP-TEE Supplicant"
> +
> +DAEMON=@sbindir@/$NAME
> +
> +test -f $DAEMON || exit 0
> +
> +test -f @sysconfdir@/default/$NAME && . @sysconfdir@/default/$NAME
> +test -f @sysconfdir@/default/rcS && . @sysconfdir@/default/rcS
> +
> +SSD_OPTIONS="--oknodo --quiet --exec $DAEMON -- -d $OPTARGS"
> +
> +set -e
> +
> +case $1 in
> + start)
> + echo -n "Starting $DESC: "
> + start-stop-daemon --start $SSD_OPTIONS
> + echo "${DAEMON##*/}."
> + ;;
> + stop)
> + echo -n "Stopping $DESC: "
> + start-stop-daemon --stop $SSD_OPTIONS
> + echo "${DAEMON##*/}."
> + ;;
> + restart|force-reload)
> + $0 stop
> + sleep 1
> + $0 start
> + ;;
> + status)
> + status ${DAEMON} || exit $?
> + ;;
> + *)
> + echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
> + exit 1
> + ;;
> +esac
> +
> +exit 0
> diff --git a/meta-arm/recipes-security/optee/optee-client_git.bb b/meta-arm/recipes-security/optee/optee-client_git.bb
> index ec0826c..a26a799 100644
> --- a/meta-arm/recipes-security/optee/optee-client_git.bb
> +++ b/meta-arm/recipes-security/optee/optee-client_git.bb
> @@ -9,19 +9,18 @@ PV = "3.8.0+git${SRCPV}"
>
> require optee.inc
>
> -inherit python3native systemd
> +inherit python3native systemd update-rc.d
>
> SRCREV = "be4fa2e36f717f03ca46e574aa66f697a897d090"
> SRC_URI = " \
> git://github.com/OP-TEE/optee_client.git \
> file://tee-supplicant.service \
> + file://tee-supplicant.sh \
> "
>
> S = "${WORKDIR}/git"
> B = "${WORKDIR}/build"
>
> -SYSTEMD_SERVICE_${PN} = "tee-supplicant.service"
> -
> EXTRA_OEMAKE = "O=${B}"
>
> do_compile() {
> @@ -42,9 +41,20 @@ do_install() {
> install -d ${D}${includedir}
> install -p -m0644 ${B}/export/usr/include/*.h ${D}${includedir}
>
> - sed -i -e s:/etc:${sysconfdir}:g \
> - -e s:/usr/bin:${bindir}:g \
> - ${WORKDIR}/tee-supplicant.service
> -
> install -D -p -m0644 ${WORKDIR}/tee-supplicant.service ${D}${systemd_system_unitdir}/tee-supplicant.service
> +
> + install -D -p -m0755 ${WORKDIR}/tee-supplicant.sh ${D}${sysconfdir}/init.d/tee-supplicant
> +
> + sed -i -e s:@sysconfdir@:${sysconfdir}:g \
> + -e s:@sbindir@:${sbindir}:g \
> + ${D}${systemd_system_unitdir}/tee-supplicant.service \
> + ${D}${sysconfdir}/init.d/tee-supplicant
> }
> +
> +SYSTEMD_SERVICE_${PN} = "tee-supplicant.service"
> +
> +INITSCRIPT_PACKAGES = "${PN}"
> +
> +INITSCRIPT_NAME_${PN} = "tee-supplicant"
> +INITSCRIPT_PARAMS_${PN} = "start 10 1 2 3 4 5 . stop 90 0 6 ."
> +
> --
> 2.17.1
>
>
next prev parent reply other threads:[~2020-05-17 16:44 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-13 22:11 [meta-arm][PATCH] Add support for booting qemu with TFA and optee Joshua Watt
2020-05-13 22:27 ` Denys Dmytriyenko
2020-05-13 22:42 ` Joshua Watt
2020-05-15 16:02 ` [meta-arm][PATCH v2 0/3] " Joshua Watt
2020-05-15 16:02 ` [meta-arm][PATCH v2 1/3] optee-{os,examples,client,test}: Build out of tree Joshua Watt
2020-05-17 16:35 ` Denys Dmytriyenko
2020-05-21 5:12 ` [PATCH " Diego Sueiro
2020-05-15 16:02 ` [meta-arm][PATCH v2 2/3] optee-client: Add sysVinit service Joshua Watt
2020-05-17 16:44 ` Denys Dmytriyenko [this message]
2020-05-18 17:04 ` William Mills
2020-05-18 18:03 ` Joshua Watt
2020-05-18 18:58 ` Denys Dmytriyenko
2020-05-18 21:52 ` Joshua Watt
2020-05-18 21:57 ` William Mills
2020-05-18 22:06 ` Joshua Watt
2020-05-18 22:41 ` Denys Dmytriyenko
2020-05-19 10:03 ` William Mills
2020-05-15 16:02 ` [meta-arm][PATCH v2 3/3] Add support for booting qemu with TFA and optee Joshua Watt
2020-05-17 16:58 ` Denys Dmytriyenko
2020-05-18 16:30 ` Joshua Watt
2020-05-21 14:22 ` [meta-arm][PATCH v3 0/3] " Joshua Watt
2020-05-21 14:22 ` [meta-arm][PATCH v3 1/3] optee-{os,examples,client,test}: Build out of tree Joshua Watt
2020-05-22 7:19 ` [PATCH " Diego Sueiro
2020-05-24 18:28 ` [meta-arm] " Denys Dmytriyenko
2020-05-21 14:22 ` [meta-arm][PATCH v3 2/3] optee-client: Add sysVinit service Joshua Watt
2020-05-22 7:20 ` [PATCH " Diego Sueiro
2020-05-24 18:29 ` [meta-arm] " Denys Dmytriyenko
2020-05-21 14:22 ` [meta-arm][PATCH v3 3/3] Add support for booting qemu with TFA and optee Joshua Watt
2020-05-24 20:08 ` Denys Dmytriyenko
2020-05-28 20:30 ` [meta-arm][PATCH v3 0/3] " Jon Mason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200517164423.GJ11927@denix.org \
--to=denis@denix.org \
--cc=JPEWhacker@gmail.com \
--cc=meta-arm@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.