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:57 +0000
commit8c732425edf73234bbab0781aab42ed2d28c9582 (patch)
tree200fc4685eb60b88d5849b77fe660cfb55631f73 /meta/recipes-connectivity/openssh
parent6e62ccffb6545a264a7da8485d3ed4bc95148566 (diff)
downloadpoky-8c732425edf73234bbab0781aab42ed2d28c9582.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. (From OE-Core rev: bc830ad3c6a11af1a350dca7f33f0682aeee0d21) 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"
50INITSCRIPT_PARAMS:${PN}-sshd = "defaults 9" 50INITSCRIPT_PARAMS:${PN}-sshd = "defaults 9"
51 51
52SYSTEMD_PACKAGES = "${PN}-sshd" 52SYSTEMD_PACKAGES = "${PN}-sshd"
53SYSTEMD_SERVICE:${PN}-sshd = "sshd.socket sshd.service" 53SYSTEMD_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)}"
54 54
55inherit autotools-brokensep ptest pkgconfig 55inherit autotools-brokensep ptest pkgconfig
56DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" 56DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
57 57
58PACKAGECONFIG ??= "" 58# systemd-sshd-socket-mode means installing sshd.socket
59# and systemd-sshd-service-mode corresponding to sshd.service
60PACKAGECONFIG ??= "systemd-sshd-socket-mode"
59PACKAGECONFIG[kerberos] = "--with-kerberos5,--without-kerberos5,krb5" 61PACKAGECONFIG[kerberos] = "--with-kerberos5,--without-kerberos5,krb5"
60PACKAGECONFIG[ldns] = "--with-ldns,--without-ldns,ldns" 62PACKAGECONFIG[ldns] = "--with-ldns,--without-ldns,ldns"
61PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit" 63PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
62PACKAGECONFIG[manpages] = "--with-mantype=man,--with-mantype=cat" 64PACKAGECONFIG[manpages] = "--with-mantype=man,--with-mantype=cat"
65PACKAGECONFIG[systemd-sshd-socket-mode] = ""
66PACKAGECONFIG[systemd-sshd-service-mode] = ""
63 67
64EXTRA_AUTORECONF += "--exclude=aclocal" 68EXTRA_AUTORECONF += "--exclude=aclocal"
65 69
@@ -125,15 +129,24 @@ do_install:append () {
125 echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly 129 echo "HostKey /var/run/ssh/ssh_host_ed25519_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
126 130
127 install -d ${D}${systemd_system_unitdir} 131 install -d ${D}${systemd_system_unitdir}
128 install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_system_unitdir} 132 if ${@bb.utils.contains('PACKAGECONFIG','systemd-sshd-socket-mode','true','false',d)}; then
129 install -c -m 0644 ${WORKDIR}/sshd.service ${D}${systemd_system_unitdir} 133 install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_system_unitdir}
130 install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_system_unitdir} 134 install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_system_unitdir}
135 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
136 -e 's,@SBINDIR@,${sbindir},g' \
137 -e 's,@BINDIR@,${bindir},g' \
138 -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
139 ${D}${systemd_system_unitdir}/sshd.socket
140 fi
141 if ${@bb.utils.contains('PACKAGECONFIG','systemd-sshd-service-mode','true','false',d)}; then
142 install -c -m 0644 ${WORKDIR}/sshd.service ${D}${systemd_system_unitdir}
143 fi
131 install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_system_unitdir} 144 install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_system_unitdir}
132 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ 145 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
133 -e 's,@SBINDIR@,${sbindir},g' \ 146 -e 's,@SBINDIR@,${sbindir},g' \
134 -e 's,@BINDIR@,${bindir},g' \ 147 -e 's,@BINDIR@,${bindir},g' \
135 -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \ 148 -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
136 ${D}${systemd_system_unitdir}/sshd.socket ${D}${systemd_system_unitdir}/*.service 149 ${D}${systemd_system_unitdir}/*.service
137 150
138 sed -i -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \ 151 sed -i -e 's,@LIBEXECDIR@,${libexecdir}/${BPN},g' \
139 ${D}${sysconfdir}/init.d/sshd 152 ${D}${sysconfdir}/init.d/sshd