[OpenWrt-Devel] [PATCH] Partially fix xtables-addons for kernel 3.7, update from 2.0 to 2.1

2013-01-15 Thread Russell Senior

Partially fix xtables-addons for kernel 3.7, update from 2.0 to 2.1

With kernel 3.7.x, it seems CONFIG_UIDGID_STRICT_TYPE_CHECKS is set
and xtables-addons is not compliant.  This patch fixes some of the
type errors, but comments out module_param() calls where param_ops
support is needed for kuid_t/kgid_t types (HALP!).  Also, updates to
xtables-addons-2.1 for good measure.

Signed-off-by: Russell Senior russ...@personaltelco.net
---
 net/xtables-addons/Makefile|4 +-
 .../patches/110-dnetmap-linux-3.7.patch|   22 -
 net/xtables-addons/patches/310-uidgid.patch|   84 
 3 files changed, 86 insertions(+), 24 deletions(-)
 delete mode 100644 net/xtables-addons/patches/110-dnetmap-linux-3.7.patch
 create mode 100644 net/xtables-addons/patches/310-uidgid.patch

diff --git a/net/xtables-addons/Makefile b/net/xtables-addons/Makefile
index 9bf39da..c66a227 100644
--- a/net/xtables-addons/Makefile
+++ b/net/xtables-addons/Makefile
@@ -10,9 +10,9 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=xtables-addons
 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.7.0)),1)
-PKG_VERSION:=2.0
+PKG_VERSION:=2.1
 PKG_RELEASE:=1
-PKG_MD5SUM:=26b1b1dbb4a8faff24597723ebde04c9
+PKG_MD5SUM:=b624fc57bbda9e15c33a6471e4ec75e1
 else
 PKG_VERSION:=1.45
 PKG_RELEASE:=3
diff --git a/net/xtables-addons/patches/110-dnetmap-linux-3.7.patch 
b/net/xtables-addons/patches/110-dnetmap-linux-3.7.patch
deleted file mode 100644
index f0aa6d4..000
--- a/net/xtables-addons/patches/110-dnetmap-linux-3.7.patch
+++ /dev/null
@@ -1,22 +0,0 @@
 xtables-addons-2.0/extensions/xt_DNETMAP.c~2012-11-12 
18:03:51.0 +
-+++ xtables-addons-2.0/extensions/xt_DNETMAP.c 2012-12-20 00:06:10.656675731 
+
-@@ -27,7 +27,7 @@
- #include linux/netfilter_ipv4.h
- #include linux/netfilter/x_tables.h
- #include linux/version.h
--#include net/netfilter/nf_nat_rule.h
-+#include net/netfilter/nf_nat.h
- #include net/net_namespace.h
- #include net/netns/generic.h
- #include linux/netfilter/nf_nat.h
 xtables-addons-2.0/mconfig 2012-12-20 00:55:11.445085492 +
-+++ xtables-addons-2.0/mconfig~2012-12-20 00:54:29.0 +
-@@ -4,7 +4,7 @@ build_ACCOUNT=m
- build_CHAOS=m
- build_DELUDE=m
- build_DHCPMAC=m
--build_DNETMAP=
-+build_DNETMAP=m
- build_ECHO=m
- build_IPMARK=m
- build_LOGMARK=m
diff --git a/net/xtables-addons/patches/310-uidgid.patch 
b/net/xtables-addons/patches/310-uidgid.patch
new file mode 100644
index 000..869d109
--- /dev/null
+++ b/net/xtables-addons/patches/310-uidgid.patch
@@ -0,0 +1,84 @@
+diff -ru xtables-addons-2.1-orig/extensions/xt_DNETMAP.c 
xtables-addons-2.1/extensions/xt_DNETMAP.c
+--- xtables-addons-2.1-orig/extensions/xt_DNETMAP.c2012-12-26 
23:01:00.0 -0800
 xtables-addons-2.1/extensions/xt_DNETMAP.c 2013-01-14 23:09:12.0 
-0800
+@@ -26,6 +26,7 @@
+ #include linux/netfilter.h
+ #include linux/netfilter_ipv4.h
+ #include linux/netfilter/x_tables.h
++#include linux/uidgid.h
+ #include linux/version.h
+ #include net/net_namespace.h
+ #include net/netns/generic.h
+@@ -41,8 +42,8 @@
+ 
+ static unsigned int default_ttl = 600;
+ static unsigned int proc_perms = S_IRUGO | S_IWUSR;
+-static unsigned int proc_uid;
+-static unsigned int proc_gid;
++static kuid_t proc_uid;
++static kgid_t proc_gid;
+ static unsigned int default_hash_size = 256;
+ static unsigned int hash_size = 256;
+ static unsigned int disable_log;
+diff -ru xtables-addons-2.1-orig/extensions/xt_condition.c 
xtables-addons-2.1/extensions/xt_condition.c
+--- xtables-addons-2.1-orig/extensions/xt_condition.c  2012-12-26 
23:01:00.0 -0800
 xtables-addons-2.1/extensions/xt_condition.c   2013-01-14 
23:09:12.0 -0800
+@@ -20,6 +20,7 @@
+ #include linux/string.h
+ #include linux/version.h
+ #include linux/netfilter/x_tables.h
++#include linux/uidgid.h
+ #include asm/uaccess.h
+ #include xt_condition.h
+ #include compat_xtables.h
+@@ -30,8 +31,8 @@
+ 
+ /* Defaults, these can be overridden on the module command-line. */
+ static unsigned int condition_list_perms = S_IRUGO | S_IWUSR;
+-static unsigned int condition_uid_perms = 0;
+-static unsigned int condition_gid_perms = 0;
++static kuid_t condition_uid_perms = KUIDT_INIT(0);
++static kgid_t condition_gid_perms = KGIDT_INIT(0);
+ 
+ MODULE_AUTHOR(Stephane Ouellette ouellet...@videotron.ca);
+ MODULE_AUTHOR(Massimiliano Hofer m...@nucleus.it);
+@@ -40,10 +41,12 @@
+ MODULE_LICENSE(GPL);
+ module_param(condition_list_perms, uint, S_IRUSR | S_IWUSR);
+ MODULE_PARM_DESC(condition_list_perms, permissions on 
/proc/net/nf_condition/* files);
++#ifndef CONFIG_UIDGID_STRICT_TYPE_CHECKS
+ module_param(condition_uid_perms, uint, S_IRUSR | S_IWUSR);
+ MODULE_PARM_DESC(condition_uid_perms, user owner of /proc/net/nf_condition/* 
files);
+ module_param(condition_gid_perms, uint, S_IRUSR | S_IWUSR);
+ MODULE_PARM_DESC(condition_gid_perms, group owner of 

[OpenWrt-Devel] eglibc/i2c-tools broken ?

2013-01-15 Thread shazz
Hi,

Since a few days, my ar71xx/eglibc builds are broken :

make[4]: Entering directory
`/var/www/LOG/openwrt/tpl703n/trunk/build_dir/target-mips_r2_eglibc-2.16/linux-ar71xx_generic/i2c-tools-3.0.3'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory
`/var/www/LOG/openwrt/tpl703n/trunk/build_dir/target-mips_r2_eglibc-2.16/linux-ar71xx_generic/i2c-tools-3.0.3'
(   export 
PYTHONPATH=/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/target-mips_r2_eglibc-2.16/usr/lib/python2.7:/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/target-mips_r2_eglibc-2.16//usr/lib/python2.7/site-packages;
export PYTHONOPTIMIZE=; export PYTHONDONTWRITEBYTECODE=1;  cd
/var/www/LOG/openwrt/tpl703n/trunk/build_dir/target-mips_r2_eglibc-2.16/linux-ar71xx_generic/i2c-tools-3.0.3/./py-smbus/;
CFLAGS=-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves
-mno-branch-likely -fhonour-copts -Wno-error=unused-but-set-variable
-msoft-float 
CPPFLAGS=-I/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/target-mips_r2_eglibc-2.16/usr/include
-I/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/target-mips_r2_eglibc-2.16/include
-I/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/toolchain-mips_r2_gcc-4.7-linaro_eglibc-2.16/usr/include
-I/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/toolchain-mips_r2_gcc-4.7-linaro_eglibc-2.16/include
-I/var/www/LOG/openwrt/tpl703n/trunk/build_dir/target-mips_r2_eglibc-2.16/linux-ar71xx_generic/linux-3.7.2/include
LDFLAGS=-L/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/target-mips_r2_eglibc-2.16/usr/lib
-L/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/target-mips_r2_eglibc-2.16/lib
-L/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/toolchain-mips_r2_gcc-4.7-linaro_eglibc-2.16/usr/lib
-L/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/toolchain-mips_r2_gcc-4.7-linaro_eglibc-2.16/lib
   
/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/target-mips_r2_eglibc-2.16/usr/bin/hostpython
 ./setup.py  install
--prefix=/var/www/LOG/openwrt/tpl703n/trunk/build_dir/target-mips_r2_eglibc-2.16/linux-ar71xx_generic/i2c-tools-3.0.3/ipkg-install/usr
; )
running install
running build
running build_ext
building 'smbus' extension
mips-openwrt-linux-gnu-gcc -DNDEBUG -Os -pipe -mips32r2
-mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts
-Wno-error=unused-but-set-variable -msoft-float -Os -pipe -mips32r2
-mtune=mips32r2 -fno-caller-saves -mno-branch-likely -fhonour-copts
-Wno-error=unused-but-set-variable -msoft-float
-I/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/target-mips_r2_eglibc-2.16/usr/include
-I/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/target-mips_r2_eglibc-2.16/include
-I/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/toolchain-mips_r2_gcc-4.7-linaro_eglibc-2.16/usr/include
-I/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/toolchain-mips_r2_gcc-4.7-linaro_eglibc-2.16/include
-I/var/www/LOG/openwrt/tpl703n/trunk/build_dir/target-mips_r2_eglibc-2.16/linux-ar71xx_generic/linux-3.7.2/include
-fPIC 
-I/var/www/LOG/openwrt/tpl703n/trunk/staging_dir/target-mips_r2_eglibc-2.16/usr/include/python2.7
-c smbusmodule.c -o build/temp.linux-x86_64-2.7/smbusmodule.o
In file included from
/var/www/LOG/openwrt/tpl703n/trunk/build_dir/target-mips_r2_eglibc-2.16/linux-ar71xx_generic/linux-3.7.2/include/linux/i2c.h:29:0,
 from smbusmodule.c:24:
/var/www/LOG/openwrt/tpl703n/trunk/build_dir/target-mips_r2_eglibc-2.16/linux-ar71xx_generic/linux-3.7.2/include/linux/mod_devicetable.h:18:2:
error: unknown type name '__u32'
...
/var/www/LOG/openwrt/tpl703n/trunk/build_dir/target-mips_r2_eglibc-2.16/linux-ar71xx_generic/linux-3.7.2/include/linux/atomic.h:4:24:
fatal error: asm/atomic.h: No such file or directory
compilation terminated.
error: command 'mips-openwrt-linux-gnu-gcc' failed with exit status 1
make[3]: *** 
[/var/www/LOG/openwrt/tpl703n/trunk/build_dir/target-mips_r2_eglibc-2.16/linux-ar71xx_generic/i2c-tools-3.0.3/.built]
Error 1

Any idea ?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Get to RedBoot prompt in Atheros-based router

2013-01-15 Thread Bastian Bittorf
* Nguyễn Hồng Quân quanngu...@mbm.vn [15.01.2013 11:20]:
 
 I wonder if the time for RedBoot to wait for telnet was set to 0 by
 someone before.

it should be possible from DD-WRT/openwrt to alter variables from
redboot. look out for fconfig:

http://wiki.openwrt.org/doc/techref/bootloader/redboot

bye, bastian
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] tune kernel commandline for headless/embedded systems / oops=panic panic=10 / panic_on_oom=1

2013-01-15 Thread John Szakmeister
On Mon, Jan 7, 2013 at 10:51 AM, Oliver
oli...@8.c.9.b.0.7.4.0.1.0.0.2.ip6.arpa wrote:
 On Monday 07 January 2013 13:17:24 Bastian Bittorf wrote:
 * Imre Kaloz ka...@openwrt.org [07.01.2013 12:55]:
  the problem is: most routers are in production and not serial
  attached - so you have really a problem if a node (rooftop or solar
  powered) dies during boot. if you are a developer, you can simple build
  your own image and disable this option, all other persons (90%?) like to
  have a running/selfrebooting router when the kernel is panic'ing or there
  are serious problems.
 
  And those persons likely won't deploy a router with an image that fails to
  boot, right? So what's wrong with setting these values after boot up?
 this is not the idea:
 face the fact, that a kernel can panic seldom during boot,
 even before preinit, even if the kernel is good.

 So if the kernel is good, evidently something else isn't... If you're shipping
 images where things are so messed up that the kernel will panic before it even
 gets to executing init, I'd look to fix the underlying symptoms rather than
 simply trying to work around it with this.

Just to be clear, there are other reasons why things can go wrong and
still have a good kernel.  Check out the soft errors page on
Wikipedia:
http://en.wikipedia.org/wiki/Soft_error

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


[OpenWrt-Devel] [PATCH] [ar71xx] Add support for Atheros AP132 Reference Board

2013-01-15 Thread Embedded Wireless GmbH
Add support for Qualcomm Atheros QCA9556 SoC and the AP132 Reference Board.

Tested-by: Embedded Wireless GmbH www.embeddedwireless.de
Signed-off-by: Embedded Wireless GmbH info at embeddedwireless.de


---

Index: target/linux/ar71xx/files/arch/mips/ath79/mach-ap132.c
===
--- target/linux/ar71xx/files/arch/mips/ath79/mach-ap132.c  (revision 0)
+++ target/linux/ar71xx/files/arch/mips/ath79/mach-ap132.c  (revision 0)
@@ -0,0 +1,189 @@
+/*
+ * Atheros AP132 reference board support
+ *
+ * Copyright (c) 2012 Qualcomm Atheros
+ * Copyright (c) 2012 Gabor Juhos juh...@openwrt.org
+ * Copyright (c) 2013 Embedded Wireless GmbH i...@embeddedwireless.de
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+#include linux/platform_device.h
+#include linux/ar8216_platform.h
+
+#include asm/mach-ath79/ar71xx_regs.h
+
+#include common.h
+#include dev-ap9x-pci.h
+#include dev-gpio-buttons.h
+#include dev-eth.h
+#include dev-leds-gpio.h
+#include dev-m25p80.h
+#include dev-usb.h
+#include dev-wmac.h
+#include machtypes.h
+
+#define AP132_GPIO_LED_USB 4
+#define AP132_GPIO_LED_WLAN_5G 12
+#define AP132_GPIO_LED_WLAN_2G 13
+#define AP132_GPIO_LED_STATUS_RED  14
+#define AP132_GPIO_LED_WPS_RED 15
+
+#define AP132_GPIO_BTN_WPS 16
+
+#define AP132_KEYS_POLL_INTERVAL   20  /* msecs */
+#define AP132_KEYS_DEBOUNCE_INTERVAL   (3 * AP132_KEYS_POLL_INTERVAL)
+
+#define AP132_MAC0_OFFSET  0
+#define AP132_WMAC_CALDATA_OFFSET  0x1000
+
+static struct gpio_led ap132_leds_gpio[] __initdata = {
+   {
+   .name   = ap132:red:status,
+   .gpio   = AP132_GPIO_LED_STATUS_RED,
+   .active_low = 1,
+   },
+   {
+   .name   = ap132:red:wps,
+   .gpio   = AP132_GPIO_LED_WPS_RED,
+   .active_low = 1,
+   },
+   {
+   .name   = ap132:red:wlan-2g,
+   .gpio   = AP132_GPIO_LED_WLAN_2G,
+   .active_low = 1,
+   },
+   {
+   .name   = ap132:red:usb,
+   .gpio   = AP132_GPIO_LED_USB,
+   .active_low = 1,
+   }
+};
+
+static struct gpio_keys_button ap132_gpio_keys[] __initdata = {
+   {
+   .desc   = WPS button,
+   .type   = EV_KEY,
+   .code   = KEY_WPS_BUTTON,
+   .debounce_interval = AP132_KEYS_DEBOUNCE_INTERVAL,
+   .gpio   = AP132_GPIO_BTN_WPS,
+   .active_low = 1,
+   },
+};
+
+static struct ar8327_pad_cfg ap132_ar8327_pad0_cfg;
+
+static struct ar8327_platform_data ap132_ar8327_data = {
+   .pad0_cfg = ap132_ar8327_pad0_cfg,
+   .port0_cfg = {
+   .force_link = 1,
+   .speed = AR8327_PORT_SPEED_1000,
+   .duplex = 1,
+   .txpause = 1,
+   .rxpause = 1,
+   },
+};
+
+static struct mdio_board_info ap132_mdio1_info[] = {
+   {
+   .bus_id = ag71xx-mdio.1,
+   .phy_addr = 0,
+   .platform_data = ap132_ar8327_data,
+   },
+};
+
+static void __init ap132_mdio_setup(void)
+{
+   void __iomem *base;
+   u32 t;
+
+#define GPIO_IN_ENABLE3_ADDRESS  0x0050
+#define GPIO_IN_ENABLE3_MII_GE1_MDI_MASK 0x00ff
+#define GPIO_IN_ENABLE3_MII_GE1_MDI_LSB  16
+#define GPIO_IN_ENABLE3_MII_GE1_MDI_SET(x)   (((x)  
GPIO_IN_ENABLE3_MII_GE1_MDI_LSB)  GPIO_IN_ENABLE3_MII_GE1_MDI_MASK)
+#define GPIO_OUT_FUNCTION4_ADDRESS   0x003c
+#define GPIO_OUT_FUNCTION4_ENABLE_GPIO_19_MASK   0xff00
+#define GPIO_OUT_FUNCTION4_ENABLE_GPIO_19_LSB24
+#define GPIO_OUT_FUNCTION4_ENABLE_GPIO_19_SET(x) (((x)  
GPIO_OUT_FUNCTION4_ENABLE_GPIO_19_LSB)  GPIO_OUT_FUNCTION4_ENABLE_GPIO_19_MASK)
+#define GPIO_OUT_FUNCTION4_ENABLE_GPIO_17_MASK   0xff00
+#define GPIO_OUT_FUNCTION4_ENABLE_GPIO_17_LSB8
+#define 

Re: [OpenWrt-Devel] tune kernel commandline for headless/embedded systems / oops=panic panic=10 / panic_on_oom=1

2013-01-15 Thread Bastian Bittorf
* John Szakmeister j...@szakmeister.net [15.01.2013 12:52]:
 
 Just to be clear, there are other reasons why things can go wrong and
 still have a good kernel.  Check out the soft errors page on
 Wikipedia:
 http://en.wikipedia.org/wiki/Soft_error

thanks for this link John, i want to expose a snippet:

In addition, before the correction can occur, the system may have
crashed, in which case the recovery procedure must include a reboot.

again the question: can we find an agreement how to deal with
crashs?

a)
during early boot (kernel/preinit)

b)
during rcS

c)
during worktime (after boot)

IMHO we should always enforce a reboot on panic
(which means: panic=X, where X0). at the moment this is
done very late in S99: kernel.panic=3

at least THIS should be done on kernel-commandline.
all other values (oops/oom): i discuss, but simply halting during
a panic is a nogo!

bye, bastian

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


Re: [OpenWrt-Devel] support for TP-Link TL-WDR3500. Was: Re: [RFC] ar71xx: add support for the TP-Link TL-WDR4310 v1.0

2013-01-15 Thread Gui Iribarren
Hi Stefan,
we truly appreciate your tips and guidance,

attached is the original bootlog from serial console, in case it's useful.
I'm about to try adapting  flashing a binary for wdr3600,

Cheers!!


On Sat, Dec 22, 2012 at 12:05 AM, Nicolás Echániz
nicoecha...@codigosur.org wrote:
 On 12/21/2012 11:56 PM, Stefan Lippers-Hollmann wrote:
 Hi

 On Saturday 22 December 2012, Stefan Lippers-Hollmann wrote:
 On Thursday 20 December 2012, Nicolás Echániz wrote:
 TP-Link WDR3600 is supported since r33219. It has the same hardware as
 the WDR4300 with one less chain/antenna.

 However the model WDR3500, which is similar to WDR3600 is not yet
 supported. Outstanding differences in relation to WDR3600 are:

 For the TL-WDR3600, the situation was easy (once TL-WDR4300 was
 supported), because it's essentially the same device, with only minor
 differences for the 2.4 GHz radio (but still supported by the same
 driver, ath9k). Without knowing any details, I fear this might be
 slightly different with the TL-WDR3500.

 - no gigabit ethernet

 Yes, and this means there is a big chance that the switch chipset might
 be different. In contrast to wlan support, where you might be able to
 just risk it, missing ethernet/ switch support would have much bigger
 consequences. Given that The Atheros DB120 reference architecture, from
 which these TP-Link routers are closely derived, is quite well
 integrated and is specified with an Atheros AR8327N GBit/s switch,
 there is a significant chance that a different switch chipset might be
 used here - or eventually some completely different base board.

 O.k., after looking at the FCC pictures, which are not detailed enough
 to read all of the chips, it becomes clear that they're using a
 similar, but significantly different PCB for the TL-WDR3500 - so you
 really should make high resolution pictures and check bootlog/ GPL
 tarball before risking anything. While there still is a small chance
 that the differences are small enough that OpenWrt might just work
 for this device as well, it does look like there is a different
 solution in place for the networking switch, so it's more likely that
 some more involved source changes might be needed.

 Stephan, thanks a lot for your detailed explanation.

 I live in a small town with difficult local access to hardware but I'll
 have a WDR3500 delivered from Buenos Aires in the following weeks and
 then I'll get the high resolution images and original bootlog.

 I'll update as soon as I have this information.


 Cheers,

 NicoEchániz
 altermundi.net




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


TLWDR3500_factory_serial_boot.log
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Compiling custom kernel for latest trunk

2013-01-15 Thread Emmanuel Deloget
Le 12/01/2013 16:08, darius a écrit :
 Hello,

 Simple question for those who know. I do 'make kernel_menuconfig' then select 
 some needed features in kernel and then do 'make -j3' in topdir. After image 
 is done, I install it on the router, but my kernel features are still not 
 available. So I suppose I've done something wrong with kernel compilation. 
 Could someone guide my about compiling custom kernel ?

 -- 
 Darius

Hello,

Features selected with '*' in make kernel_menuconfig are statically linked
to the kernel, so they should be available in your image.

Features selected with 'M' in make kernel_menuconfig are compiled as
modules, and those modules are NOT copied into the modules package unless
the same module is selected in make menuconfig. If you miss a specific
module, you can change one of the file in openwrt/package/kernel/modules/
to include the missing module (using the other lines as samples) and
propose the patch to the mailing list. This is just a matter of adding:

===
define KernelPackage/the-module-I-want-to-add
  SUBMENU:=$(A_MENU_VARIABLE)
  TITLE:=The module description
  KCONFIG:=CONFIG_MODULE_SELECTION_SYMBOL
  FILES:=$(LINUX_DIR)/path.to/module.ko
  AUTOLOAD:=$(call AutoLoad,the_module_order,module)
endef

define KernelPackage/the-module-I-want-to-add/description
  Description
endef

$(eval $(call KernelPackage,the-module-I-want-to-add))
===

Available menu variables are defined in the various *.mk files in the
openwrt/package/kernel/modules/ directory. The module order is an integer
(from 00 to 99) which will be used to create the script that will be used
to load the module. Since OpenWRT does not use any module dependency
management tool, you have to handle this by yourself, meaning that you
must make sure that you module

* is insmoded after the module it depends on.
* is insmoded before the modules that depends on it.

Once you added the correct lines, you can do another make menuconfig -
and your module will show up.

Best regards,

-- Emmanuel Deloget

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


Re: [OpenWrt-Devel] Compiling custom kernel for latest trunk

2013-01-15 Thread edgar . soldin
On 15.01.2013 16:41, Emmanuel Deloget wrote:
 Le 12/01/2013 16:08, darius a écrit :
 Hello,

 Simple question for those who know. I do 'make kernel_menuconfig' then 
 select some needed features in kernel and then do 'make -j3' in topdir. 
 After image is done, I install it on the router, but my kernel features are 
 still not available. So I suppose I've done something wrong with kernel 
 compilation. Could someone guide my about compiling custom kernel ?


do not forget to

 make target/linux/{clean,compile} V=99

after you changed your kernel settings. you might leave out the cleaning if you 
just switched something on/off.

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


Re: [OpenWrt-Devel] Compiling custom kernel for latest trunk

2013-01-15 Thread darius
Thank you both so much for help. It was quite difficult for me to find an
information. I've pasted similar question on other forums and seems like
people don't like to answer to 'how to questions'. Well I'd be glad to read
about everything, but with OpenWRT finding some developer related
information looks more like reverse engineering by studying existing rules
and makefiles :)
What I wanted in reality is just add addrtype match for iptables. The only
possibility to enable it was only in kernel_menuconfig, but in the end it
turns out that this is not kernel module, but userspace module instead. So
I was really lost. But now with help from other forums I've found how to
add line in include/netfilter.mk on order to be able to add addrtype match
to one of the existing iptables modules.
OpenWRT is not my job, its just hobby and I really like this project and I
really want to participate here. I'm programmer in real life (not linux),
so it's nice for me to be here, but sometimes I'm losing hope when want to
find some information. Is there any source of information where I can read
about those makefiles, build structure and so on ? Wifi doesn't have
in-depth information. Is it only way to know about it is just study
existing makefiles ? It would be super nice if someone could guide me into
this nice world :) For example, I have cross compiled PIM routing daemon
called pimd for openwrt, but still it is on my computer because of gap in
knowledge about OpenWRT build root structure, makefiles and rules. It would
be nice to add this pimd into OpenWRT.
I have another question which I was unable to answer. For example,
iptables-mod-extra has match type called owner. in .config file there is
line like 'CONFIG_NETFILTER_XT_MATCH_OWNER=m'. So the question is: where is
the rule which makes this match type to autoselect as module (m) ? This
match is included with IPT-EXTRA, so not possible to select it as
standalone. Somehow buildroot 'knows' that this is module and that it
should be autoselected as M ? I was unable to find a script or rule which
is responsible for updating .config file with this line. Now, this is good
example of finding information. It's not on the wiki and not in anywhere,
so how to get that kind of information ?


On Tue, Jan 15, 2013 at 6:03 PM, edgar.sol...@web.de wrote:

 On 15.01.2013 16:41, Emmanuel Deloget wrote:
  Le 12/01/2013 16:08, darius a écrit :
  Hello,
 
  Simple question for those who know. I do 'make kernel_menuconfig' then
 select some needed features in kernel and then do 'make -j3' in topdir.
 After image is done, I install it on the router, but my kernel features are
 still not available. So I suppose I've done something wrong with kernel
 compilation. Could someone guide my about compiling custom kernel ?
 

 do not forget to

  make target/linux/{clean,compile} V=99

 after you changed your kernel settings. you might leave out the cleaning
 if you just switched something on/off.

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




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


[OpenWrt-Devel] [PATCHv2 1/2] [packages] fix uid/gid type errors in xtables-addons

2013-01-15 Thread Russell Senior

xtables-addons is broken in conjunction with kernel 3.7 and later in
that uid/gid are now defined by kuid_t and kgid_t typedefs in order to
support namespaces.  Ideally xtables-addons will be modified upstream
to more fully support this abstraction, but in the meantime, this
patch papers over the problem while continuing to support module_param().

Signed-off-by: Russell Senior russ...@personaltelco.net
---
 net/xtables-addons/patches/310-uidgid.patch |   77 +++
 1 files changed, 77 insertions(+), 0 deletions(-)
 create mode 100644 net/xtables-addons/patches/310-uidgid.patch

diff --git a/net/xtables-addons/patches/310-uidgid.patch 
b/net/xtables-addons/patches/310-uidgid.patch
new file mode 100644
index 000..28ec96c
--- /dev/null
+++ b/net/xtables-addons/patches/310-uidgid.patch
@@ -0,0 +1,77 @@
+diff -ru xtables-addons-2.0-orig/extensions/xt_DNETMAP.c 
xtables-addons-2.0/extensions/xt_DNETMAP.c
+--- xtables-addons-2.0-orig/extensions/xt_DNETMAP.c2013-01-14 
15:44:47.0 -0800
 xtables-addons-2.0/extensions/xt_DNETMAP.c 2013-01-15 10:26:48.0 
-0800
+@@ -31,6 +31,7 @@
+ #include net/net_namespace.h
+ #include net/netns/generic.h
+ #include linux/netfilter/nf_nat.h
++#include linux/uidgid.h
+ #include compat_xtables.h
+ #include xt_DNETMAP.h
+ 
+@@ -329,8 +330,8 @@
+   ret = -ENOMEM;
+   goto out;
+   }
+-  pde_data-uid = proc_uid;
+-  pde_data-gid = proc_gid;
++  pde_data-uid = KUIDT_INIT(proc_uid);
++  pde_data-gid = KGIDT_INIT(proc_gid);
+ 
+   /* statistics */
+   pde_stat = create_proc_entry(p-proc_str_stat, proc_perms,
+@@ -342,8 +343,8 @@
+   }
+   pde_stat-data = p;
+   pde_stat-read_proc = dnetmap_stat_proc_read;
+-  pde_stat-uid = proc_uid;
+-  pde_stat-gid = proc_gid;
++  pde_stat-uid = KUIDT_INIT(proc_uid);
++  pde_stat-gid = KGIDT_INIT(proc_gid);
+ #endif
+ 
+   spin_lock_bh(dnetmap_lock);
+diff -ru xtables-addons-2.0-orig/extensions/xt_condition.c 
xtables-addons-2.0/extensions/xt_condition.c
+--- xtables-addons-2.0-orig/extensions/xt_condition.c  2012-11-12 
10:03:51.0 -0800
 xtables-addons-2.0/extensions/xt_condition.c   2013-01-15 
10:28:30.0 -0800
+@@ -20,6 +20,7 @@
+ #include linux/string.h
+ #include linux/version.h
+ #include linux/netfilter/x_tables.h
++#include linux/uidgid.h
+ #include asm/uaccess.h
+ #include xt_condition.h
+ #include compat_xtables.h
+@@ -155,8 +156,8 @@
+   var-status_proc-read_proc  = condition_proc_read;
+   var-status_proc-write_proc = condition_proc_write;
+   list_add(var-list, conditions_list);
+-  var-status_proc-uid = condition_uid_perms;
+-  var-status_proc-gid = condition_gid_perms;
++  var-status_proc-uid = KUIDT_INIT(condition_uid_perms);
++  var-status_proc-gid = KGIDT_INIT(condition_gid_perms);
+   mutex_unlock(proc_lock);
+   info-condvar = var;
+   return 0;
+diff -ru xtables-addons-2.0-orig/extensions/xt_quota2.c 
xtables-addons-2.0/extensions/xt_quota2.c
+--- xtables-addons-2.0-orig/extensions/xt_quota2.c 2012-11-12 
10:03:51.0 -0800
 xtables-addons-2.0/extensions/xt_quota2.c  2013-01-15 10:30:20.0 
-0800
+@@ -17,6 +17,7 @@
+ #include linux/skbuff.h
+ #include linux/spinlock.h
+ #include linux/version.h
++#include linux/uidgid.h
+ #include asm/atomic.h
+ 
+ #include linux/netfilter/x_tables.h
+@@ -131,8 +132,8 @@
+   p-data = e;
+   p-read_proc= quota_proc_read;
+   p-write_proc   = quota_proc_write;
+-  p-uid  = quota_list_uid;
+-  p-gid  = quota_list_gid;
++  p-uid  = KUIDT_INIT(quota_list_uid);
++  p-gid  = KGIDT_INIT(quota_list_gid);
+   list_add_tail(e-list, counter_list);
+   spin_unlock_bh(counter_list_lock);
+   return e;
-- 
1.7.2.2



-- 
Russell Senior, President
russ...@personaltelco.net
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCHv3 2/2] [packages] update xtables-addons from 2.0 to 2.1 for kernel versions 3.7 and later

2013-01-15 Thread Russell Senior

tweak PKG_VERSION and md5sum, and remove a patch already upstream. 

Naturally, removing the patch introduced fuzz in a subsequent patch that
touches extentions/xt_DNETMAP.c.  This version fixes that.  Actually
compile tested this time.  Needs [PATCHv2 1/2] applied first.

Signed-off-by: Russell Senior russ...@personaltelco.net
---
 net/xtables-addons/Makefile|4 +-
 .../patches/110-dnetmap-linux-3.7.patch|   22 -
 net/xtables-addons/patches/310-uidgid.patch|   34 ++--
 3 files changed, 19 insertions(+), 41 deletions(-)
 delete mode 100644 net/xtables-addons/patches/110-dnetmap-linux-3.7.patch

diff --git a/net/xtables-addons/Makefile b/net/xtables-addons/Makefile
index 9bf39da..c66a227 100644
--- a/net/xtables-addons/Makefile
+++ b/net/xtables-addons/Makefile
@@ -10,9 +10,9 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=xtables-addons
 ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,3.7.0)),1)
-PKG_VERSION:=2.0
+PKG_VERSION:=2.1
 PKG_RELEASE:=1
-PKG_MD5SUM:=26b1b1dbb4a8faff24597723ebde04c9
+PKG_MD5SUM:=b624fc57bbda9e15c33a6471e4ec75e1
 else
 PKG_VERSION:=1.45
 PKG_RELEASE:=3
diff --git a/net/xtables-addons/patches/110-dnetmap-linux-3.7.patch 
b/net/xtables-addons/patches/110-dnetmap-linux-3.7.patch
deleted file mode 100644
index f0aa6d4..000
--- a/net/xtables-addons/patches/110-dnetmap-linux-3.7.patch
+++ /dev/null
@@ -1,22 +0,0 @@
 xtables-addons-2.0/extensions/xt_DNETMAP.c~2012-11-12 
18:03:51.0 +
-+++ xtables-addons-2.0/extensions/xt_DNETMAP.c 2012-12-20 00:06:10.656675731 
+
-@@ -27,7 +27,7 @@
- #include linux/netfilter_ipv4.h
- #include linux/netfilter/x_tables.h
- #include linux/version.h
--#include net/netfilter/nf_nat_rule.h
-+#include net/netfilter/nf_nat.h
- #include net/net_namespace.h
- #include net/netns/generic.h
- #include linux/netfilter/nf_nat.h
 xtables-addons-2.0/mconfig 2012-12-20 00:55:11.445085492 +
-+++ xtables-addons-2.0/mconfig~2012-12-20 00:54:29.0 +
-@@ -4,7 +4,7 @@ build_ACCOUNT=m
- build_CHAOS=m
- build_DELUDE=m
- build_DHCPMAC=m
--build_DNETMAP=
-+build_DNETMAP=m
- build_ECHO=m
- build_IPMARK=m
- build_LOGMARK=m
diff --git a/net/xtables-addons/patches/310-uidgid.patch 
b/net/xtables-addons/patches/310-uidgid.patch
index 28ec96c..2cd8c7b 100644
--- a/net/xtables-addons/patches/310-uidgid.patch
+++ b/net/xtables-addons/patches/310-uidgid.patch
@@ -1,15 +1,15 @@
-diff -ru xtables-addons-2.0-orig/extensions/xt_DNETMAP.c 
xtables-addons-2.0/extensions/xt_DNETMAP.c
 xtables-addons-2.0-orig/extensions/xt_DNETMAP.c2013-01-14 
15:44:47.0 -0800
-+++ xtables-addons-2.0/extensions/xt_DNETMAP.c 2013-01-15 10:26:48.0 
-0800
-@@ -31,6 +31,7 @@
+diff -ru xtables-addons-2.1-orig/extensions/xt_DNETMAP.c 
xtables-addons-2.1/extensions/xt_DNETMAP.c
+--- xtables-addons-2.1-orig/extensions/xt_DNETMAP.c2012-12-26 
23:01:00.0 -0800
 xtables-addons-2.1/extensions/xt_DNETMAP.c 2013-01-15 11:14:22.0 
-0800
+@@ -26,6 +26,7 @@
+ #include linux/netfilter.h
+ #include linux/netfilter_ipv4.h
+ #include linux/netfilter/x_tables.h
++#include linux/uidgid.h
+ #include linux/version.h
  #include net/net_namespace.h
  #include net/netns/generic.h
- #include linux/netfilter/nf_nat.h
-+#include linux/uidgid.h
- #include compat_xtables.h
- #include xt_DNETMAP.h
- 
-@@ -329,8 +330,8 @@
+@@ -328,8 +329,8 @@
ret = -ENOMEM;
goto out;
}
@@ -20,7 +20,7 @@ diff -ru xtables-addons-2.0-orig/extensions/xt_DNETMAP.c 
xtables-addons-2.0/exte
  
/* statistics */
pde_stat = create_proc_entry(p-proc_str_stat, proc_perms,
-@@ -342,8 +343,8 @@
+@@ -341,8 +342,8 @@
}
pde_stat-data = p;
pde_stat-read_proc = dnetmap_stat_proc_read;
@@ -31,9 +31,9 @@ diff -ru xtables-addons-2.0-orig/extensions/xt_DNETMAP.c 
xtables-addons-2.0/exte
  #endif
  
spin_lock_bh(dnetmap_lock);
-diff -ru xtables-addons-2.0-orig/extensions/xt_condition.c 
xtables-addons-2.0/extensions/xt_condition.c
 xtables-addons-2.0-orig/extensions/xt_condition.c  2012-11-12 
10:03:51.0 -0800
-+++ xtables-addons-2.0/extensions/xt_condition.c   2013-01-15 
10:28:30.0 -0800
+diff -ru xtables-addons-2.1-orig/extensions/xt_condition.c 
xtables-addons-2.1/extensions/xt_condition.c
+--- xtables-addons-2.1-orig/extensions/xt_condition.c  2012-12-26 
23:01:00.0 -0800
 xtables-addons-2.1/extensions/xt_condition.c   2013-01-15 
11:13:44.0 -0800
 @@ -20,6 +20,7 @@
  #include linux/string.h
  #include linux/version.h
@@ -53,9 +53,9 @@ diff -ru xtables-addons-2.0-orig/extensions/xt_condition.c 
xtables-addons-2.0/ex
mutex_unlock(proc_lock);
info-condvar = var;
return 0;
-diff -ru xtables-addons-2.0-orig/extensions/xt_quota2.c 
xtables-addons-2.0/extensions/xt_quota2.c
 xtables-addons-2.0-orig/extensions/xt_quota2.c 

Re: [OpenWrt-Devel] support for TP-Link TL-WDR3500. Was: Re: [RFC] ar71xx: add support for the TP-Link TL-WDR4310 v1.0

2013-01-15 Thread Gui Iribarren
On Fri, Dec 21, 2012 at 11:56 PM, Stefan Lippers-Hollmann s@gmx.de wrote:
 While there still is a small chance
 that the differences are small enough that OpenWrt might just work
 for this device as well, it does look like there is a different
 solution in place for the networking switch, so it's more likely that
 some more involved source changes might be needed.

Hello Gabor, i'm adding you to CC since your email is in all board
support files :)
we're trying to get openwrt running on TPLink WDR3500, a close
relative of WDR3600 lacking gigabit ethernet

Stefan,
your predictions were right, i tftp'ed an openwrt image (compiled for
wdr3600) to the wdr3500, and everything Just Worked, except the
ethernet!
tested working OK the USB port and dual-band wifi.

But there's no eth0 whatsoever, and corresponding leds do not light up
when an ethernet cable is connected.

Attached is the bootlog with openwrt trunk r33815, hope it helps.

I made some hi-res pictures of the board, and upload them to the wiki,
http://wiki.openwrt.org/toh/tp-link/tl-wdr3500

i'm not sure if it should be merged them in
http://wiki.openwrt.org/toh/tp-link/tl-wdr3600
feel free to do so, if the gigabit difference is not worth a separate page :)

I tried to dig into board support source files, to see if i could make
a minor change, but the best i could decipher was juhosg email :P

So, help will be much appreciated; and any further testing or
information needed will
receive prompt replies.

Thanks for the guidance so far, it's been a charming welcome into the
world of adding openwrt support for a new board!

Gui


On Tue, Jan 15, 2013 at 11:42 AM, Gui Iribarren g...@altermundi.net wrote:
 Hi Stefan,
 we truly appreciate your tips and guidance,

 attached is the original bootlog from serial console, in case it's useful.
 I'm about to try adapting  flashing a binary for wdr3600,

 Cheers!!


 On Sat, Dec 22, 2012 at 12:05 AM, Nicolás Echániz
 nicoecha...@codigosur.org wrote:
 On 12/21/2012 11:56 PM, Stefan Lippers-Hollmann wrote:
 Hi

 On Saturday 22 December 2012, Stefan Lippers-Hollmann wrote:
 On Thursday 20 December 2012, Nicolás Echániz wrote:
 TP-Link WDR3600 is supported since r33219. It has the same hardware as
 the WDR4300 with one less chain/antenna.

 However the model WDR3500, which is similar to WDR3600 is not yet
 supported. Outstanding differences in relation to WDR3600 are:

 For the TL-WDR3600, the situation was easy (once TL-WDR4300 was
 supported), because it's essentially the same device, with only minor
 differences for the 2.4 GHz radio (but still supported by the same
 driver, ath9k). Without knowing any details, I fear this might be
 slightly different with the TL-WDR3500.

 - no gigabit ethernet

 Yes, and this means there is a big chance that the switch chipset might
 be different. In contrast to wlan support, where you might be able to
 just risk it, missing ethernet/ switch support would have much bigger
 consequences. Given that The Atheros DB120 reference architecture, from
 which these TP-Link routers are closely derived, is quite well
 integrated and is specified with an Atheros AR8327N GBit/s switch,
 there is a significant chance that a different switch chipset might be
 used here - or eventually some completely different base board.

 O.k., after looking at the FCC pictures, which are not detailed enough
 to read all of the chips, it becomes clear that they're using a
 similar, but significantly different PCB for the TL-WDR3500 - so you
 really should make high resolution pictures and check bootlog/ GPL
 tarball before risking anything. While there still is a small chance
 that the differences are small enough that OpenWrt might just work
 for this device as well, it does look like there is a different
 solution in place for the networking switch, so it's more likely that
 some more involved source changes might be needed.

 Stephan, thanks a lot for your detailed explanation.

 I live in a small town with difficult local access to hardware but I'll
 have a WDR3500 delivered from Buenos Aires in the following weeks and
 then I'll get the high resolution images and original bootlog.

 I'll update as soon as I have this information.


 Cheers,

 NicoEchániz
 altermundi.net




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


TLWDR3500_openwrt_r33815_serial_boot.log
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Get to RedBoot prompt in Atheros-based router

2013-01-15 Thread Nguyễn Hồng Quân

Hello,

On Tue 15 Jan 2013 05:31:45 PM ICT, Bastian Bittorf wrote:


it should be possible from DD-WRT/openwrt to alter variables from
redboot. look out for fconfig:

http://wiki.openwrt.org/doc/techref/bootloader/redboot


Unfortunately, because I cannot get access to RedBoot, I cannot reset 
that variable.
I'm trying the last option: serial port. But what I got in Terminal is 
all non-printable characters. Do you have experience in this? Maybe one 
of signal lines is erroneous?


--
Regards,
Quân

Y!IM: ng_hquan_vn
GTalk: ng.hong.quan
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH][net][telephony] add asterisk11 package

2013-01-15 Thread Jiri Slachta
Asterisk 11 has been recently released. It's a new LTS version of current 
asterisk18 package. All macro's were rewritten to make packaging simplier and 
possible addition of new asterisk modules easier.

Signed-off-by: Jiri Slachta slac...@cesnet.cz
Index: net/asterisk-11.x/Makefile
===
--- net/asterisk-11.x/Makefile  (revision 0)
+++ net/asterisk-11.x/Makefile  (revision 0)
@@ -0,0 +1,386 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=asterisk11
+PKG_VERSION:=11.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://downloads.asterisk.org/pub/telephony/asterisk/releases/
+PKG_MD5SUM:=3d3da6016e3b238cd7ea3bf0df51403d
+
+PKG_BUILD_DIR=$(BUILD_DIR)/asterisk-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/asterisk11/install/module
+   $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*$(2).so* 
$(1)/usr/lib/asterisk/modules/
+endef
+
+define Package/asterisk11/install/conffile
+   $(INSTALL_DIR) $(1)/etc/asterisk
+   $(CP) $(PKG_INSTALL_DIR)/etc/asterisk/*$(2)* $(1)/etc/asterisk/
+endef
+
+define Package/asterisk11/install/lib
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/$(2).so* $(1)/usr/lib/
+endef
+
+define Package/asterisk11/install/sbin
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(2) $(1)/usr/sbin/
+endef
+
+define Package/asterisk11/install/sounds
+   $(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/$(2) 
$(1)/usr/lib/asterisk/sounds/
+endef
+
+define BuildAsteriskModule
+  define Package/asterisk11-$(1)
+  $$(call Package/asterisk11/Default)
+TITLE:=$(2) support
+DEPENDS:= asterisk11 $(4)
+  endef
+
+  define Package/asterisk11-$(1)/conffiles
+$(5)
+  endef
+
+  define Package/asterisk11-$(1)/description
+  $$(call Package/asterisk11/Default/description)
+This package provides support $(3) in Asterisk.
+  endef
+
+  define Package/asterisk11-$(1)/install
+$(foreach c,$(6),$(call Package/asterisk11/install/conffile,$$(1),$(c));)
+$(foreach m,$(7),$(call Package/asterisk11/install/module,$$(1),$(m));)
+$(foreach s,$(8),$(call Package/asterisk11/install/sounds,$$(1),$(s));)
+  endef
+
+  $$(eval $$(call BuildPackage,asterisk11-$(1)))
+endef
+
+define Package/asterisk11/Default
+  SUBMENU:=Telephony
+  SECTION:=net
+  CATEGORY:=Network
+  URL:=http://www.asterisk.org/
+endef
+
+define Package/asterisk11/Default/description
+Asterisk is a complete PBX in software. It provides all of the features
+you would expect from a PBX and more. Asterisk does voice over IP in three
+protocols, and can interoperate with almost all standards-based telephony
+equipment using relatively inexpensive hardware.
+endef
+
+define Package/asterisk11
+$(call Package/asterisk11/Default)
+  TITLE:=Complete open source PBX, v11.x
+  MENU:=1
+  DEPENDS:=+libuuid +libopenssl +libncurses +libpopt +libpthread +libsqlite3 
+librt +zlib @!TARGET_avr32
+endef
+
+define Package/asterisk11/description
+$(call Package/asterisk11/Default/description)
+endef
+
+define Package/asterisk11/conffiles
+/etc/asterisk/asterisk.conf
+/etc/asterisk/acl.conf
+/etc/asterisk/ccss.conf
+/etc/asterisk/modules.conf
+/etc/asterisk/extconfig.conf
+/etc/asterisk/extensions.conf
+/etc/asterisk/features.conf
+/etc/asterisk/indications.conf
+/etc/asterisk/logger.conf
+/etc/asterisk/manager.conf
+/etc/asterisk/rtp.conf
+/etc/asterisk/sip.conf
+/etc/asterisk/sip_notify.conf
+/etc/asterisk/udptl.conf
+/etc/default/asterisk
+/etc/init.d/asterisk
+endef
+
+AST_CFG_FILES:= \
+   asterisk.conf acl.conf ccss.conf extconfig.conf extensions.conf 
features.conf indications.conf logger.conf manager.conf modules.conf \
+   rtp.conf sip_notify.conf sip.conf udptl.conf
+AST_EMB_MODULES:=\
+   app_dial app_echo app_macro app_playback codec_gsm codec_ulaw 
format_gsm format_pcm format_wav format_wav_gsm func_callerid \
+   func_logic func_strings func_timeout chan_sip chan_local pbx_config 
res_crypto res_http_websocket res_rtp_asterisk res_rtp_multicast
+
+define Package/asterisk11/install
+$(call Package/asterisk11/install/lib,$(1),libasteriskssl)
+$(call Package/asterisk11/install/sbin,$(1),asterisk)
+$(call Package/asterisk11/install/sbin,$(1),safe_asterisk)
+$(call Package/asterisk11/install/sbin,$(1),astgenkey)
+$(foreach m,$(AST_CFG_FILES),$(call 
Package/asterisk11/install/conffile,$(1),$(m));)
+$(foreach m,$(AST_EMB_MODULES),$(call 
Package/asterisk11/install/module,$(1),$(m));)
+   $(INSTALL_DIR) $(1)/etc/default
+   $(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
+   $(INSTALL_DIR) $(1)/etc/init.d
+