Re: [OpenWrt-Devel] Howto force mips64

2014-06-17 Thread Martin Fäcknitz
force mips64 support is quite simple: set

  CPU_CFLAGS_octeon=-march=octeon -mabi=64

inside target/linux/octeon/Makefile and replace the same line in
include/target.mk. Finally you have to add the following patch:

diff --git a/target/linux/octeon/patches-3.10/-cn61xx_support.patch
b/target/linux/octeon/patches-3.10/-cn61xx_support.patch
new file mode 100644
index 000..18d2f3d
--- /dev/null
+++ b/target/linux/octeon/patches-3.10/-cn61xx_support.patch
@@ -0,0 +1,47 @@
+Index: b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c
+===
+--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c2014-05-06
15:24:06.0 +0200
 b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c2014-05-06
15:25:14.0 +0200
+@@ -75,6 +75,8 @@
+ int cvmx_helper_board_get_mii_address(int ipd_port)
+ {
+   switch (cvmx_sysinfo_get()-board_type) {
++  case 20003:
++  return -1;
+   case CVMX_BOARD_TYPE_SIM:
+   /* Simulator doesn't have MII */
+   return -1;
+Index: b/arch/mips/cavium-octeon/executive/cvmx-helper.c
+===
+--- a/arch/mips/cavium-octeon/executive/cvmx-helper.c  2014-01-25
17:27:55.0 +0100
 b/arch/mips/cavium-octeon/executive/cvmx-helper.c  2014-05-06
15:25:47.0 +0200
+@@ -83,7 +83,7 @@
+  */
+ int cvmx_helper_get_number_of_interfaces(void)
+ {
+-  if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX))
++  if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX) ||
OCTEON_IS_MODEL(OCTEON_CN61XX))
+   return 4;
+   else
+   return 3;
+@@ -121,7 +121,8 @@
+
+   if (interface == 3) {
+   if (OCTEON_IS_MODEL(OCTEON_CN56XX)
+-  || OCTEON_IS_MODEL(OCTEON_CN52XX))
++  || OCTEON_IS_MODEL(OCTEON_CN52XX)
++  || OCTEON_IS_MODEL(OCTEON_CN6XXX))
+   return CVMX_HELPER_INTERFACE_MODE_LOOP;
+   else
+   return CVMX_HELPER_INTERFACE_MODE_DISABLED;
+@@ -152,7 +153,9 @@
+
+   mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface));
+
+-  if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN52XX)) {
++  if (OCTEON_IS_MODEL(OCTEON_CN61XX)) {
++  return CVMX_HELPER_INTERFACE_MODE_SGMII;
++  } else if (OCTEON_IS_MODEL(OCTEON_CN56XX) || 
OCTEON_IS_MODEL(OCTEON_CN52XX)) {
+   switch (mode.cn56xx.mode) {
+   case 0:
+   return CVMX_HELPER_INTERFACE_MODE_DISABLED;

uclibc's mips64 support is broken, so you have to use glibc. gcc-4.8
doesn't work for me (invalid TLS related code), therefore use gcc-4.6.

greets

On 16.06.2014 23:26, Edison Figueira Junior wrote:
 hello, I can be a beta test if you want :-)
 
 Enviada do meu iPhone
 
 Em 04/06/2014, às 10:05, John Crispin j...@phrozen.org escreveu:

 octeon is currently only partially working. we will push a fix to
 trunk in the next few days. experimental patch is currently in
 testing. please be patient for a few dyas


 On 04/06/2014 14:36, Edison Figueira Junior wrote:
 Howto force to use mips64 for target octeon?




 ___ openwrt-devel
 mailing list openwrt-devel@lists.openwrt.org 
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
 


-- 
Martin Fäcknitz

hotsplots GmbH
Rotherstr. 17
10245 Berlin
Fon: +49 (0)30 29 77 348-48
Fax: +49 (0)30 29 77 348-99
E-Mail: faeckn...@hotsplots.de

Amtsgericht Charlottenburg HRB 93460B
Geschäftsführung: Dr. Ulrich Meier, Dr. Jörg Ontrup
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Howto force mips64

2014-06-17 Thread John Crispin


On 17/06/2014 11:24, Martin Fäcknitz wrote:
 uclibc's mips64 support is broken, so you have to use glibc.
 gcc-4.8 doesn't work for me (invalid TLS related code), therefore
 use gcc-4.6.

Hi,

yes, utterly broken :) i have been talking to the guys at imgtec about
this and there are people working on this matter. i would expect it to
take a few months though until this is all fixed and has treacled down
to openwrt.

John
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Howto force mips64

2014-06-17 Thread Martin Fäcknitz
Hi,

here are the patches which will fix the uclibc-mips64-tls problem:

--- a/toolchain/uClibc/patches-0.9.33.2/999-mips64-tprel.patch
+++ b/toolchain/uClibc/patches-0.9.33.2/999-mips64-tprel.patch
@@ -1,8 +1,19 @@
 Index: b/ldso/ldso/mips/elfinterp.c
 ===
 a/ldso/ldso/mips/elfinterp.c   2014-02-12 16:54:05.0 +0100
-+++ b/ldso/ldso/mips/elfinterp.c   2014-02-12 16:54:15.0 +0100
-@@ -248,22 +248,22 @@
+--- a/ldso/ldso/mips/elfinterp.c   2012-05-15 09:20:09.0 +0200
 b/ldso/ldso/mips/elfinterp.c   2014-05-07 17:20:25.0 +0200
+@@ -239,31 +239,31 @@
+   case R_MIPS_TLS_DTPMOD64:
+   case R_MIPS_TLS_DTPMOD32:
+   if (tls_tpnt)
+-  *(ElfW(Word) 
*)reloc_addr = tls_tpnt-l_tls_modid;
++  *(ElfW(Addr) 
*)reloc_addr = tls_tpnt-l_tls_modid;
+ #ifdef __SUPPORT_LD_DEBUG__
+   _dl_dprintf(2, TLS_DTPMOD : 
%s, %d, %d\n,
+-  symname, old_val, 
*((unsigned int *)reloc_addr));
++  symname, old_val, 
*((unsigned long *)reloc_addr));
+ #endif
+   break;
  
