[LEDE-DEV] [PATCH] mdadm: Fix config generation

2017-10-06 Thread Rosen Penev
The init script generated something like "DEVICE=/dev/sda" when it should have 
been generating "DEVICE /dev/sda". mdadm errors on this. Patch by jow.

Also changed the default sendmail path to /usr/sbin/sendmail. No package in 
LEDE provides /sbin/sendmail. msmtp provides /usr/sbin/sendmail so use that.

Also add a patch to fix file paths for mdadm runtime files. mdadm currently 
errors on them since /run is missing. Once /run is added to stock LEDE, this 
patch can be removed.

Signed-off-by: Rosen Penev 
---
 package/utils/mdadm/Makefile   |  2 +-
 package/utils/mdadm/files/mdadm.init   | 11 
 .../utils/mdadm/patches/201-Fix-directories.patch  | 31 ++
 3 files changed, 37 insertions(+), 7 deletions(-)
 create mode 100644 package/utils/mdadm/patches/201-Fix-directories.patch

diff --git a/package/utils/mdadm/Makefile b/package/utils/mdadm/Makefile
index 1ed62d8174..5b2aa8e172 100644
--- a/package/utils/mdadm/Makefile
+++ b/package/utils/mdadm/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mdadm
 PKG_VERSION:=4.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
diff --git a/package/utils/mdadm/files/mdadm.init 
b/package/utils/mdadm/files/mdadm.init
index e6624a776e..64a50b35de 100644
--- a/package/utils/mdadm/files/mdadm.init
+++ b/package/utils/mdadm/files/mdadm.init
@@ -34,14 +34,13 @@ mdadm_common() {
local cfg="$1"
local email devices
 
-   if [ -x /sbin/sendmail ]; then
-   append_option email "$cfg" email "MAILADDR"
-
+   if [ -x /usr/sbin/sendmail ]; then
+   config_get email "$cfg" email
+   [ -n "$email" ] && printf "MAILADDR %s\n" "$email" >> $CONF
fi
 
-   append_option devices "$cfg" devices DEVICE " "
-
-   printf "%s\n%s\n" "$email" "$devices" >> $CONF
+   config_list_foreach "$cfg" devices append_list_item devices " "
+   [ -n "$devices" ] && printf "DEVICE %s\n" "$devices" >> $CONF
 }
 
 mdadm_array() {
diff --git a/package/utils/mdadm/patches/201-Fix-directories.patch 
b/package/utils/mdadm/patches/201-Fix-directories.patch
new file mode 100644
index 00..c795441b27
--- /dev/null
+++ b/package/utils/mdadm/patches/201-Fix-directories.patch
@@ -0,0 +1,31 @@
+diff --git a/mdadm.h b/mdadm.h
+index 71b8afb..1d8fca3 100644
+--- a/mdadm.h
 b/mdadm.h
+@@ -103,7 +103,7 @@ struct dlm_lksb {
+  * /run  seems to have emerged as the best standard.
+  */
+ #ifndef MAP_DIR
+-#define MAP_DIR "/run/mdadm"
++#define MAP_DIR "/tmp/run/mdadm"
+ #endif /* MAP_DIR */
+ /* MAP_FILE is what we name the map file we put in MAP_DIR, in case you
+  * want something other than the default of "map"
+@@ -120,7 +120,7 @@ struct dlm_lksb {
+  * boot process and stays up as long as possible during shutdown.
+  */
+ #ifndef MDMON_DIR
+-#define MDMON_DIR "/run/mdadm"
++#define MDMON_DIR "/tmp/run/mdadm"
+ #endif /* MDMON_DIR */
+ 
+ /* FAILED_SLOTS is where to save files storing recent removal of array
+@@ -128,7 +128,7 @@ struct dlm_lksb {
+  * slot for array recovery
+  */
+ #ifndef FAILED_SLOTS_DIR
+-#define FAILED_SLOTS_DIR "/run/mdadm/failed-slots"
++#define FAILED_SLOTS_DIR "/tmp/run/mdadm/failed-slots"
+ #endif /* FAILED_SLOTS */
+ 
+ #include  "md_u.h"
-- 
2.13.6


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 0/2] add nghttp2 support in curl

2017-10-06 Thread Hans Dedecker
Patche series add nghttp2 support to curl; as the nghttp2 lib was not
yet available in the source tree it's added in the libs folder.

Hans Dedecker (2):
  nghttp2: add libnghttp2 package
  curl: add nghttp2 support

 package/libs/nghttp2/Makefile| 47 
 package/network/utils/curl/Config.in |  4 +++
 package/network/utils/curl/Makefile  |  7 --
 3 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 package/libs/nghttp2/Makefile

-- 
1.9.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 2/2] curl: add nghttp2 support

2017-10-06 Thread Hans Dedecker
Add config option support for nghttp2

Signed-off-by: Hans Dedecker 
---
 package/network/utils/curl/Config.in | 4 
 package/network/utils/curl/Makefile  | 7 +--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/curl/Config.in 
b/package/network/utils/curl/Config.in
index 6f72134..973da3d 100644
--- a/package/network/utils/curl/Config.in
+++ b/package/network/utils/curl/Config.in
@@ -101,6 +101,10 @@ config LIBCURL_TFTP
bool "TFTP protocol"
default n
 
+config LIBCURL_NGHTTP2
+   bool "HTTP2 protocol"
+   default n
+
 comment "Miscellaneous"
 
 config LIBCURL_PROXY
diff --git a/package/network/utils/curl/Makefile 
b/package/network/utils/curl/Makefile
index 330d8d5..634da04 100644
--- a/package/network/utils/curl/Makefile
+++ b/package/network/utils/curl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=curl
 PKG_VERSION:=7.55.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \
@@ -53,6 +53,7 @@ PKG_CONFIG_DEPENDS:= \
   CONFIG_LIBCURL_SMTP \
   CONFIG_LIBCURL_TELNET \
   CONFIG_LIBCURL_TFTP \
+  CONFIG_LIBCURL_NGHTTP2 \
   \
   CONFIG_LIBCURL_COOKIES \
   CONFIG_LIBCURL_CRYPTO_AUTH \
@@ -85,7 +86,8 @@ define Package/libcurl
   SECTION:=libs
   CATEGORY:=Libraries
   DEPENDS:= +LIBCURL_WOLFSSL:libwolfssl +LIBCURL_OPENSSL:libopenssl 
+LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls
-  DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread 
+LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn +LIBCURL_SSH2:libssh2
+  DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread 
+LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn
+  DEPENDS += +LIBCURL_SSH2:libssh2 +LIBCURL_NGHTTP2:libnghttp2
   TITLE:=A client-side URL transfer library
   MENU:=1
 endef
@@ -119,6 +121,7 @@ CONFIGURE_ARGS += \
$(if 
$(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \
$(if 
$(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \
$(if 
$(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \
+   $(if 
$(CONFIG_LIBCURL_NGHTTP2),--with-nghttp2="$(STAGING_DIR)/usr",--without-nghttp2)
 \
\
$(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \
$(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \
-- 
1.9.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 1/2] nghttp2: add libnghttp2 package

2017-10-06 Thread Hans Dedecker
The nghttp2 library is an implementation of the Hypertext Transfer
Protocol version 2 in C; it supports RFC7540 and RFC7541.
The package enables only the reusable C library; binary size is 130K (X86)

Signed-off-by: Hans Dedecker 
---
 package/libs/nghttp2/Makefile | 47 +++
 1 file changed, 47 insertions(+)
 create mode 100644 package/libs/nghttp2/Makefile

diff --git a/package/libs/nghttp2/Makefile b/package/libs/nghttp2/Makefile
new file mode 100644
index 000..0a21d12
--- /dev/null
+++ b/package/libs/nghttp2/Makefile
@@ -0,0 +1,47 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nghttp2
+PKG_VERSION:=1.26.0
+PKG_RELEASE:=1
+PKG_SOURCE_URL:=https://github.com/nghttp2/nghttp2.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=0389af5724010627e19425237e9e5e0bf343bc6f
+PKG_SOURCE_DIR:=$(PKG_NAME)
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MIRROR_HASH:=e7d6d6239cb5a6957b9aafe22a15ea01fafefdf472eff84ec959bb31c5023f79
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libnghttp2
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Library implementing the framing layer of HTTP/2
+  MAINTAINER:=Hans Dedecker 
+endef
+
+define Package/libnghttp2/description
+ C library implementing the framing layer of the HTTP/2 protocol. It can be 
used to build a HTTP/2-capable HTTP client or server
+endef
+
+CMAKE_OPTIONS += \
+-DENABLE_LIB_ONLY=ON
+
+define Build/InstallDev
+   $(INSTALL_DIR) $(1)/usr/include/nghttp2
+   $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/nghttp2/*.h 
$(1)/usr/include/nghttp2/
+   $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+   $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc 
$(1)/usr/lib/pkgconfig/
+   $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib/
+endef
+
+define Package/libnghttp2/install
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libnghttp2))
-- 
1.9.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] Patch accept ETA

2017-10-06 Thread Robert Marko
Hi,
I am wondering is there an ETA on accepting the following patch?
https://patchwork.ozlabs.org/patch/819610/

I have PR ready to support LigoWawe DLB Propeller 5 but it depends on
that patch.
Otherwise, I get kernel panics during booting.


Thanks

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH netifd] system-linux: add support for hotplug event 'move'

2017-10-06 Thread Hans Dedecker
On Thu, Sep 28, 2017 at 10:32 AM, Martin Schiller  wrote:
> If you rename a network interface, there is a move uevent
> invoked instead of remove/add.
>
> This patch adds support for this kind of event.
>
> Signed-off-by: Martin Schiller 
Acked-by: Hans Dedecker 
> ---
>  system-linux.c | 31 ---
>  1 file changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/system-linux.c b/system-linux.c
> index 6d97a02..e2017d0 100644
> --- a/system-linux.c
> +++ b/system-linux.c
> @@ -543,16 +543,20 @@ out:
>  static void
>  handle_hotplug_msg(char *data, int size)
>  {
> -   const char *subsystem = NULL, *interface = NULL;
> +   const char *subsystem = NULL, *interface = NULL, *interface_old = 
> NULL;
> char *cur, *end, *sep;
> struct device *dev;
> int skip;
> -   bool add;
> +   bool add, move = false;
>
> if (!strncmp(data, "add@", 4))
> add = true;
> else if (!strncmp(data, "remove@", 7))
> add = false;
> +   else if (!strncmp(data, "move@", 5)) {
> +   add = true;
> +   move = true;
> +   }
> else
> return;
>
> @@ -574,11 +578,32 @@ handle_hotplug_msg(char *data, int size)
> if (strcmp(subsystem, "net") != 0)
> return;
> }
> -   if (subsystem && interface)
> +   else if (!strcmp(cur, "DEVPATH_OLD")) {
> +   interface_old = strrchr(sep + 1, '/');
> +   if (interface_old)
> +   interface_old++;
> +   }
> +   }
> +
> +   if (subsystem && interface) {
> +   if (move && interface_old)
> +   goto move;
> +   else
> goto found;
> }
> +
> return;
>
> +move:
> +   dev = device_find(interface_old);
> +   if (!dev)
> +   goto found;
> +
> +   if (dev->type != &simple_device_type)
> +   goto found;
> +
> +   device_set_present(dev, false);
> +
>  found:
> dev = device_find(interface);
> if (!dev)
> --
> 2.11.0
>
>
> ___
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Fix NULL pointer dereferece in at803x_link_change_notify()

2017-10-06 Thread John Crispin

Hi,

the subject is missing the prefix


On 28/09/17 15:27, Andrey Jr. Melnikov wrote:

Hello.

please drop the line above


Fix NULL pointer dereferece in at803x_link_change_notify().

you just copied the subject here. please explain the bug instead.

    John

Signed-Off-by: "Andrey Jr. Melnikov" 

--

diff --git 
a/target/linux/ar71xx/patches-4.4/902-at803x-add-reset-gpio-pdata.patch 
b/target/linux/ar71xx/patches-4.4/902-at803x-add-reset-gpio-pdata.patch
index 2244f882e7..efc8502bcd 100644
--- a/target/linux/ar71xx/patches-4.4/902-at803x-add-reset-gpio-pdata.patch
+++ b/target/linux/ar71xx/patches-4.4/902-at803x-add-reset-gpio-pdata.patch
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau 
 */
if (phydev->state == PHY_NOLINK) {
  - if (priv->gpiod_reset && !priv->phy_reset) {
-+  if ((priv->gpiod_reset || pdata->has_reset_gpio) &&
++  if ((priv->gpiod_reset || (pdata && pdata->has_reset_gpio)) &&
  + !priv->phy_reset) {
struct at803x_context context;
   
@@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau 

  - msleep(1);
  - gpiod_set_value(priv->gpiod_reset, 0);
  - msleep(1);
-+  if (pdata->has_reset_gpio) {
++  if (pdata && pdata->has_reset_gpio) {
  + gpio_set_value_cansleep(pdata->reset_gpio, 0);
  + msleep(1);
  + gpio_set_value_cansleep(pdata->reset_gpio, 1);


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] using 464XLAT in LEDE (or OpenWRT)

2017-10-06 Thread JORDI PALET MARTINEZ
Hi Hans,

Sorry, missed confirming that it works perfectly.

I just tested today with the recent LEDE 17.01.3, and it works perfectly as 
well.

Thanks a lot!

Regards,
Jordi
 

-Mensaje original-
De: Hans Dedecker 
Responder a: 
Fecha: domingo, 10 de septiembre de 2017, 22:19
Para: Jordi Palet Martinez 
CC: LEDE Development List 
Asunto: Re: using 464XLAT in LEDE (or OpenWRT)

On Sat, Sep 9, 2017 at 1:20 PM, JORDI PALET MARTINEZ
 wrote:
> Ah even better, I thought 17.01.2 was not including the right CLAT 
(NAT46) stuff.
>
> So, I will try that then:
>
> 
http://downloads.lede-project.org/releases/17.01.2/targets/ramips/mt7621/lede-17.01.2-ramips-mt7621-sk-wb8-squashfs-sysupgrade.bin
>
> Right?
>
> Or do you mean I use the snapshot and then opkg install all the relevant 
packages?
Indeed I meant use a snapshot build and install the relevant 464xlat
package on top

Hans
>
> I will confirm if it works well, thanks a lot!
>
> Regard,
> Jordi
>
>
> -Mensaje original-
> De: Hans Dedecker 
> Responder a: 
> Fecha: sábado, 9 de septiembre de 2017, 15:36
> Para: Jordi Palet Martinez 
> CC: LEDE Development List 
> Asunto: Re: using 464XLAT in LEDE (or OpenWRT)
>
> On Sat, Sep 9, 2017 at 3:45 AM, JORDI PALET MARTINEZ
>  wrote:
> > Hi all,
> >
> > I just saw in github that 464xlat.sh has been modified on June 2.
> >
> > I’m not sure if that means that 464XLAT is already working if I use 
a snapshot, for example:
> >
> > 
http://downloads.lede-project.org/snapshots/targets/ramips/mt7621/lede-ramips-mt7621-sk-wb8-squashfs-sysupgrade.bin
> >
> > I’m doing a workshop this week and have one of those routers which 
I can reflash to demo it. There is no OpenWRT 15.05 support for this box, and 
15.05.1 has 464XLAT broken as well as I can remember.
> >
> > Or alternatively maybe an OpenWRT snapshot has it working?
> >
> > Thanks in advance!
> Hi,
>
> The 464xlat package is working in Lede trunk; however the 464xlat
> package is not enabled by default and as such won't be present in a
> snapshot build
>
> Hans
> >
> > Regards,
> > Jordi
> >
> >
> > -Mensaje original-
> > De: Hans Dedecker 
> > Responder a: 
> > Fecha: martes, 14 de marzo de 2017, 1:47
> > Para: Jordi Palet Martinez 
> > CC: LEDE Development List 
> > Asunto: Re: using 464XLAT in LEDE (or OpenWRT)
> >
> > On Sun, Mar 12, 2017 at 12:24 AM, JORDI PALET MARTINEZ
> >  wrote:
> > > Hi Hans,
> > >
> > > Thanks for your response.
> > >
> > > I’m now a bit more confused with your comment that it doesn’t 
work in LEDE, because this afternoon, finally I got it working.
> > >
> > > Let me explain all the history.
> > >
> > > About a year ago, using OpenWRT 15.05, I tested 464XLAT and 
it worked fine.
> > >
> > > Last weekend, I was trying to replicate it again directly 
with LEDE … no success.
> > >
> > > Then I tried again with OpenWRT 15.05.1 and didn’t worked, 
but this may be related to the platform I was using.
> > >
> > > I reverted back to 15.05 and it worked.
> > >
> > > This has been a very slow process because I expected that 
simply adding at network:
> > > config interface 'clat'
> > > option proto '464xlat'
> > > will make it, but, I didn’t realize that it requires a 
reboot, for some reason, just ifdown/ifup, is not enough.
> > >
> > > I could ping/traceroute to both IPv4/IPv6, browse, use skype, 
etc., and only having in the WAN IPv6, which is for what is meant 464XLAT of 
course.
> > >
> > > Once I got it stable, tried again with LEDE (17.01.0 stable), 
and even having the same configuration didn't worked, or at least I was 
assuming that …
> > >
> > > In the packages info, it shows a dependency with libssp, so 
that confused me … I also saw that the out rule was removed from 15.05, so I 
even edited the 464xlat.sh to include that rule again, but no difference.
> > >
> > > Now … by chance instead of trying ping, which is the FIRST 
thing that you do (specially because it worked in 15.05) … my previous browsing 
window was still open and tried to reload it … and it worked!
> > >
> > > I tried it also with the trunk version from today, and also 
works.
> > >
> > > I tried with both a hardware router and also a VM under 
VirtualBox.
>