diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2024-01-02 10:17:48 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-07 12:24:57 +0000 |
commit | 8c732425edf73234bbab0781aab42ed2d28c9582 (patch) | |
tree | 200fc4685eb60b88d5849b77fe660cfb55631f73 /meta | |
parent | 6e62ccffb6545a264a7da8485d3ed4bc95148566 (diff) | |
download | poky-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')
-rw-r--r-- | meta/recipes-connectivity/openssh/openssh_9.5p1.bb | 25 |
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" | |||
50 | INITSCRIPT_PARAMS:${PN}-sshd = "defaults 9" | 50 | INITSCRIPT_PARAMS:${PN}-sshd = "defaults 9" |
51 | 51 | ||
52 | SYSTEMD_PACKAGES = "${PN}-sshd" | 52 | SYSTEMD_PACKAGES = "${PN}-sshd" |
53 | SYSTEMD_SERVICE:${PN}-sshd = "sshd.socket sshd.service" | 53 | 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)}" |
54 | 54 | ||
55 | inherit autotools-brokensep ptest pkgconfig | 55 | inherit autotools-brokensep ptest pkgconfig |
56 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | 56 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" |
57 | 57 | ||
58 | PACKAGECONFIG ??= "" | 58 | # systemd-sshd-socket-mode means installing sshd.socket |
59 | # and systemd-sshd-service-mode corresponding to sshd.service | ||
60 | PACKAGECONFIG ??= "systemd-sshd-socket-mode" | ||
59 | PACKAGECONFIG[kerberos] = "--with-kerberos5,--without-kerberos5,krb5" | 61 | PACKAGECONFIG[kerberos] = "--with-kerberos5,--without-kerberos5,krb5" |
60 | PACKAGECONFIG[ldns] = "--with-ldns,--without-ldns,ldns" | 62 | PACKAGECONFIG[ldns] = "--with-ldns,--without-ldns,ldns" |
61 | PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit" | 63 | PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit" |
62 | PACKAGECONFIG[manpages] = "--with-mantype=man,--with-mantype=cat" | 64 | PACKAGECONFIG[manpages] = "--with-mantype=man,--with-mantype=cat" |
65 | PACKAGECONFIG[systemd-sshd-socket-mode] = "" | ||
66 | PACKAGECONFIG[systemd-sshd-service-mode] = "" | ||
63 | 67 | ||
64 | EXTRA_AUTORECONF += "--exclude=aclocal" | 68 | EXTRA_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 |