case R_MIPS_TLS_DTPREL64:
case R_MIPS_TLS_DTPREL32:
--- /dev/null
+++ b/toolchain/uClibc/patches-0.9.33.2/999-mips64-misc.patch
@@ -0,0 +1,141 @@
+Index: b/libc/sysdeps/linux/mips/sysdep.h
+===
+--- a/libc/sysdeps/linux/mips/sysdep.h 2012-05-15 09:20:09.0 +0200
 b/libc/sysdeps/linux/mips/sysdep.h 2014-02-15 14:10:01.0 +0100
+@@ -288,93 +288,52 @@
+of GCC 3.4.3, this is sufficient.  */
+ #define FORCE_FRAME_POINTER alloca (4)
+ 
+-#undef internal_syscall5
+-#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, 
arg4, arg5)\
+-({\
++#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, 
arg4, arg5) \
++({\
+   long _sys_result;   \
+   \
+-  FORCE_FRAME_POINTER;\
+   {   \
+-  register long __v0 __asm__($2) ncs_init;  \
+-  register long __a0 __asm__($4) = (long) arg1; \
+-  register long __a1 __asm__($5) = (long) arg2; \
+-  register long __a2 __asm__($6) = (long) arg3; \
+-  register long __a3 __asm__($7) = (long) arg4; \
+-  __asm__ __volatile__ (  \
+-  .set\tnoreorder\n\t   \
+-  subu\t$29, 32\n\t \
+-  sw\t%6, 16($29)\n\t   \
++  register ARG_TYPE __v0 __asm__($2) ncs_init;  \
++  register ARG_TYPE __a0 __asm__($4) = (ARG_TYPE) arg1; \
++  register ARG_TYPE __a1 __asm__($5) = (ARG_TYPE) arg2; \
++  register ARG_TYPE __a2 __asm__($6) = (ARG_TYPE) arg3; \
++  register ARG_TYPE __a3 __asm__($7) = (ARG_TYPE) arg4; \
++  register ARG_TYPE __a4 __asm__($8) = (ARG_TYPE) arg5; \
++  __asm__ __volatile__ (  \
++  .set\tnoreorder\n\t   \
+   cs_init \
+-  syscall\n\t   \
+-  addiu\t$29, 32\n\t\
+-  .set\treorder \
+-  : =r (__v0), +r (__a3)  \
+-  : input, r (__a0), r (__a1), r (__a2),\
+-r ((long)arg5)  \
+-  : __SYSCALL_CLOBBERS);  \
++  syscall\n\t   \
++  .set\treorder \
++  : =r (__v0), +r (__a3)  \
++  : input, r (__a0), r (__a1), r (__a2), r (__a4) \
++  : __SYSCALL_CLOBBERS);  \
+   err = __a3; \
+   _sys_result = __v0; 

[OpenWrt-Devel] [PATCH] iproute2: update version to 3.15.0, refresh patches, add maintainer

2014-06-17 Thread Russell Senior

Signed-off-by: Russell Senior russ...@personaltelco.net
---
 package/network/utils/iproute2/Makefile  | 9 +
 package/network/utils/iproute2/patches/006-no_sctp.patch | 4 ++--
 package/network/utils/iproute2/patches/110-extra-ccopts.patch| 2 +-
 package/network/utils/iproute2/patches/200-add-tc_esfq.patch | 2 +-
 .../network/utils/iproute2/patches/210-add-act_connmark.patch| 4 ++--
 package/network/utils/iproute2/patches/300-ip_tiny.patch | 4 ++--
 6 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/package/network/utils/iproute2/Makefile 
b/package/network/utils/iproute2/Makefile
index 7cc2fb4..558855f 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2013 OpenWrt.org
+# Copyright (C) 2006-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iproute2
-PKG_VERSION:=3.11.0
+PKG_VERSION:=3.15.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://kernel.org/pub/linux/utils/net/iproute2/
-PKG_MD5SUM:=d7ffb27bc9f0d80577b1f3fb9d1a7689
+PKG_MD5SUM:=5b1711c9d16071959052e369a2682d77
 PKG_BUILD_PARALLEL:=1
 
 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
@@ -24,8 +24,9 @@ define Package/iproute2/Default
   TITLE:=Routing control utility ($(2))
   SECTION:=net
   CATEGORY:=Network
-  URL:=http://linux-net.osdl.org/index.php/Iproute2
+  
URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
   SUBMENU:=Routing and Redirection
+  MAINTAINER:=Russell Senior russ...@personaltelco.net
   DEPENDS:= +libnl-tiny
   VARIANT:=$(1)
 endef
diff --git a/package/network/utils/iproute2/patches/006-no_sctp.patch 
b/package/network/utils/iproute2/patches/006-no_sctp.patch
index a3ed890..d4a0de0 100644
--- a/package/network/utils/iproute2/patches/006-no_sctp.patch
+++ b/package/network/utils/iproute2/patches/006-no_sctp.patch
@@ -1,6 +1,6 @@
 --- a/ip/ipxfrm.c
 +++ b/ip/ipxfrm.c
-@@ -470,7 +470,6 @@ void xfrm_selector_print(struct xfrm_sel
+@@ -469,7 +469,6 @@ void xfrm_selector_print(struct xfrm_sel
switch (sel-proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
@@ -8,7 +8,7 @@
case IPPROTO_DCCP:
default: /* XXX */
if (sel-sport_mask)
-@@ -1283,7 +1282,6 @@ static int xfrm_selector_upspec_parse(st
+@@ -1282,7 +1281,6 @@ static int xfrm_selector_upspec_parse(st
switch (sel-proto) {
case IPPROTO_TCP:
case IPPROTO_UDP:
diff --git a/package/network/utils/iproute2/patches/110-extra-ccopts.patch 
b/package/network/utils/iproute2/patches/110-extra-ccopts.patch
index 4a08757..0e36230 100644
--- a/package/network/utils/iproute2/patches/110-extra-ccopts.patch
+++ b/package/network/utils/iproute2/patches/110-extra-ccopts.patch
@@ -7,5 +7,5 @@
 -CCOPTS = -O2
 +CCOPTS = -O2 $(EXTRA_CCOPTS)
  WFLAGS := -Wall -Wstrict-prototypes  -Wmissing-prototypes
- WFLAGS += -Wmissing-declarations -Wold-style-definition
+ WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2
  
diff --git a/package/network/utils/iproute2/patches/200-add-tc_esfq.patch 
b/package/network/utils/iproute2/patches/200-add-tc_esfq.patch
index f09b450..19d8199 100644
--- a/package/network/utils/iproute2/patches/200-add-tc_esfq.patch
+++ b/package/network/utils/iproute2/patches/200-add-tc_esfq.patch
@@ -10,7 +10,7 @@
  TCMODULES += q_tbf.o
 --- a/include/linux/pkt_sched.h
 +++ b/include/linux/pkt_sched.h
-@@ -222,6 +222,33 @@ struct tc_sfq_xstats {
+@@ -226,6 +226,33 @@ struct tc_sfq_xstats {
__s32   allot;
  };
  
diff --git a/package/network/utils/iproute2/patches/210-add-act_connmark.patch 
b/package/network/utils/iproute2/patches/210-add-act_connmark.patch
index ac6ba33..c0bf07a 100644
--- a/package/network/utils/iproute2/patches/210-add-act_connmark.patch
+++ b/package/network/utils/iproute2/patches/210-add-act_connmark.patch
@@ -1,13 +1,13 @@
 --- a/tc/Makefile
 +++ b/tc/Makefile
-@@ -38,6 +38,7 @@ TCMODULES += m_mirred.o
+@@ -39,6 +39,7 @@ TCMODULES += m_mirred.o
  TCMODULES += m_nat.o
  TCMODULES += m_pedit.o
  TCMODULES += m_skbedit.o
 +TCMODULES += m_connmark.o
  TCMODULES += m_csum.o
+ TCMODULES += m_simple.o
  TCMODULES += p_ip.o
- TCMODULES += p_icmp.o
 --- /dev/null
 +++ b/tc/m_connmark.c
 @@ -0,0 +1,74 @@
diff --git a/package/network/utils/iproute2/patches/300-ip_tiny.patch 
b/package/network/utils/iproute2/patches/300-ip_tiny.patch
index 43afb9c..5b0d56c 100644
--- a/package/network/utils/iproute2/patches/300-ip_tiny.patch
+++ b/package/network/utils/iproute2/patches/300-ip_tiny.patch
@@ -14,7 +14,7 @@
  ALLOBJ=$(IPOBJ) $(RTMONOBJ)
  SCRIPTS=ifcfg rtpr routel routef
  TARGETS=ip rtmon
-@@ -43,7 +50,7 @@ else
+@@ -42,7 +49,7 @@ else
  
  ip: 

[OpenWrt-Devel] CONFIG_DEBUG and CONFIG_USE_SSTRIP

2014-06-17 Thread Karl Vogel
Currently when CONFIG_DEBUG is enabled, stripping is
disabled and the sstrip option becomes unavailable.

Looking at the commit history I noticed ticket #6373 which
introduced some of these changes. Reading the ticket it
seems the intend was to disable stripping when a user
selected CONFIG_DEBUG.

However the combination of debug + stripping is useful to
create a minimal build but still have the option to remote
gdb or examine core dumps, ie where the target has
stripped binaries, but the unstripped binaries are available
on the host/dev system. So I was wondering if it was
intentional to remove the sstrip option (as GNU strip is still
available) to work around bugs or issues with this
combination? or was it an unfortunate side effect of fixing
this ticket?

Karl
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Problem compiling kernel 3.3.8 in AA

2014-06-17 Thread Francisco Cuesta
2014-06-11 17:17 GMT+02:00 Tijs Van Buggenhout t...@able.be:

  It seems that the kernel config being generated by openwrt is incomplete
 for some reason. Are you using an old openwrt config to build for a new AA
 revision, without going through the openwrt configuration stage ?


Yes I am doing it, I am replacing my own kernel conf file with the options
I wanted. Is that not possible then? Or I have to create at least once a
conf file with the new style,apply my settings and then use it?

Thanks in advance,






 Files at interest are
 AA/build_dir/linux-ar71xx_generic/linux-3.3.8/.config and AA/.config
 (openwrt config).



 Regards,

 Tijs



 On Friday 06 June 2014 20:56:08 Francisco Cuesta wrote:

 Hello,  I am trying to compile my trunk version of Attitude Adjustment
 with some USB features enabled for allowing the connection of Atheros USB
 dongles to a tplink WDR4300ND.

 However, I am facing always the same problem, the firmware creation
 process is always stopped at the same point, which can be seen below. I
 don't know the reason, Just after that  I am ask to set again what looks
 like the kernel configuration, but I am not prompted any error, as far as I
 can see.

 I have just tried to compile the kernel, and I was given back the same
 state...

 May anyone enligthen me a bit?

 Thanks in advance,

 regards!

 ...

 make[4]: Entering directory 
 `/home/j/openwrt/attitudeAdjustment/build_dir/linux-ar71xx_generic/linux-3.3.8'

   HOSTCC  scripts/kconfig/conf.o

   SHIPPED scripts/kconfig/zconf.tab.c

   SHIPPED scripts/kconfig/zconf.lex.c

   SHIPPED scripts/kconfig/zconf.hash.c

   HOSTCC  scripts/kconfig/zconf.tab.o

   HOSTLD  scripts/kconfig/conf

 scripts/kconfig/conf --silentoldconfig Kconfig

 *

 * Restart config...

 *

 *

 * GCOV-based kernel profiling

 *

 Enable gcov-based kernel profiling (GCOV_KERNEL) [N/y/?] (NEW)




___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] lantiq: make loading pci fixup data from cal_data work again

2014-06-17 Thread Ben Mulvihill
Changeset 40948 restored an older (and uglier!) version of the
code for reading the athxk calibration partition on lantiq
xway boards. As a result pci fixups stored in this partition
are no longer applied, breaking wireless on the BTHOMEHUBV2B
and (I imagine) on the DGN3500. This is a minimal patch to
restore this functionality for ath9k without reverting any
of the other changes in changeset 40948.

Note for John Crispin:
I guess you won't want to apply this patch if you are planning
to check changeset 40948 anyway yourself. I produced it for
my own use and thought I might as well send it in in case it
was any use to anyone.

Ben Mulvihill


--- a/arch/mips/lantiq/xway/ath_eep.c   2014-06-16 12:10:10.413893209 +0200
+++ b/arch/mips/lantiq/xway/ath_eep.c   2014-06-16 12:10:26.366264625 +0200
@@ -35,6 +35,7 @@ static int ath9k_pci_plat_dev_init(struc
return 0;
 }
 
+static int ath9k_eep_load;
 int __init of_ath9k_eeprom_probe(struct platform_device *pdev)
 {
struct device_node *np = pdev-dev.of_node, *mtd_np;
@@ -117,6 +118,13 @@ int __init of_ath9k_eeprom_probe(struct
ltq_pci_ath_fixup(pci_slot, ath9k_pdata.eeprom_data);
 
dev_info(pdev-dev, pci slot: %u\n, pci_slot);
+if (ath9k_eep_load) {
+struct pci_dev *d = NULL;
+while ((d = pci_get_device(PCI_VENDOR_ID_ATHEROS,
+PCI_ANY_ID, d)) != NULL)
+pci_fixup_device(pci_fixup_early, d);
+}
+
}
 
dev_info(pdev-dev, loaded ath9k eeprom\n);
@@ -139,9 +147,22 @@ static struct platform_driver ath9k_eepr
 
 static int __init of_ath9k_eeprom_init(void)
 {
-   return platform_driver_probe(ath9k_eeprom_driver, 
of_ath9k_eeprom_probe);
+int ret = platform_driver_probe(ath9k_eeprom_driver, 
of_ath9k_eeprom_probe);
+
+if (ret)
+ath9k_eep_load = 1;
+
+return ret;
+}
+
+static int __init of_ath9k_eeprom_init_late(void)
+{
+if (!ath9k_eep_load)
+return 0;
+return platform_driver_probe(ath9k_eeprom_driver, 
of_ath9k_eeprom_probe);
 }
-arch_initcall(of_ath9k_eeprom_init);
+late_initcall(of_ath9k_eeprom_init_late);
+subsys_initcall(of_ath9k_eeprom_init);
 
 
 static int ath5k_pci_plat_dev_init(struct pci_dev *dev)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 0/5] DNSSEC support

2014-06-17 Thread Andre Heider
Hi,

fresh set of patches. Changes against v1:

- building against libnettle-mini is supported now, patch 3 adds an upstream
  fix for this combination.
- switched from a compile time configuration menu to a 3rd variant full.

Thanks,
Andre

Andre Heider (5):
  dnsmasq: use COPTS for compile time options
  dnsmasq: respect target's LDFLAGS
  dnsmasq: add upstream patch to build against libnettle-mini
  dnsmasq: Add a full variant
  dnsmasq: add UCI DNSSEC runtime support

 package/network/services/dnsmasq/Makefile  | 38 --
 .../network/services/dnsmasq/files/dnsmasq.init|  8 ++
 ...g-add-DNO_GMP-for-use-with-nettle-mini-gm.patch | 88 ++
 3 files changed, 129 insertions(+), 5 deletions(-)
 create mode 100644 
package/network/services/dnsmasq/patches/0001-Build-config-add-DNO_GMP-for-use-with-nettle-mini-gm.patch

-- 
2.0.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 1/5] dnsmasq: use COPTS for compile time options

2014-06-17 Thread Andre Heider
As documented in config.h.
Doing otherwise will break dnsmasq's pkg-wrapper script to find its
libs to link to.

Signed-off-by: Andre Heider a.hei...@gmail.com
---
 package/network/services/dnsmasq/Makefile | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile 
b/package/network/services/dnsmasq/Makefile
index 8e2d41c..c0d3dc4 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -61,18 +61,19 @@ endef
 
 Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles)
 
-TARGET_CFLAGS += \
-   -ffunction-sections -fdata-sections \
-   $(if $(CONFIG_IPV6),,-DNO_IPV6) -DNO_IPSET -DNO_AUTH
+TARGET_CFLAGS += -ffunction-sections -fdata-sections
+
+COPTS = $(if $(CONFIG_IPV6),,-DNO_IPV6) -DNO_IPSET -DNO_AUTH
 
 ifeq ($(BUILD_VARIANT),nodhcpv6)
-  TARGET_CFLAGS += -DNO_DHCP6
+   COPTS += -DNO_DHCP6
 endif
 
 MAKE_FLAGS := \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS=$(TARGET_CFLAGS) \
LDFLAGS=-Wl,--gc-sections \
+   COPTS=$(COPTS) \
PREFIX=/usr
 
 define Package/dnsmasq/install
-- 
2.0.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 4/5] dnsmasq: Add a full variant

2014-06-17 Thread Andre Heider
This variant includes support for DHCPv6 and DNSSEC.
DNSSEC adds a dependency on libnettle.

Signed-off-by: Andre Heider a.hei...@gmail.com
---
 package/network/services/dnsmasq/Makefile | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/package/network/services/dnsmasq/Makefile 
b/package/network/services/dnsmasq/Makefile
index 8473656..34d543f 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -44,6 +44,13 @@ $(call Package/dnsmasq/Default)
   VARIANT:=dhcpv6
 endef
 
+define Package/dnsmasq-full
+$(call Package/dnsmasq/Default)
+  TITLE += (with DHCPv6 and DNSSEC)
+  DEPENDS:=@IPV6 +kmod-ipv6 +libnettle
+  VARIANT:=full
+endef
+
 define Package/dnsmasq/description
   It is intended to provide coupled DNS and DHCP service to a LAN.
 endef
@@ -54,12 +61,19 @@ $(call Package/dnsmasq/description)
 This is a variant with DHCPv6 support
 endef
 
+define Package/dnsmasq-full/description
+$(call Package/dnsmasq/description)
+
+This is a variant with DHCPv6 and DNSSEC support
+endef
+
 define Package/dnsmasq/conffiles
 /etc/config/dhcp
 /etc/dnsmasq.conf
 endef
 
 Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles)
+Package/dnsmasq-full/conffiles = $(Package/dnsmasq/conffiles)
 
 TARGET_CFLAGS += -ffunction-sections -fdata-sections
 TARGET_LDFLAGS += -Wl,--gc-sections
@@ -70,6 +84,11 @@ ifeq ($(BUILD_VARIANT),nodhcpv6)
COPTS += -DNO_DHCP6
 endif
 
+ifeq ($(BUILD_VARIANT),full)
+   COPTS += -DHAVE_DNSSEC
+   COPTS += $(if $(CONFIG_LIBNETTLE_MINI),-DNO_GMP,)
+endif
+
 MAKE_FLAGS := \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS=$(TARGET_CFLAGS) \
@@ -91,5 +110,12 @@ endef
 
 Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install)
 
+define Package/dnsmasq-full/install
+$(call Package/dnsmasq/install,$(1))
+   $(INSTALL_DIR) $(1)/usr/share/dnsmasq
+   $(INSTALL_DATA) $(PKG_BUILD_DIR)/trust-anchors.conf 
$(1)/usr/share/dnsmasq
+endef
+
 $(eval $(call BuildPackage,dnsmasq))
 $(eval $(call BuildPackage,dnsmasq-dhcpv6))
+$(eval $(call BuildPackage,dnsmasq-full))
-- 
2.0.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 2/5] dnsmasq: respect target's LDFLAGS

2014-06-17 Thread Andre Heider
Append local flags, don't overwrite.

Signed-off-by: Andre Heider a.hei...@gmail.com
---
 package/network/services/dnsmasq/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/network/services/dnsmasq/Makefile 
b/package/network/services/dnsmasq/Makefile
index c0d3dc4..8473656 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -62,6 +62,7 @@ endef
 Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles)
 
 TARGET_CFLAGS += -ffunction-sections -fdata-sections
+TARGET_LDFLAGS += -Wl,--gc-sections
 
 COPTS = $(if $(CONFIG_IPV6),,-DNO_IPV6) -DNO_IPSET -DNO_AUTH
 
@@ -72,7 +73,7 @@ endif
 MAKE_FLAGS := \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS=$(TARGET_CFLAGS) \
-   LDFLAGS=-Wl,--gc-sections \
+   LDFLAGS=$(TARGET_LDFLAGS) \
COPTS=$(COPTS) \
PREFIX=/usr
 
-- 
2.0.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 5/5] dnsmasq: add UCI DNSSEC runtime support

2014-06-17 Thread Andre Heider
Ship keys for the root zone and add two uci options to enable
DNSSEC checks:

Option 'dnssec': Activate DNSSEC validation
Option 'dnsseccheckunsigned': Ensure answers without DNSSEC are in
unsigned zones.

Signed-off-by: Andre Heider a.hei...@gmail.com
---
 package/network/services/dnsmasq/files/dnsmasq.init | 8 
 1 file changed, 8 insertions(+)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init 
b/package/network/services/dnsmasq/files/dnsmasq.init
index f7edb28..9f16d5f 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -14,6 +14,7 @@ ADD_LOCAL_HOSTNAME=1
 
 CONFIGFILE=/var/etc/dnsmasq.conf
 HOSTFILE=/tmp/hosts/dhcp
+TRUSTANCHORSFILE=/usr/share/dnsmasq/trust-anchors.conf
 
 xappend() {
local value=$1
@@ -186,6 +187,13 @@ dnsmasq() {
config_list_foreach $cfg rebind_domain append_rebind_domain
}
 
+   config_get dnssec $cfg dnssec
+   [ $dnssec -gt 0 ]  {
+   xappend --conf-file=$TRUSTANCHORSFILE
+   xappend --dnssec
+   append_bool $cfg dnsseccheckunsigned --dnssec-check-unsigned
+   }
+
dhcp_option_add $cfg  0
 
xappend --dhcp-broadcast=tag:needs-broadcast
-- 
2.0.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2 3/5] dnsmasq: add upstream patch to build against libnettle-mini

2014-06-17 Thread Andre Heider
Signed-off-by: Andre Heider a.hei...@gmail.com
---
 ...g-add-DNO_GMP-for-use-with-nettle-mini-gm.patch | 88 ++
 1 file changed, 88 insertions(+)
 create mode 100644 
package/network/services/dnsmasq/patches/0001-Build-config-add-DNO_GMP-for-use-with-nettle-mini-gm.patch

diff --git 
a/package/network/services/dnsmasq/patches/0001-Build-config-add-DNO_GMP-for-use-with-nettle-mini-gm.patch
 
b/package/network/services/dnsmasq/patches/0001-Build-config-add-DNO_GMP-for-use-with-nettle-mini-gm.patch
new file mode 100644
index 000..f9a62cd
--- /dev/null
+++ 
b/package/network/services/dnsmasq/patches/0001-Build-config-add-DNO_GMP-for-use-with-nettle-mini-gm.patch
@@ -0,0 +1,88 @@
+From 063efb330a3f341c2548e2cf1f67f83e49cd6395 Mon Sep 17 00:00:00 2001
+From: Simon Kelley si...@thekelleys.org.uk
+Date: Tue, 17 Jun 2014 19:49:31 +0100
+Subject: [PATCH] Build config: add -DNO_GMP for use with nettle/mini-gmp
+
+---
+ Makefile| 2 +-
+ bld/pkg-wrapper | 9 +++--
+ src/config.h| 7 +++
+ src/dnssec.c| 3 ++-
+ 4 files changed, 17 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index c58b50b..17eeb27 100644
+--- a/Makefile
 b/Makefile
+@@ -61,7 +61,7 @@ lua_cflags =`echo $(COPTS) | $(top)/bld/pkg-wrapper 
HAVE_LUASCRIPT $(PKG_CON
+ lua_libs =  `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT 
$(PKG_CONFIG) --libs lua5.1` 
+ nettle_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC 
$(PKG_CONFIG) --cflags nettle hogweed`
+ nettle_libs =   `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC 
$(PKG_CONFIG) --libs nettle hogweed`
+-gmp_libs =  `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC 
$(PKG_CONFIG) --copy -lgmp`
++gmp_libs =  `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC NO_GMP 
--copy -lgmp`
+ sunos_libs =`if uname | grep SunOS /dev/null 21; then echo -lsocket 
-lnsl -lposix4; fi`
+ version = -DVERSION='\`$(top)/bld/get-version $(top)`\'
+ 
+diff --git a/bld/pkg-wrapper b/bld/pkg-wrapper
+index 9f9332d..0ddb678 100755
+--- a/bld/pkg-wrapper
 b/bld/pkg-wrapper
+@@ -11,9 +11,14 @@ in=`cat`
+ 
+ if grep ^\#[[:space:]]*define[[:space:]]*$search config.h /dev/null 21 
|| \
+ echo $in | grep $search /dev/null 21; then
+-
++# Nasty, nasty, in --copy, arg 2 is another config to search for, use with 
NO_GMP
+ if [ $op = --copy ]; then
+-  pkg=$*
++  if grep ^\#[[:space:]]*define[[:space:]]*$pkg config.h /dev/null 
21 || \
++echo $in | grep $pkg /dev/null 21; then
++  pkg=
++  else 
++  pkg=$*
++  fi
+ elif grep ^\#[[:space:]]*define[[:space:]]*${search}_STATIC config.h 
/dev/null 21 || \
+ echo $in | grep ${search}_STATIC /dev/null 21; then
+   pkg=`$pkg  --static $op $*`
+diff --git a/src/config.h b/src/config.h
+index 2155544..ee6d218 100644
+--- a/src/config.h
 b/src/config.h
+@@ -105,6 +105,8 @@ HAVE_AUTH
+define this to include the facility to act as an authoritative DNS
+server for one or more zones.
+ 
++HAVE_DNSSEC
++   include DNSSEC validator.
+ 
+ NO_IPV6
+ NO_TFTP
+@@ -118,6 +120,11 @@ NO_AUTH
+which are enabled  by default in the distributed source tree. Building 
dnsmasq
+with something like make COPTS=-DNO_SCRIPT will do the trick.
+ 
++NO_NETTLE_ECC
++   Don't include the ECDSA cypher in DNSSEC validation. Needed for older 
Nettle versions.
++NO_GMP
++   Don't use and link against libgmp, Useful if nettle is built with 
--enable-mini-gmp.
++
+ LEASEFILE
+ CONFFILE
+ RESOLVFILE
+diff --git a/src/dnssec.c b/src/dnssec.c
+index 44d626b..2ffb75d 100644
+--- a/src/dnssec.c
 b/src/dnssec.c
+@@ -26,7 +26,8 @@
+ #  include nettle/ecc-curve.h
+ #endif
+ #include nettle/nettle-meta.h
+-#include gmp.h
++#include nettle/bignum.h
++
+ 
+ #define SERIAL_UNDEF  -100
+ #define SERIAL_EQ0
+-- 
+2.0.0
+
-- 
2.0.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel