* [Buildroot] [PATCH] package/openssh: adding a way to install only sftp-server
@ 2019-02-15 22:02 Angelo Compagnucci
2019-02-15 22:17 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Angelo Compagnucci @ 2019-02-15 22:02 UTC (permalink / raw)
To: buildroot
This patch adds a way to install only sftp-server in case it is
needed by other packages (like dropbear) or a full openssh installation is
not needed.
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
package/openssh/Config.in | 9 +++++++++
package/openssh/openssh.mk | 10 ++++++++++
2 files changed, 19 insertions(+)
diff --git a/package/openssh/Config.in b/package/openssh/Config.in
index 683a9c0e51..ba0dc62f83 100644
--- a/package/openssh/Config.in
+++ b/package/openssh/Config.in
@@ -9,3 +9,12 @@ config BR2_PACKAGE_OPENSSH
friends.
http://www.openssh.com/
+
+if BR2_PACKAGE_OPENSSH
+
+config BR2_PACKAGE_OPENSSH_SFTP_ONLY
+ bool "install only sftp"
+ help
+ Install only sftp binary (ex: dropbear sftp support)
+
+endif
diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
index 4fef5caedb..bfd93845d9 100644
--- a/package/openssh/openssh.mk
+++ b/package/openssh/openssh.mk
@@ -88,4 +88,14 @@ endef
OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_SSH_COPY_ID
+ifeq ($(BR2_PACKAGE_OPENSSH_SFTP_ONLY),y)
+define OPENSSH_INSTALL_TARGET_CMDS
+ $(INSTALL) -D -m 755 $(@D)/sftp-server \
+ $(TARGET_DIR)/usr/libexec/sftp-server
+endef
+undefine OPENSSH_INSTALL_INIT_SYSTEMD
+undefine OPENSSH_INSTALL_INIT_SYSV
+undefine OPENSSH_POST_INSTALL_TARGET_HOOKS
+endif
+
$(eval $(autotools-package))
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] package/openssh: adding a way to install only sftp-server
2019-02-15 22:02 [Buildroot] [PATCH] package/openssh: adding a way to install only sftp-server Angelo Compagnucci
@ 2019-02-15 22:17 ` Thomas Petazzoni
2019-02-18 15:51 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2019-02-15 22:17 UTC (permalink / raw)
To: buildroot
Hello Angelo,
On Fri, 15 Feb 2019 23:02:57 +0100
Angelo Compagnucci <angelo.compagnucci@gmail.com> wrote:
> This patch adds a way to install only sftp-server in case it is
> needed by other packages (like dropbear) or a full openssh installation is
> not needed.
Why not using package/gesftpserver/ if you need a sftp server in a
dropbear-only environment ?
> +if BR2_PACKAGE_OPENSSH
> +
> +config BR2_PACKAGE_OPENSSH_SFTP_ONLY
Options "FOO_ONLY" are not really nice. If we really want to do this,
then we probably want:
BR2_PACKAGE_OPENSSH_SSH
BR2_PACKAGE_OPENSSH_SSHD
BR2_PACKAGE_OPENSSH_SFTP_SERVER
etc.
> + bool "install only sftp"
> + help
> + Install only sftp binary (ex: dropbear sftp support)
> +
> +endif
> diff --git a/package/openssh/openssh.mk b/package/openssh/openssh.mk
> index 4fef5caedb..bfd93845d9 100644
> --- a/package/openssh/openssh.mk
> +++ b/package/openssh/openssh.mk
> @@ -88,4 +88,14 @@ endef
>
> OPENSSH_POST_INSTALL_TARGET_HOOKS += OPENSSH_INSTALL_SSH_COPY_ID
>
> +ifeq ($(BR2_PACKAGE_OPENSSH_SFTP_ONLY),y)
> +define OPENSSH_INSTALL_TARGET_CMDS
> + $(INSTALL) -D -m 755 $(@D)/sftp-server \
> + $(TARGET_DIR)/usr/libexec/sftp-server
> +endef
> +undefine OPENSSH_INSTALL_INIT_SYSTEMD
> +undefine OPENSSH_INSTALL_INIT_SYSV
> +undefine OPENSSH_POST_INSTALL_TARGET_HOOKS
Yerk, "undefine". We don't use this anywhere else in Buildroot
packages :-/
Could you consider using gesftpserver ? :-)
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] package/openssh: adding a way to install only sftp-server
2019-02-15 22:17 ` Thomas Petazzoni
@ 2019-02-18 15:51 ` Peter Korsgaard
0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2019-02-18 15:51 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> Hello Angelo,
> On Fri, 15 Feb 2019 23:02:57 +0100
> Angelo Compagnucci <angelo.compagnucci@gmail.com> wrote:
>> This patch adds a way to install only sftp-server in case it is
>> needed by other packages (like dropbear) or a full openssh installation is
>> not needed.
> Why not using package/gesftpserver/ if you need a sftp server in a
> dropbear-only environment ?
Yes, my thoughts exactly!
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-18 15:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-15 22:02 [Buildroot] [PATCH] package/openssh: adding a way to install only sftp-server Angelo Compagnucci
2019-02-15 22:17 ` Thomas Petazzoni
2019-02-18 15:51 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox