Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Yu, Mingli" <mingli.yu@windriver.com>
To: "Yu, Mingli" <mingli.yu@eng.windriver.com>,
	openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v4] openssh: Add PACKAGECONFIG option to customize sshd mode
Date: Mon, 18 Dec 2023 14:16:55 +0800	[thread overview]
Message-ID: <bb40f37b-b9a5-bd34-ccb6-b958611b9c61@windriver.com> (raw)
In-Reply-To: <179E3241B25BBB7C.1352@lists.openembedded.org>

Ping.

Thanks,

On 12/6/23 16:56, Yu, Mingli wrote:
> From: Mingli Yu <mingli.yu@windriver.com>
> 
> Add systemd-sshd-socket-mode PACKAGECONFIG option to choose sshd.socket
> and systemd-sshd-service-mode PACKAGECONFIG option to choose installing
> sshd.service.
> 
> The systemd-sshd-socket-mode PACKAGECONFIG option is enabled by default
> and user can customize the above two PACKAGECONFIG option to choose the
> sshd mode.
> 
> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> ---
> Changed in v3:
> rebase based on https://lore.kernel.org/all/20231201140947.792594-1-xiangyu.chen@eng.windriver.com/
> 
> Changed in v4:
> make it possible to install both sshd.socket and sshd.service
> .../openssh/openssh_9.5p1.bb                  | 25 ++++++++++++++-----
>   1 file changed, 19 insertions(+), 6 deletions(-)
> 
> diff --git a/meta/recipes-connectivity/openssh/openssh_9.5p1.bb b/meta/recipes-connectivity/openssh/openssh_9.5p1.bb
> index 2c1c821ea9..58dd030c64 100644
> --- a/meta/recipes-connectivity/openssh/openssh_9.5p1.bb
> +++ b/meta/recipes-connectivity/openssh/openssh_9.5p1.bb
> @@ -50,16 +50,20 @@ INITSCRIPT_NAME:${PN}-sshd = "sshd"
>   INITSCRIPT_PARAMS:${PN}-sshd = "defaults 9"
>   
>   SYSTEMD_PACKAGES = "${PN}-sshd"
> -SYSTEMD_SERVICE:${PN}-sshd = "sshd.socket sshd.service"
> +SYSTEMD_SERVICE:${PN}-sshd = "${@bb.utils.contains('PACKAGECONFIG','systemd-sshd-socket-mode','sshd.socket', '', d)} ${@bb.utils.contains('PACKAGECONFIG','systemd-sshd-service-mode','sshd.service', '', d)}"
>   
>   inherit autotools-brokensep ptest pkgconfig
>   
> -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
> +# systemd-sshd-socket-mode means sshd.socket and systemd-sshd-service-mode
> +# corresponding to sshd.service
> +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} systemd-sshd-socket-mode"
>   PACKAGECONFIG[kerberos] = "--with-kerberos5,--without-kerberos5,krb5"
>   PACKAGECONFIG[ldns] = "--with-ldns,--without-ldns,ldns"
>   PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
>   PACKAGECONFIG[manpages] = "--with-mantype=man,--with-mantype=cat"
>   PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
> +PACKAGECONFIG[systemd-sshd-socket-mode] = ""
> +PACKAGECONFIG[systemd-sshd-service-mode] = ""
>   
>   EXTRA_AUTORECONF += "--exclude=aclocal"
>   
> @@ -124,15 +128,24 @@ do_install:append () {
>   	echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
>   
>   	install -d ${D}${systemd_system_unitdir}
> -	install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_system_unitdir}
> -	install -c -m 0644 ${WORKDIR}/sshd.service ${D}${systemd_system_unitdir}
> -	install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_system_unitdir}
> +	if ${@bb.utils.contains('PACKAGECONFIG','systemd-sshd-socket-mode','true','false',d)}; then
> +	    install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_system_unitdir}
> +	    install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_system_unitdir}
> +	    sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
> +		    -e 's,@SBINDIR@,${sbindir},g' \
> +		    -e 's,@BINDIR@,${bindir},g' \
> +		    -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
> +            ${D}${systemd_system_unitdir}/sshd.socket
> +	fi
> +	if ${@bb.utils.contains('PACKAGECONFIG','systemd-sshd-service-mode','true','false',d)}; then
> +	    install -c -m 0644 ${WORKDIR}/sshd.service ${D}${systemd_system_unitdir}
> +	fi
>   	install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_system_unitdir}
>   	sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
>   		-e 's,@SBINDIR@,${sbindir},g' \
>   		-e 's,@BINDIR@,${bindir},g' \
>   		-e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
> -		${D}${systemd_system_unitdir}/sshd.socket ${D}${systemd_system_unitdir}/*.service
> +		${D}${systemd_system_unitdir}/*.service
>   
>   	sed -i -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
>   		${D}${sysconfdir}/init.d/sshd
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#191874): https://lists.openembedded.org/g/openembedded-core/message/191874
> Mute This Topic: https://lists.openembedded.org/mt/103009646/3618448
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [mingli.yu@eng.windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


  parent reply	other threads:[~2023-12-18  6:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04  8:54 [PATCH] openssh: Add SSHD_SERVICE_TYPE variable mingli.yu
2023-12-04 11:07 ` [OE-core] " Richard Purdie
2023-12-05  2:51   ` Yu, Mingli
2023-12-05  5:52     ` [PATCH v2] openssh: Add PACKAGECONFIG option to customize sshd mode mingli.yu
2023-12-05  7:43       ` [OE-core] " Alexandre Belloni
2023-12-06  5:44         ` [PATCH v3] " mingli.yu
2023-12-06  8:56         ` [PATCH v4] " mingli.yu
2023-12-06 10:37           ` [OE-core] " Alex Kiernan
2023-12-07  2:10             ` Yu, Mingli
2023-12-07 12:11               ` Alex Kiernan
2023-12-13  3:37                 ` Yu, Mingli
     [not found]         ` <179E3241B25BBB7C.1352@lists.openembedded.org>
2023-12-18  6:16           ` Yu, Mingli [this message]
2023-12-06 22:34       ` [OE-core] [PATCH v2] " Peter Kjellerstedt
2023-12-07  1:53         ` Yu, Mingli

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=bb40f37b-b9a5-bd34-ccb6-b958611b9c61@windriver.com \
    --to=mingli.yu@windriver.com \
    --cc=mingli.yu@eng.windriver.com \
    --cc=openembedded-core@lists.openembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox