summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/openssh
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2024-01-02 10:17:48 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-07 12:24:54 +0000
commitbc830ad3c6a11af1a350dca7f33f0682aeee0d21 (patch)
tree20c326f144f9da0c749fe35df770d74d9510a112 /meta/recipes-connectivity/openssh
parent44f2525e76ad5832faad1968037c8da8b6a285d2 (diff)
downloadopenembedded-core-bc830ad3c6a11af1a350dca7f33f0682aeee0d21.tar.gz
openssh: Add PACKAGECONFIG option to customize sshd mode
Add systemd-sshd-socket-mode PACKAGECONFIG option to choose installing 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 choose the above two PACKAGECONFIG option to customize the sshd mode. Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity/openssh')
-rw-r--r--meta/recipes-connectivity/openssh/openssh_9.5p1.bb25
1 files 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 bbb8fb091a..0312d5bd66 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
DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
-PACKAGECONFIG ??= ""
+# systemd-sshd-socket-mode means installing sshd.socket
+# and systemd-sshd-service-mode corresponding to sshd.service
+PACKAGECONFIG ??= "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-sshd-socket-mode] = ""
+PACKAGECONFIG[systemd-sshd-service-mode] = ""
EXTRA_AUTORECONF += "--exclude=aclocal"
@@ -125,15 +129,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