Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] sslh: new package
  2017-01-02 15:45 [Buildroot] [PATCH v2] ifenslave: " David Bachelart
@ 2017-01-02 15:45 ` David Bachelart
  2017-01-25 10:35   ` Thomas Petazzoni
  0 siblings, 1 reply; 8+ messages in thread
From: David Bachelart @ 2017-01-02 15:45 UTC (permalink / raw)
  To: buildroot

Signed-off-by: David Bachelart <david.bachelart@bbright.com>
---
Changes v1 -> v2:
  - Fix version in .mk file
  - Fix source url in .mk file
  - Fix hash file
---
 package/Config.in                               |  1 +
 package/sslh/0100-version-messup-with-git.patch | 47 +++++++++++++++++++++++++
 package/sslh/Config.in                          | 14 ++++++++
 package/sslh/S35sslh                            | 41 +++++++++++++++++++++
 package/sslh/sslh.default                       | 14 ++++++++
 package/sslh/sslh.hash                          |  4 +++
 package/sslh/sslh.mk                            | 29 +++++++++++++++
 7 files changed, 150 insertions(+)
 create mode 100644 package/sslh/0100-version-messup-with-git.patch
 create mode 100644 package/sslh/Config.in
 create mode 100644 package/sslh/S35sslh
 create mode 100644 package/sslh/sslh.default
 create mode 100644 package/sslh/sslh.hash
 create mode 100644 package/sslh/sslh.mk

diff --git a/package/Config.in b/package/Config.in
index 59fa851..ea1eb59 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1614,6 +1614,7 @@ endif
 	source "package/spice-protocol/Config.in"
 	source "package/squid/Config.in"
 	source "package/sshpass/Config.in"
+	source "package/sslh/Config.in"
 	source "package/strongswan/Config.in"
 	source "package/stunnel/Config.in"
 	source "package/tcpdump/Config.in"
diff --git a/package/sslh/0100-version-messup-with-git.patch b/package/sslh/0100-version-messup-with-git.patch
new file mode 100644
index 0000000..f4bc7c9
--- /dev/null
+++ b/package/sslh/0100-version-messup-with-git.patch
@@ -0,0 +1,47 @@
+diff --git a/genver.sh b/genver.sh
+index 4d6e76a..7e9176f 100755
+--- a/genver.sh
++++ b/genver.sh
+@@ -7,7 +7,7 @@ else
+ 	QUIET=0
+ fi
+ 
+-if ! `(git status | grep -q "On branch") 2> /dev/null`; then
++#if ! `(git status | grep -q "On branch") 2> /dev/null`; then
+         # If we don't have git, we can't work out what
+         # version this is. It must have been downloaded as a
+         # zip file. 
+@@ -23,20 +23,20 @@ if ! `(git status | grep -q "On branch") 2> /dev/null`; then
+             # release number
+             release=head-`perl -MPOSIX -e 'print strftime "%Y-%m-%d",localtime((stat "Makefile")[9])'`
+         fi
+-fi
+-
+-if head=`git rev-parse --verify HEAD 2>/dev/null`; then
+-	# generate the version info based on the tag
+-	release=`(git describe --tags || git --describe || git describe --all --long) \
+-		2>/dev/null | tr -d '\n'`
++#fi
+ 
+-	# Are there uncommitted changes?
+-	git update-index --refresh --unmerged > /dev/null
+-	if git diff-index --name-only HEAD | grep -v "^scripts/package" \
+-	    | read dummy; then
+-		release="$release-dirty"
+-	fi
+-fi
++#if head=`git rev-parse --verify HEAD 2>/dev/null`; then
++#	# generate the version info based on the tag
++#	release=`(git describe --tags || git --describe || git describe --all --long) \
++#		2>/dev/null | tr -d '\n'`
++#
++#	# Are there uncommitted changes?
++#	git update-index --refresh --unmerged > /dev/null
++#	if git diff-index --name-only HEAD | grep -v "^scripts/package" \
++#	    | read dummy; then
++#		release="$release-dirty"
++#	fi
++#fi
+ 
+ 
+ if [ $QUIET -ne 1 ]; then
diff --git a/package/sslh/Config.in b/package/sslh/Config.in
new file mode 100644
index 0000000..3794175
--- /dev/null
+++ b/package/sslh/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_SSLH
+	bool "sslh"
+	depends on BR2_INSTALL_LIBSTDCPP
+	# uses fork()
+	depends on BR2_USE_MMU
+	select BR2_PACKAGE_LIBCONFIG
+	help
+	  Applicative protocol multiplexer
+
+	  http://www.rutschle.net/tech/sslh.shtml
+
+comment "iperf needs a toolchain w/ C++"
+	depends on BR2_USE_MMU
+	depends on !BR2_INSTALL_LIBSTDCPP
diff --git a/package/sslh/S35sslh b/package/sslh/S35sslh
new file mode 100644
index 0000000..63a16da
--- /dev/null
+++ b/package/sslh/S35sslh
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Starts the SSLH server
+#
+
+NAME=sslh
+DAEMON=/usr/sbin/$NAME
+PIDFILE=/var/run/$NAME.pid
+
+. /etc/default/sslh
+
+start()
+{
+	echo -n "Starting $NAME: "
+	start-stop-daemon -S -q --exec $DAEMON -- $DAEMON_OPTS --pidfile $PIDFILE && echo "OK" || echo "Failed"
+}
+
+stop()
+{
+	echo -n "Stopping $NAME: "
+	start-stop-daemon -K -q -x $DAEMON && echo "OK" || echo "Failed"
+	rm -f $PIDFILE
+}
+
+case "$1" in
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	restart|reload)
+		stop
+		start
+		;;
+	*)
+		echo "Usage: $0 {start|stop|restart}"
+		exit 1
+esac
+
+exit $?
diff --git a/package/sslh/sslh.default b/package/sslh/sslh.default
new file mode 100644
index 0000000..2d2a1b1
--- /dev/null
+++ b/package/sslh/sslh.default
@@ -0,0 +1,14 @@
+# Default options for sslh initscript
+# sourced by /etc/init.d/sslh
+
+# Disabled by default, to force yourself
+# to read the configuration:
+# - /usr/share/doc/sslh/README.Debian (quick start)
+# - /usr/share/doc/sslh/README, at "Configuration" section
+# - sslh(8) via "man sslh" for more configuration details.
+# Once configuration ready, you *must* set RUN to yes here
+# and try to start sslh (standalone mode only)
+
+RUN=yes
+
+DAEMON_OPTS="--user root --listen 0.0.0.0:8090 --ssh 127.0.0.1:22 --http 127.0.0.1:80"
diff --git a/package/sslh/sslh.hash b/package/sslh/sslh.hash
new file mode 100644
index 0000000..4560b84
--- /dev/null
+++ b/package/sslh/sslh.hash
@@ -0,0 +1,4 @@
+# Locally computed
+md5 0e3568d5d234516c634d4df156473298    sslh-v1.18.tar.gz
+sha1    b2e3a4314f62fc8200ecfbadefebe809a84d8099    sslh-v1.18.tar.gz
+sha256  1601a5b377dcafc6b47d2fbb8d4d25cceb83053a4adcc5874d501a2d5a7745ad    sslh-v1.18.tar.gz
diff --git a/package/sslh/sslh.mk b/package/sslh/sslh.mk
new file mode 100644
index 0000000..962300f
--- /dev/null
+++ b/package/sslh/sslh.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# sslh
+#
+################################################################################
+
+SSLH_VERSION = 1.18
+SSLH_SITE = http://www.rutschle.net/tech/sslh
+SSLH_SOURCE = sslh-v$(SSLH_VERSION).tar.gz
+SSLH_LICENSE = GPL-v2+
+SSLH_LICENSE_FILES = COPYING
+
+SSLH_DEPENDENCIES = libconfig
+
+define SSLH_BUILD_CMDS
+  $(TARGET_MAKE_ENV) make CC=$(TARGET_CC) -C $(SSLH_DIR)
+endef
+
+define SSLH_INSTALL_TARGET_CMDS
+  $(INSTALL) -m 755 -D $(@D)/sslh-fork $(TARGET_DIR)/usr/sbin/sslh
+  $(INSTALL) -m 644 -D package/sslh/sslh.default $(TARGET_DIR)/etc/default/sslh
+endef
+
+define SSLH_INSTALL_INIT_SYSV
+  $(INSTALL) -m 755 -D package/sslh/S35sslh $(TARGET_DIR)/etc/init.d/S35sslh
+endef
+
+$(eval $(generic-package))
+
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2] sslh: new package
  2017-01-02 15:45 ` [Buildroot] [PATCH v2] sslh: " David Bachelart
@ 2017-01-25 10:35   ` Thomas Petazzoni
  2017-01-25 11:20     ` David Bachelart
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2017-01-25 10:35 UTC (permalink / raw)
  To: buildroot

Hello,

Thanks for your contribution, and this new iteration. However, there
are still a number of issues that need to be resolved before we can
apply your patch. See below for the comments.

On Mon,  2 Jan 2017 16:45:27 +0100, David Bachelart wrote:
> diff --git a/package/sslh/0100-version-messup-with-git.patch b/package/sslh/0100-version-messup-with-git.patch

Patches should starts at 0001, and we like them to be generated with
"git format-patch" when the upstream project uses Git as its version
control system.

> new file mode 100644
> index 0000000..f4bc7c9
> --- /dev/null
> +++ b/package/sslh/0100-version-messup-with-git.patch
> @@ -0,0 +1,47 @@

All patches must have a description and Signed-off-by line, formatted
like all git commits.

> +diff --git a/genver.sh b/genver.sh
> +index 4d6e76a..7e9176f 100755
> +--- a/genver.sh
> ++++ b/genver.sh
> +@@ -7,7 +7,7 @@ else
> + 	QUIET=0
> + fi
> + 
> +-if ! `(git status | grep -q "On branch") 2> /dev/null`; then
> ++#if ! `(git status | grep -q "On branch") 2> /dev/null`; then

Please remove code instead of commenting it.

However, since sslh seems to be actively developed, we would very much
prefer a solution that can be upstreamed. So something like an option
we can pass, or another mechanism that allows to disable this "let's
determine the version from git" thing.

> diff --git a/package/sslh/Config.in b/package/sslh/Config.in
> new file mode 100644
> index 0000000..3794175
> --- /dev/null
> +++ b/package/sslh/Config.in
> @@ -0,0 +1,14 @@
> +config BR2_PACKAGE_SSLH
> +	bool "sslh"
> +	depends on BR2_INSTALL_LIBSTDCPP
> +	# uses fork()
> +	depends on BR2_USE_MMU
> +	select BR2_PACKAGE_LIBCONFIG
> +	help
> +	  Applicative protocol multiplexer
> +
> +	  http://www.rutschle.net/tech/sslh.shtml
> +
> +comment "iperf needs a toolchain w/ C++"

I guess this package is sslh, not iperf :)

> +start()
> +{
> +	echo -n "Starting $NAME: "

Use printf here instead of echo -n.

> +	start-stop-daemon -S -q --exec $DAEMON -- $DAEMON_OPTS --pidfile $PIDFILE && echo "OK" || echo "Failed"

Please use the same syntax as other init scripts. Look at
package/dropbear/S50dropbear for an example.

> +stop()
> +{
> +	echo -n "Stopping $NAME: "
> +	start-stop-daemon -K -q -x $DAEMON && echo "OK" || echo "Failed"
> +	rm -f $PIDFILE

Removing the pidfile is not really needed.

> diff --git a/package/sslh/sslh.default b/package/sslh/sslh.default
> new file mode 100644
> index 0000000..2d2a1b1
> --- /dev/null
> +++ b/package/sslh/sslh.default
> @@ -0,0 +1,14 @@
> +# Default options for sslh initscript
> +# sourced by /etc/init.d/sslh

There is no such file in Buildroot.

> +# Disabled by default, to force yourself
> +# to read the configuration:
> +# - /usr/share/doc/sslh/README.Debian (quick start)
> +# - /usr/share/doc/sslh/README, at "Configuration" section
> +# - sslh(8) via "man sslh" for more configuration details.

All these references don't really make sense in a Buildroot context.

> +# Once configuration ready, you *must* set RUN to yes here
> +# and try to start sslh (standalone mode only)
> +
> +RUN=yes

Not used by Buildroot.

> +
> +DAEMON_OPTS="--user root --listen 0.0.0.0:8090 --ssh 127.0.0.1:22 --http 127.0.0.1:80"

In general, we do not provide an default file for /etc/default, the
init script is self sufficient. So please put the default value for
DAEMON_OPTS into the init script, and simply include /etc/default/sslh
afterwards so that it can override the options.

> diff --git a/package/sslh/sslh.mk b/package/sslh/sslh.mk
> new file mode 100644
> index 0000000..962300f
> --- /dev/null
> +++ b/package/sslh/sslh.mk
> @@ -0,0 +1,29 @@
> +################################################################################
> +#
> +# sslh
> +#
> +################################################################################
> +
> +SSLH_VERSION = 1.18
> +SSLH_SITE = http://www.rutschle.net/tech/sslh
> +SSLH_SOURCE = sslh-v$(SSLH_VERSION).tar.gz

The "v" should be part of SSLH_VERSION, and then SSLH_SOURCE can be
removed as it's the default version.

> +SSLH_LICENSE = GPL-v2+

Should be GPLv2+.

> +SSLH_LICENSE_FILES = COPYING
> +
> +SSLH_DEPENDENCIES = libconfig
> +
> +define SSLH_BUILD_CMDS
> +  $(TARGET_MAKE_ENV) make CC=$(TARGET_CC) -C $(SSLH_DIR)

This should be:

	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)

notice that the indentation is done with one tab, not with spaces.

> +endef
> +
> +define SSLH_INSTALL_TARGET_CMDS
> +  $(INSTALL) -m 755 -D $(@D)/sslh-fork $(TARGET_DIR)/usr/sbin/sslh
> +  $(INSTALL) -m 644 -D package/sslh/sslh.default $(TARGET_DIR)/etc/default/sslh

The Makefile has an "install" target that seems to do the right thing,
you should use it.

> +endef
> +
> +define SSLH_INSTALL_INIT_SYSV
> +  $(INSTALL) -m 755 -D package/sslh/S35sslh $(TARGET_DIR)/etc/init.d/S35sslh

This is OK, except the indentation: should be one tab, not some spaces.

Could you address those different issues (I believe they are all quite
easy to resolve) and submit an updated version of your patch?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2] sslh: new package
  2017-01-25 10:35   ` Thomas Petazzoni
@ 2017-01-25 11:20     ` David Bachelart
  0 siblings, 0 replies; 8+ messages in thread
From: David Bachelart @ 2017-01-25 11:20 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Sure, I'll submit a new patch.

Thanks

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170125/22e9b721/attachment.html>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2] sslh: new package
@ 2017-01-26  9:40 David Bachelart
  2017-01-26  9:47 ` Yegor Yefremov
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: David Bachelart @ 2017-01-26  9:40 UTC (permalink / raw)
  To: buildroot

Signed-off-by: David Bachelart <david.bachelart@bbright.com>
---
Changes v1 -> v2:
  - rewrite patch (suggested by Thomas Petazzoni). sslh version is 
    extracted from git, but this version is corrupted if we use git 
    as VCS for buildroot. This new patch is a more flexible way to 
    handle this : the version is now extracted from git only if the
    sslh directory is handled by git
  - fix comment in Config.in file (suggested by Thomas Petazzoni)
  - rewrite init script (suggested by Thomas Petazzoni)
  - remove sslh.default file (suggested by Thomas Petazzoni)
  - fix sslh.mk file (suggested by Thomas Petazzoni)
    - indentation
    - version now includes "v" prefix
    - fix license
    - use install target of upstream makefile
  - register myself as developer for sslh in DEVELOPERS file
---
 DEVELOPERS                                         |  1 +
 package/Config.in                                  |  1 +
 ...ion-while-building-sslh-in-a-larger-git-t.patch | 43 +++++++++++++++++++
 package/sslh/Config.in                             | 14 +++++++
 package/sslh/S35sslh                               | 48 ++++++++++++++++++++++
 package/sslh/sslh.hash                             |  4 ++
 package/sslh/sslh.mk                               | 28 +++++++++++++
 7 files changed, 139 insertions(+)
 create mode 100644 package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch
 create mode 100644 package/sslh/Config.in
 create mode 100644 package/sslh/S35sslh
 create mode 100644 package/sslh/sslh.hash
 create mode 100644 package/sslh/sslh.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 6fe8620..53d11d6 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -381,6 +381,7 @@ F:	package/ccrypt/
 F:	package/dos2unix/
 F:	package/ipmiutil/
 F:	package/python-daemon/
+F:	package/sslh/
 F:	package/udpxy/
 
 N:	David Bender <codehero@gmail.com>
diff --git a/package/Config.in b/package/Config.in
index 0023e7b..3b1f274 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1634,6 +1634,7 @@ endif
 	source "package/spice-protocol/Config.in"
 	source "package/squid/Config.in"
 	source "package/sshpass/Config.in"
+	source "package/sslh/Config.in"
 	source "package/strongswan/Config.in"
 	source "package/stunnel/Config.in"
 	source "package/tcpdump/Config.in"
diff --git a/package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch b/package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch
new file mode 100644
index 0000000..c77f769
--- /dev/null
+++ b/package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch
@@ -0,0 +1,43 @@
+From 0c39699da9a3d6534b6d26e7c9686ee76d81b64a Mon Sep 17 00:00:00 2001
+From: David Bachelart <david.bachelart@bbright.com>
+Date: Thu, 26 Jan 2017 10:07:47 +0100
+Subject: [PATCH 1/1] secure version while building sslh in a larger git tree
+
+sslh uses host git to extract its own version number. In buildroot, this
+is an issue since extracted information is conflicting with buildroot git
+status if we use git as VCS for buildroot.
+
+Since these git calls are legitimate only if git is used for the sslh
+subtree only, this patch adds a check : a .git directory has to exist at
+the root of the project to enable git-extracted version string.
+
+Signed-off-by: David Bachelart <david.bachelart@bbright.com>
+---
+ genver.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/genver.sh b/genver.sh
+index 79fd0a0..051e57b 100755
+--- a/genver.sh
++++ b/genver.sh
+@@ -7,7 +7,7 @@ else
+ 	QUIET=0
+ fi
+ 
+-if ! `(git status | grep -q "On branch") 2> /dev/null`; then
++if [ ! -d .git ] || ! `(git status | grep -q "On branch") 2> /dev/null`; then
+         # If we don't have git, we can't work out what
+         # version this is. It must have been downloaded as a
+         # zip file. 
+@@ -25,7 +25,7 @@ if ! `(git status | grep -q "On branch") 2> /dev/null`; then
+         fi
+ fi
+ 
+-if head=`git rev-parse --verify HEAD 2>/dev/null`; then
++if [ -d .git ]??&& head=`git rev-parse --verify HEAD 2>/dev/null`; then
+ 	# generate the version info based on the tag
+ 	release=`(git describe --tags || git --describe || git describe --all --long) \
+ 		2>/dev/null | tr -d '\n'`
+-- 
+2.1.4
+
diff --git a/package/sslh/Config.in b/package/sslh/Config.in
new file mode 100644
index 0000000..21bd65f
--- /dev/null
+++ b/package/sslh/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_SSLH
+	bool "sslh"
+	depends on BR2_INSTALL_LIBSTDCPP
+	# uses fork()
+	depends on BR2_USE_MMU
+	select BR2_PACKAGE_LIBCONFIG
+	help
+	  Applicative protocol multiplexer
+
+	  http://www.rutschle.net/tech/sslh.shtml
+
+comment "sslh needs a toolchain w/ C++"
+	depends on BR2_USE_MMU
+	depends on !BR2_INSTALL_LIBSTDCPP
diff --git a/package/sslh/S35sslh b/package/sslh/S35sslh
new file mode 100644
index 0000000..e2c0ef3
--- /dev/null
+++ b/package/sslh/S35sslh
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Starts the SSLH server
+#
+
+# default setup : listen on port 8090 forward ssh traffic to 
+# localhost:22 and http traffic to localhost:80
+SSLH_ARGS="--listen 0.0.0.0:8090 --ssh 127.0.0.1:22 --http 127.0.0.1:80"
+
+# Allow a few customizations from a config file (overrides
+# default setup)
+test -r /etc/default/sslh && . /etc/default/sslh
+
+start() {
+	SSLH_ARGS="$SSLH_ARGS --user root"
+	echo -n "Starting sslh: "
+	start-stop-daemon -S -q -p /var/run/sslh.pid \
+		--exec /usr/sbin/sslh -- $SSLH_ARGS
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+
+stop() {
+	printf "Stopping sslh: "
+	start-stop-daemon -K -q -p /var/run/sslh.pid
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+
+restart() {
+	stop
+	start
+}
+
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart|reload)
+  	restart
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
+
+exit $?
diff --git a/package/sslh/sslh.hash b/package/sslh/sslh.hash
new file mode 100644
index 0000000..8a3dce9
--- /dev/null
+++ b/package/sslh/sslh.hash
@@ -0,0 +1,4 @@
+# Locally calculated
+md5 0e3568d5d234516c634d4df156473298    sslh-v1.18.tar.gz
+sha1    b2e3a4314f62fc8200ecfbadefebe809a84d8099    sslh-v1.18.tar.gz
+sha256  1601a5b377dcafc6b47d2fbb8d4d25cceb83053a4adcc5874d501a2d5a7745ad    sslh-v1.18.tar.gz
diff --git a/package/sslh/sslh.mk b/package/sslh/sslh.mk
new file mode 100644
index 0000000..93df930
--- /dev/null
+++ b/package/sslh/sslh.mk
@@ -0,0 +1,28 @@
+################################################################################
+#
+# sslh
+#
+################################################################################
+
+SSLH_VERSION = v1.18
+SSLH_SITE = http://www.rutschle.net/tech
+SSLH_SOURCE = sslh-$(SSLH_VERSION).tar.gz
+SSLH_LICENSE = GPLv2+
+SSLH_LICENSE_FILES = COPYING
+
+SSLH_DEPENDENCIES = libconfig
+
+define SSLH_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef
+
+define SSLH_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR) 
+endef
+
+define SSLH_INSTALL_INIT_SYSV
+	$(INSTALL) -m 755 -D package/sslh/S35sslh $(TARGET_DIR)/etc/init.d/S35sslh
+endef
+
+$(eval $(generic-package))
+
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2] sslh: new package
  2017-01-26  9:40 [Buildroot] [PATCH v2] sslh: new package David Bachelart
@ 2017-01-26  9:47 ` Yegor Yefremov
  2017-01-27  8:37 ` Thomas Petazzoni
  2017-02-21 20:18 ` Thomas Petazzoni
  2 siblings, 0 replies; 8+ messages in thread
From: Yegor Yefremov @ 2017-01-26  9:47 UTC (permalink / raw)
  To: buildroot

Hi David,

On Thu, Jan 26, 2017 at 10:40 AM, David Bachelart
<david.bachelart@bbright.com> wrote:
> Signed-off-by: David Bachelart <david.bachelart@bbright.com>
> ---
> Changes v1 -> v2:
>   - rewrite patch (suggested by Thomas Petazzoni). sslh version is
>     extracted from git, but this version is corrupted if we use git
>     as VCS for buildroot. This new patch is a more flexible way to
>     handle this : the version is now extracted from git only if the
>     sslh directory is handled by git
>   - fix comment in Config.in file (suggested by Thomas Petazzoni)
>   - rewrite init script (suggested by Thomas Petazzoni)
>   - remove sslh.default file (suggested by Thomas Petazzoni)
>   - fix sslh.mk file (suggested by Thomas Petazzoni)
>     - indentation
>     - version now includes "v" prefix
>     - fix license
>     - use install target of upstream makefile
>   - register myself as developer for sslh in DEVELOPERS file
> ---
>  DEVELOPERS                                         |  1 +
>  package/Config.in                                  |  1 +
>  ...ion-while-building-sslh-in-a-larger-git-t.patch | 43 +++++++++++++++++++
>  package/sslh/Config.in                             | 14 +++++++
>  package/sslh/S35sslh                               | 48 ++++++++++++++++++++++
>  package/sslh/sslh.hash                             |  4 ++
>  package/sslh/sslh.mk                               | 28 +++++++++++++
>  7 files changed, 139 insertions(+)
>  create mode 100644 package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch
>  create mode 100644 package/sslh/Config.in
>  create mode 100644 package/sslh/S35sslh
>  create mode 100644 package/sslh/sslh.hash
>  create mode 100644 package/sslh/sslh.mk
>
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 6fe8620..53d11d6 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -381,6 +381,7 @@ F:  package/ccrypt/
>  F:     package/dos2unix/
>  F:     package/ipmiutil/
>  F:     package/python-daemon/
> +F:     package/sslh/
>  F:     package/udpxy/
>
>  N:     David Bender <codehero@gmail.com>
> diff --git a/package/Config.in b/package/Config.in
> index 0023e7b..3b1f274 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1634,6 +1634,7 @@ endif
>         source "package/spice-protocol/Config.in"
>         source "package/squid/Config.in"
>         source "package/sshpass/Config.in"
> +       source "package/sslh/Config.in"
>         source "package/strongswan/Config.in"
>         source "package/stunnel/Config.in"
>         source "package/tcpdump/Config.in"
> diff --git a/package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch b/package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch
> new file mode 100644
> index 0000000..c77f769
> --- /dev/null
> +++ b/package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch
> @@ -0,0 +1,43 @@
> +From 0c39699da9a3d6534b6d26e7c9686ee76d81b64a Mon Sep 17 00:00:00 2001
> +From: David Bachelart <david.bachelart@bbright.com>
> +Date: Thu, 26 Jan 2017 10:07:47 +0100
> +Subject: [PATCH 1/1] secure version while building sslh in a larger git tree
> +
> +sslh uses host git to extract its own version number. In buildroot, this
> +is an issue since extracted information is conflicting with buildroot git
> +status if we use git as VCS for buildroot.
> +
> +Since these git calls are legitimate only if git is used for the sslh
> +subtree only, this patch adds a check : a .git directory has to exist at
> +the root of the project to enable git-extracted version string.
> +
> +Signed-off-by: David Bachelart <david.bachelart@bbright.com>
> +---
> + genver.sh | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/genver.sh b/genver.sh
> +index 79fd0a0..051e57b 100755
> +--- a/genver.sh
> ++++ b/genver.sh
> +@@ -7,7 +7,7 @@ else
> +       QUIET=0
> + fi
> +
> +-if ! `(git status | grep -q "On branch") 2> /dev/null`; then
> ++if [ ! -d .git ] || ! `(git status | grep -q "On branch") 2> /dev/null`; then
> +         # If we don't have git, we can't work out what
> +         # version this is. It must have been downloaded as a
> +         # zip file.
> +@@ -25,7 +25,7 @@ if ! `(git status | grep -q "On branch") 2> /dev/null`; then
> +         fi
> + fi
> +
> +-if head=`git rev-parse --verify HEAD 2>/dev/null`; then
> ++if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
> +       # generate the version info based on the tag
> +       release=`(git describe --tags || git --describe || git describe --all --long) \
> +               2>/dev/null | tr -d '\n'`
> +--
> +2.1.4
> +
> diff --git a/package/sslh/Config.in b/package/sslh/Config.in
> new file mode 100644
> index 0000000..21bd65f
> --- /dev/null
> +++ b/package/sslh/Config.in
> @@ -0,0 +1,14 @@
> +config BR2_PACKAGE_SSLH
> +       bool "sslh"
> +       depends on BR2_INSTALL_LIBSTDCPP
> +       # uses fork()
> +       depends on BR2_USE_MMU
> +       select BR2_PACKAGE_LIBCONFIG
> +       help
> +         Applicative protocol multiplexer
> +
> +         http://www.rutschle.net/tech/sslh.shtml
> +
> +comment "sslh needs a toolchain w/ C++"
> +       depends on BR2_USE_MMU
> +       depends on !BR2_INSTALL_LIBSTDCPP
> diff --git a/package/sslh/S35sslh b/package/sslh/S35sslh
> new file mode 100644
> index 0000000..e2c0ef3
> --- /dev/null
> +++ b/package/sslh/S35sslh
> @@ -0,0 +1,48 @@
> +#!/bin/sh
> +#
> +# Starts the SSLH server
> +#
> +
> +# default setup : listen on port 8090 forward ssh traffic to
> +# localhost:22 and http traffic to localhost:80
> +SSLH_ARGS="--listen 0.0.0.0:8090 --ssh 127.0.0.1:22 --http 127.0.0.1:80"
> +
> +# Allow a few customizations from a config file (overrides
> +# default setup)
> +test -r /etc/default/sslh && . /etc/default/sslh
> +
> +start() {
> +       SSLH_ARGS="$SSLH_ARGS --user root"
> +       echo -n "Starting sslh: "
> +       start-stop-daemon -S -q -p /var/run/sslh.pid \
> +               --exec /usr/sbin/sslh -- $SSLH_ARGS
> +       [ $? = 0 ] && echo "OK" || echo "FAIL"
> +}
> +
> +stop() {
> +       printf "Stopping sslh: "
> +       start-stop-daemon -K -q -p /var/run/sslh.pid
> +       [ $? = 0 ] && echo "OK" || echo "FAIL"
> +}
> +
> +restart() {
> +       stop
> +       start
> +}
> +
> +case "$1" in
> +  start)
> +       start
> +       ;;
> +  stop)
> +       stop
> +       ;;
> +  restart|reload)
> +       restart
> +       ;;
> +  *)
> +       echo "Usage: $0 {start|stop|restart}"
> +       exit 1
> +esac
> +
> +exit $?
> diff --git a/package/sslh/sslh.hash b/package/sslh/sslh.hash
> new file mode 100644
> index 0000000..8a3dce9
> --- /dev/null
> +++ b/package/sslh/sslh.hash
> @@ -0,0 +1,4 @@
> +# Locally calculated
> +md5 0e3568d5d234516c634d4df156473298    sslh-v1.18.tar.gz
> +sha1    b2e3a4314f62fc8200ecfbadefebe809a84d8099    sslh-v1.18.tar.gz
> +sha256  1601a5b377dcafc6b47d2fbb8d4d25cceb83053a4adcc5874d501a2d5a7745ad    sslh-v1.18.tar.gz

why so many checksums? sha256  is sufficient

Yegor

> diff --git a/package/sslh/sslh.mk b/package/sslh/sslh.mk
> new file mode 100644
> index 0000000..93df930
> --- /dev/null
> +++ b/package/sslh/sslh.mk
> @@ -0,0 +1,28 @@
> +################################################################################
> +#
> +# sslh
> +#
> +################################################################################
> +
> +SSLH_VERSION = v1.18
> +SSLH_SITE = http://www.rutschle.net/tech
> +SSLH_SOURCE = sslh-$(SSLH_VERSION).tar.gz
> +SSLH_LICENSE = GPLv2+
> +SSLH_LICENSE_FILES = COPYING
> +
> +SSLH_DEPENDENCIES = libconfig
> +
> +define SSLH_BUILD_CMDS
> +       $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
> +endef
> +
> +define SSLH_INSTALL_TARGET_CMDS
> +       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install DESTDIR=$(TARGET_DIR)
> +endef
> +
> +define SSLH_INSTALL_INIT_SYSV
> +       $(INSTALL) -m 755 -D package/sslh/S35sslh $(TARGET_DIR)/etc/init.d/S35sslh
> +endef
> +
> +$(eval $(generic-package))
> +
> --
> 2.1.4
>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2] sslh: new package
  2017-01-26  9:40 [Buildroot] [PATCH v2] sslh: new package David Bachelart
  2017-01-26  9:47 ` Yegor Yefremov
@ 2017-01-27  8:37 ` Thomas Petazzoni
  2017-02-21 20:18 ` Thomas Petazzoni
  2 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2017-01-27  8:37 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 26 Jan 2017 10:40:36 +0100, David Bachelart wrote:
> Signed-off-by: David Bachelart <david.bachelart@bbright.com>
> ---
> Changes v1 -> v2:
>   - rewrite patch (suggested by Thomas Petazzoni). sslh version is 
>     extracted from git, but this version is corrupted if we use git 
>     as VCS for buildroot. This new patch is a more flexible way to 
>     handle this : the version is now extracted from git only if the
>     sslh directory is handled by git
>   - fix comment in Config.in file (suggested by Thomas Petazzoni)
>   - rewrite init script (suggested by Thomas Petazzoni)
>   - remove sslh.default file (suggested by Thomas Petazzoni)
>   - fix sslh.mk file (suggested by Thomas Petazzoni)
>     - indentation
>     - version now includes "v" prefix
>     - fix license
>     - use install target of upstream makefile
>   - register myself as developer for sslh in DEVELOPERS file
> ---
>  DEVELOPERS                                         |  1 +
>  package/Config.in                                  |  1 +
>  ...ion-while-building-sslh-in-a-larger-git-t.patch | 43 +++++++++++++++++++
>  package/sslh/Config.in                             | 14 +++++++
>  package/sslh/S35sslh                               | 48 ++++++++++++++++++++++
>  package/sslh/sslh.hash                             |  4 ++
>  package/sslh/sslh.mk                               | 28 +++++++++++++
>  7 files changed, 139 insertions(+)
>  create mode 100644 package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch
>  create mode 100644 package/sslh/Config.in
>  create mode 100644 package/sslh/S35sslh
>  create mode 100644 package/sslh/sslh.hash
>  create mode 100644 package/sslh/sslh.mk

I've applied to master, after doing the following changes:

    [Thomas:
     - fix download location
     - remove <pkg>_SOURCE variable, it was the default value
     - remove trailing space
     - keep only sha256 hash.]

The biggest problem was the download location: it was just wrong, and
it couldn't even download the tarball.

Thanks for your contribution!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2] sslh: new package
  2017-01-26  9:40 [Buildroot] [PATCH v2] sslh: new package David Bachelart
  2017-01-26  9:47 ` Yegor Yefremov
  2017-01-27  8:37 ` Thomas Petazzoni
@ 2017-02-21 20:18 ` Thomas Petazzoni
  2017-02-21 21:03   ` Yann E. MORIN
  2 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni @ 2017-02-21 20:18 UTC (permalink / raw)
  To: buildroot

Hello,

On Thu, 26 Jan 2017 10:40:36 +0100, David Bachelart wrote:
> Signed-off-by: David Bachelart <david.bachelart@bbright.com>
> ---
> Changes v1 -> v2:
>   - rewrite patch (suggested by Thomas Petazzoni). sslh version is 
>     extracted from git, but this version is corrupted if we use git 
>     as VCS for buildroot. This new patch is a more flexible way to 
>     handle this : the version is now extracted from git only if the
>     sslh directory is handled by git
>   - fix comment in Config.in file (suggested by Thomas Petazzoni)
>   - rewrite init script (suggested by Thomas Petazzoni)
>   - remove sslh.default file (suggested by Thomas Petazzoni)
>   - fix sslh.mk file (suggested by Thomas Petazzoni)
>     - indentation
>     - version now includes "v" prefix
>     - fix license
>     - use install target of upstream makefile
>   - register myself as developer for sslh in DEVELOPERS file
> ---
>  DEVELOPERS                                         |  1 +
>  package/Config.in                                  |  1 +
>  ...ion-while-building-sslh-in-a-larger-git-t.patch | 43 +++++++++++++++++++
>  package/sslh/Config.in                             | 14 +++++++
>  package/sslh/S35sslh                               | 48 ++++++++++++++++++++++
>  package/sslh/sslh.hash                             |  4 ++
>  package/sslh/sslh.mk                               | 28 +++++++++++++
>  7 files changed, 139 insertions(+)
>  create mode 100644 package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch
>  create mode 100644 package/sslh/Config.in
>  create mode 100644 package/sslh/S35sslh
>  create mode 100644 package/sslh/sslh.hash
>  create mode 100644 package/sslh/sslh.mk

This package is causing some build failures:

  http://autobuild.buildroot.net/?reason=sslh-v1.18

Could you investigate and provide a fix for this issue ?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v2] sslh: new package
  2017-02-21 20:18 ` Thomas Petazzoni
@ 2017-02-21 21:03   ` Yann E. MORIN
  0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2017-02-21 21:03 UTC (permalink / raw)
  To: buildroot

Thomas, David, All,

On 2017-02-21 21:18 +0100, Thomas Petazzoni spake thusly:
> On Thu, 26 Jan 2017 10:40:36 +0100, David Bachelart wrote:
> > Signed-off-by: David Bachelart <david.bachelart@bbright.com>
> > ---
> > Changes v1 -> v2:
> >   - rewrite patch (suggested by Thomas Petazzoni). sslh version is 
> >     extracted from git, but this version is corrupted if we use git 
> >     as VCS for buildroot. This new patch is a more flexible way to 
> >     handle this : the version is now extracted from git only if the
> >     sslh directory is handled by git
> >   - fix comment in Config.in file (suggested by Thomas Petazzoni)
> >   - rewrite init script (suggested by Thomas Petazzoni)
> >   - remove sslh.default file (suggested by Thomas Petazzoni)
> >   - fix sslh.mk file (suggested by Thomas Petazzoni)
> >     - indentation
> >     - version now includes "v" prefix
> >     - fix license
> >     - use install target of upstream makefile
> >   - register myself as developer for sslh in DEVELOPERS file
> > ---
> >  DEVELOPERS                                         |  1 +
> >  package/Config.in                                  |  1 +
> >  ...ion-while-building-sslh-in-a-larger-git-t.patch | 43 +++++++++++++++++++
> >  package/sslh/Config.in                             | 14 +++++++
> >  package/sslh/S35sslh                               | 48 ++++++++++++++++++++++
> >  package/sslh/sslh.hash                             |  4 ++
> >  package/sslh/sslh.mk                               | 28 +++++++++++++
> >  7 files changed, 139 insertions(+)
> >  create mode 100644 package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch
> >  create mode 100644 package/sslh/Config.in
> >  create mode 100644 package/sslh/S35sslh
> >  create mode 100644 package/sslh/sslh.hash
> >  create mode 100644 package/sslh/sslh.mk
> 
> This package is causing some build failures:
> 
>   http://autobuild.buildroot.net/?reason=sslh-v1.18
> 
> Could you investigate and provide a fix for this issue ?

The issue is caused by a UTF-* non-breaj sapce U+c2a0 on line 28 of the
script genver.sh. This should be replaced by an ASCII U+20 space.

It is usually invisible in most editors. I can see it because my vim has
a plugin that highlights such troll characters.

Patch incoming...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-02-21 21:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-26  9:40 [Buildroot] [PATCH v2] sslh: new package David Bachelart
2017-01-26  9:47 ` Yegor Yefremov
2017-01-27  8:37 ` Thomas Petazzoni
2017-02-21 20:18 ` Thomas Petazzoni
2017-02-21 21:03   ` Yann E. MORIN
  -- strict thread matches above, loose matches on Subject: below --
2017-01-02 15:45 [Buildroot] [PATCH v2] ifenslave: " David Bachelart
2017-01-02 15:45 ` [Buildroot] [PATCH v2] sslh: " David Bachelart
2017-01-25 10:35   ` Thomas Petazzoni
2017-01-25 11:20     ` David Bachelart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox