libuecc: add new package
PATCH 1/2 libuecc: add new package
This package is a small library used for the Freifunk Gluon project and will be used by other upcoming packages. It's my first buildroot package and I tried to follow the documentation as close as possible, however as you might suppose I'm open for any suggestions.
--- package/Config.in | 1 + package/libuecc/Config.in | 6 ++++++ package/libuecc/libuecc.mk | 13 +++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 package/libuecc/Config.in create mode 100644 package/libuecc/libuecc.mk
package/Config.in +1 -0
@@ -763,6 +763,7 @@ menu "Crypto" source "package/libsodium/Config.in" source "package/libssh/Config.in" source "package/libssh2/Config.in" + source "package/libuecc/Config.in" source "package/nettle/Config.in" source "package/openssl/Config.in" source "package/polarssl/Config.in"
package/libuecc/Config.in new file +6 -0
@@ -0,0 +1,6 @@ +config BR2_PACKAGE_LIBUECC + bool "libuecc" + help + Very small Elliptic Curve Cryptography library + + http://git.universe-factory.net/libuecc
package/libuecc/libuecc.mk new file +13 -0
@@ -0,0 +1,13 @@ +################################################################################ +# +# libuecc +# +################################################################################ + +LIBUECC_VERSION = v6 +LIBUECC_SITE = git://git.universe-factory.net/libuecc +LIBUECC_LICENSE = BSD-2c +LIBUECC_LICENSE_FILES = COPYRIGHT +LIBUECC_INSTALL_STAGING = YES + +$(eval $(cmake-package))
Signature · 1 line
2.1.4
PATCH 2/2 fastd: add new package
This is a new package for the fastd "Fast and Secure Tunneling Daemon" which was developed for the Freifunk Gluon project in the first place. It's one of my first buildroot packages and I tried to follow the developer guide, if something can be improved I'm open for suggestions. I hope I covered the necessary build options and set reasonable defaults. Included is a patch to allow cross compiling with toolchains without LTO support which fails with the unpatched version due to some ugly cmake hacks in fastd v17, details in the patch.
---
Compiles succesfully with the following default configs:
* beaglebone_defconfig
* cubieboard_defconfig
* qemu_x86_64_defconfig
* qemu_x86_defconfig
* raspberrypi2_defconfig
* raspberrypi_defconfig
* wandboard_defconfig
--- package/Config.in | 1 + ...NTERPROCEDURAL_OPTIMIZATION-target-proper.patch | 84 ++++++++++++++++++++++ package/fastd/Config.in | 30 ++++++++ package/fastd/fastd.mk | 40 +++++++++++ 4 files changed, 155 insertions(+) create mode 100644 package/fastd/0001-cmake-use-INTERPROCEDURAL_OPTIMIZATION-target-proper.patch create mode 100644 package/fastd/Config.in create mode 100644 package/fastd/fastd.mk
package/Config.in +1 -0
@@ -1249,6 +1249,7 @@ endif source "package/ejabberd/Config.in" source "package/ethtool/Config.in" source "package/faifa/Config.in" + source "package/fastd/Config.in" source "package/fcgiwrap/Config.in" source "package/fmc/Config.in" source "package/foomatic-filters/Config.in"
package/fastd/0001-cmake-use-INTERPROCEDURAL_OPTIMIZATION-target-proper.patch new file +84 -0
84 lines not on this page · raw message
package/fastd/Config.in new file +30 -0
@@ -0,0 +1,30 @@ +config BR2_PACKAGE_FASTD + bool "fastd" + depends on BR2_TOOLCHAIN_HAS_THREADS + select BR2_PACKAGE_LIBUECC + select BR2_PACKAGE_LIBSODIUM + select BR2_PACKAGE_LIBCAP + help + Fast and Secure Tunneling Daemon + + https://projects.universe-factory.net/projects/fastd/wiki + +if BR2_PACKAGE_FASTD + +config BR2_PACKAGE_FASTD_OPENSSL + bool "OpenSSL support" + select BR2_PACKAGE_OPENSSL + help + Build with OpenSSL support. + +config BR2_PACKAGE_FASTD_STATUS_SOCKET + bool "with status socket" + default y + select BR2_PACKAGE_JSON_C + help + Enable support for a socket to get fastd's status. + +endif + +comment "fastd needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS
package/fastd/fastd.mk new file +40 -0
@@ -0,0 +1,40 @@ +################################################################################ +# +# fastd +# +################################################################################ + +FASTD_VERSION = v17 +FASTD_SITE = git://git.universe-factory.net/fastd +FASTD_LICENSE = BSD-2c +FASTD_LICENSE_FILES = COPYRIGHT +FASTD_CONF_OPTS = -DENABLE_LIBSODIUM=ON -DWITH_CAPABILITIES=TRUE +FASTD_DEPENDENCIES = libuecc libsodium libcap + +ifeq ($(BR2_PACKAGE_OPENSSL),y) +FASTD_CONF_OPTS += -DENABLE_OPENSSL=ON +FASTD_DEPENDENCIES += openssl +else +FASTD_CONF_OPTS += -DENABLE_OPENSSL=OFF +endif + +ifeq ($(BR2_PACKAGE_FASTD_STATUS_SOCKET),y) +FASTD_CONF_OPTS += -DWITH_STATUS_SOCKET=TRUE +FASTD_DEPENDENCIES += json-c +else +FASTD_CONF_OPTS += -DWITH_STATUS_SOCKET=FALSE +endif + +ifeq ($(BR2_INIT_SYSTEMD),y) +FASTD_CONF_OPTS += -DENABLE_SYSTEMD=ON +else +FASTD_CONF_OPTS += -DENABLE_SYSTEMD=OFF +endif + +ifeq ($(BR2_GCC_ENABLE_LTO),y) +FASTD_CONF_OPTS += -DENABLE_LTO=ON +else +FASTD_CONF_OPTS += -DENABLE_LTO=OFF +endif + +$(eval $(cmake-package))
Signature · 1 line
2.1.4
PATCH 2/2 fastd: add new package
Dear Alexander Dahl,
Quoted 8 lines · Alexander Dahl
This is a new package for the fastd "Fast and Secure Tunneling Daemon" which was developed for the Freifunk Gluon project in the first place. It's one of my first buildroot packages and I tried to follow the developer guide, if something can be improved I'm open for suggestions. I hope I covered the necessary build options and set reasonable defaults. Included is a patch to allow cross compiling with toolchains without LTO support which fails with the unpatched version due to some ugly cmake hacks in fastd v17, details in the patch.
This commit log again contained some "personal" messages, so I reworded it.
I also did a few other changes:
[Thomas:
- Get rid of trailing spaces in Config.in
- Remove the BR2_PACKAGE_FASTD_OPENSSL, and simply rely on BR2_PACKAGE_OPENSSL
- Remove -DWITH_CAPABILITIES=TRUE, since libcap support is anyway mandatory.
- Use ON/OFF instead of TRUE/FALSE.]
and then applied your patch.
Could you submit your LTO related patch to the upstream project and get it merged, so that next time we update the fastd package we can get rid of the patch?
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 2/2 fastd: add new package
Hei Thomas,
Am 2015-11-04 22:21, schrieb Thomas Petazzoni:
Quoted 2 lines
This commit log again contained some "personal" messages, so I reworded it.
Okay, I understand. :-)
Quoted 4 lines
I also did a few other changes:
[Thomas:
- Get rid of trailing spaces in Config.in
Sorry, I usually check this before committing. :-/
Quoted 2 lines
- Remove the
BR2_PACKAGE_FASTD_OPENSSL, and simply rely onBR2_PACKAGE_OPENSSL
I'm not sure if I like this, because it is less flexible, but if this is common practice in buildroot, okay.
Quoted 2 lines
- Remove -DWITH_CAPABILITIES=TRUE, since libcap support is anyway mandatory.
Buildroot builds only Linux based systems, right? Then fastd sets this to ON by itself in cmake/config.cmake so it can be removed, okay.
Quoted 3 lines
Could you submit your LTO related patch to the upstream project and get it merged, so that next time we update the fastd package we can get rid of the patch?
I suppose the upstream author will not apply it. I had a somewhat long discussion in IRC with him. As stated in the patch his goal is to use LTO to reduce binary size (binaries compiled with lto are actually smaller and on a device with 4 MB flash this matters). However the cmake approach (as I understood the cmake docs, which are very thin on this topic) is like presented in my patch (which in fact does not work, but I would just wait for an upcoming cmake version getting this right).
What I tried first was just setting -DENABLE_LTO=OFF which was not enough, compiling failed, because of the cmake hacks included in fastd choosing wrong binutils. This hack is removed by my patch. In OpenWRT the fastd author got a patch upstream enabling the plugins option in the toolchain. I assumed this would not work with buildroot where you have fine grained options to configure the toolchain.
Another option would for the fastd buildroot package could be to require a toolchain with LTO support and just enable the related cmake option.
Thanks for review. :-)
Alex
Signature · 4 lines
?With the first link, the chain is forged. The first speech censured, the first thought forbidden, the first freedom denied, chains us all irrevocably.? (Jean-Luc Picard, quoting Judge Aaron Satie) *** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601 D1D5 8FBA 7744 CC87 10D0 ***
Thomas Petazzoni
AppliedPATCH 1/2 libuecc: add new package
In reply to Alexander DahlDear Alexander Dahl,
Quoted 5 lines · Alexander Dahl
This package is a small library used for the Freifunk Gluon project and will be used by other upcoming packages. It's my first buildroot package and I tried to follow the documentation as close as possible, however as you might suppose I'm open for any suggestions.
Quoted 8 lines
Signed-off-by Alexander Dahl <[email protected]>--- package/Config.in | 1 + package/libuecc/Config.in | 6 ++++++ package/libuecc/libuecc.mk | 13 +++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 package/libuecc/Config.in create mode 100644 package/libuecc/libuecc.mk
I've applied your patch, thanks! There were two minor issues:
- The commit log should not contain some "personal" messages such as "It's my first buildroot package...". The contents of the commit log is kept forever in the project history. If you want to include such "personal/contextual" messages, put them either in a separate e-mail (called the cover letter) or under the --- sign below the Signed-off-by line.
- There was a line with trailing spaces in Config.in.
Other than that, looked good to, so applied!
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com