Re: [OpenWrt-Devel] [UCI] Problem with overwriting settings

2014-03-26 Thread Pawel Kulakowski
Thank you for your answer.

  I'd prefer to have explicit callbacks from hostapd (maybe to a script)
to preserve those changes.
I see that hapd_wps_cred_cb is called to update hostapd config. We can try
here (somehow, maybe script?) update UCI config file.

But what about this scenario:
1) Run hostAP from UCI
2) Use UCI to update settings (for example SSID) and commit changes- but
don't restart hostAP using 'wifi' command
3) Change password using External Registrar
After step 2 both config files (from /etc/config/wireless and
/var/run/hostapd-phyX.conf) contain different SSID. So password
synchronization after step 3 will be very hard (how to decide which file is
up to date... etc.).

BR,
Pawel



On 24 March 2014 14:17, Felix Fietkau n...@openwrt.org wrote:

 On 2014-03-24 14:06, Pawel Kulakowski wrote:
  Hi,
  When hostAP is running in Open mode and STA connects to it using PBC or
  PIN (wps enabled), then wpa_passphrase has been generated and added to
  the conf file (/var/run/hostapd-phyX.conf). Next, if AP is rebooted
  using UCI ('wifi' command), configuration will be overwritten by
  settings from /etc/config/wireless. This is the cause of issue: STA
  can't reconnect to the AP (wpa_passphrase is no longer valid).
  Similar problem can be observed using External Registrar: User can
  change password/ssid etc. using ER. But if UCI is used to restart hostAP
  ('wifi' command), changes will not be saved (hostapd conf file
  overwritten by settings from /etc/config/wireless).
  UCI is not a daemon (but only script) so it's not possible to monitor
  changes made in hostapd conf file (and decide which option is valid:
  from /etc/config/wireless or /var/run/...). Any ideas how solve this
  problem?
 I think simply monitoring the config file for changes is a bad idea. I'd
 prefer to have explicit callbacks from hostapd (maybe to a script) to
 preserve those changes.
 We can patch hostapd to implement that if needed.

 - Felix


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


[OpenWrt-Devel] 3G will not work after reboot

2014-03-26 Thread winton
Hi all,

 

   Set the wan as 3g mode, but after reboot, it doesn't work. 

That's because the /etc/init.d/network starts already but usbmode is not
ready so 3g doesn't work.

I suggest starting usbmode before network.

 

Winton

 



0001-usbmode-start-usbmode-earlier-than-network.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH, kernel] add ap91_pci_init_simple function for initial pci card

2014-03-26 Thread Marshmallow
This patch is for openwrt_12.09 (AA) kernel 3.3.8
 It adds the function for the case that having calibration data in eeprom of 
wifi pci card.
 Compat-wireless provides the way AH_USE_EEPROM(see the macro below) to read 
the calibration data, 
 but the ap91_pci_init functionalities does has the correspond API. Thus 
ap91_pci_init() is not perfect.
  
 macro in hw.h of compat-wireless
/* ah_flags */
#define AH_USE_EEPROM   0x1
  
  
 After using the below patch, we can init the card(most of thoes are 5GHz pci 
card, such as AR958x) like thie way:
 ...
 ap91_pci_init(NULL, NULL);
 ...
  
  
 
Signed-off-by: banglang.huangbanglang.hu...@foxmail.com
---
diff --git a/arch/mips/ath79/dev-ap9x-pci.c b/arch/mips/ath79/dev-ap9x-pci.c
index c08e438..561e9b2 100644
--- a/arch/mips/ath79/dev-ap9x-pci.c
+++ b/arch/mips/ath79/dev-ap9x-pci.c
@@ -92,6 +92,12 @@ static int ap91_pci_plat_dev_init(struct pci_dev *dev)
  return 0;
 }
 
+static int ap91_pci_plat_dev_init_simple(struct pci_dev *dev)
+{
+ dev-dev.platform_data = NULL;
+
+ return 0;
+}
 __init void ap91_pci_init(u8 *cal_data, u8 *mac_addr)
 {
  if (cal_data)
@@ -103,7 +109,11 @@ __init void ap91_pci_init(u8 *cal_data, u8 *mac_addr)
   ap9x_wmac0_data.macaddr = ap9x_wmac0_mac;
  }
 
- ath79_pci_set_plat_dev_init(ap91_pci_plat_dev_init);
+ if((!cal_data)  (!mac_addr))
+  ath79_pci_set_plat_dev_init(ap91_pci_plat_dev_init_simple);
+ else
+  ath79_pci_set_plat_dev_init(ap91_pci_plat_dev_init);
+
  ath79_register_pci();
 
  pci_enable_ath9k_fixup(0, ap9x_wmac0_data.eeprom_data);___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH, packages] fix the issue on initiating multi ssid error (8 ssid for each band, totoal is 16)

2014-03-26 Thread Marshmallow
This patch can fix the issue that ethernet crash or turns into disable status 
when initiating multi ssid (8 for each band, total is 16)
 For more detail, please refer to https://dev.openwrt.org/ticket/15244
  
 My suggestion is to move the line /sbin/wifi down in the front of stop 
when restart/start the network (executing /etc/init.d/network restart)
  
  
 Signed-off-by: banglang.huangbanglang.hu...@foxmail.com
---
diff --git a/etc/init.d/network b/etc/init.d/network
index 429f33d..04b5171 100755
--- a/packages/netifd/files/etc/init.d/network
+++ b/packages/netifd/files/etc/init.d/network
@@ -7,6 +7,7 @@ SERVICE_DAEMONIZE=1
 SERVICE_WRITE_PID=1
 
 start() {
+ /sbin/wifi down
  stop
  [ -e /proc/sys/kernel/core_pattern ]  {
   ulimit -c unlimited
@@ -21,7 +22,6 @@ start() {
 
  sleep 5
 
- /sbin/wifi down
  /sbin/wifi up
 }___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [ar71xx] Support for HiWifi HC6361 router

2014-03-26 Thread Yousong Zhou
Hi, Just got my my chance to try this router.  It's 2014 now and my
comments are late...  Sorry, but getting this board supported in the
OpenWrt trunk is really good.

For those interested, the original patch can be found at the following URL.

http://patchwork.openwrt.org/patch/4244/

On 29 October 2013 22:10, Xiaoning Kang kan...@gmail.com wrote:
 From: Xiaoning Kang kan...@gmail.com

 HiWifi HC6361(aka tw150v1) is a router developed by http://www.hiwifi.com,  
 which is basically a WR703N with larger flash and ram.  It also carries a 4G 
 emmc chip. The manufacturer had released a copy of modified openwrt sources 
 at https://code.hiwifi.com/. so I tried to migrate those changes to openwrt 
 trunk.

 Most of the changes were imported, with a few exceptions like button 
 handling.  The firmware builds and runs fine on my router.

There is only one reset button on the router and you have added the
support in the mach file.  Did I miss something?


 Signed-off-by: Xiaoning Kang kan...@gmail.com
 --

 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
 b/target/linux/ar71xx/base-files/etc/diag.sh
 index 3962aa2..55e9a0b 100755
 --- a/target/linux/ar71xx/base-files/etc/diag.sh
 +++ b/target/linux/ar71xx/base-files/etc/diag.sh
 @@ -149,6 +149,9 @@ get_status_led() {
 tl-wr2543n)
 status_led=tp-link:green:wps
 ;;
 +   tw150v1)
 +   status_led=tw150v1:green:system
 +   ;;
 unifi)
 status_led=ubnt:green:dome
 ;;
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 index bd1c4b7..ed30755 100755
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
 @@ -229,6 +229,11 @@ tl-wr2543n)
 ucidef_set_led_usbdev usb USB tp-link:green:usb 1-1
 ;;

 +tw150v1)
 +   ucidef_set_led_default inet INET tw150v1:green:internet 0
 +   ucidef_set_led_wlan wlan WLAN tw150v1:green:wlan-2p4 wifi0tpt
 +   ;;
 +

Do not know about wifi0tpt, shouldn't it be wifi0tpt?  There is no
wifi0tpt in the wiki page for ledtrig.

http://wiki.openwrt.org/doc/uci/system#leds

  wrt160nl)
 ucidef_set_led_wlan wlan WLAN wrt160nl:blue:wlan phy0tpt
 ;;
 @@ -272,6 +277,10 @@ wzr-hp-g300nh)
 ucidef_set_led_netdev router Router buffalo:green:router eth1
 ucidef_set_led_usbdev usb USB buffalo:blue:usb 1-1
 ;;
 +tw150v1)
 +ucidef_set_led_default inet INET tw150v1:green:internet 0
 +ucidef_set_led_wlan wlan WLAN tw150v1:green:wlan-2p4 wifi0tpt
 +;;

ditto.


  zcn-1523h-2)
 ucidef_set_led_netdev lan1 lan1 zcn-1523h:green:lan1 eth0
 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
 b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 index 3d6ab29..03e30c4 100755
 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
 @@ -271,6 +271,7 @@ tl-wdr3500 |\
  tl-wr741nd |\
  tl-wr741nd-v4 |\
  tl-wr841n-v7 |\
 +tw150v1 |\
  whr-g301n |\
  whr-hp-g300n |\
  whr-hp-gn |\
 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
 b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 index 06786e7..b5c50bd 100755
 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
 +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
 @@ -573,6 +573,9 @@ ar71xx_board_detect() {
 8devices Carambola2*)
 name=carambola2
 ;;
 +*Hiwifi Wireless HC6361 Board)
 +name=tw150v1
 +;;

I saw in the homepage that the formal brand name for this router is
HiWiFi, so you may want to use it here.

 esac

 case $machine in
 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
 b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 index 28e4a91..5122c64 100755
 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
 @@ -106,6 +106,13 @@ platform_check_image() {
 }
 return 0
 ;;
 +   tw150v1)
 +   [ $magic_long != 68737173 -a $magic_long != 2705 ]  
 {
 +   echo Invalid image type.
 +   return 1
 +   }
 +   return 0
 +   ;;

$magic_long will never equal to 2705 as it is always of length 8
bytes.  Do you actually mean $magic and 2705?

 ap81 | \
 ap83 | \
 ap132 | \
 @@ -324,6 +331,9 @@ platform_do_upgrade() {
 om2p-lc)
 platform_do_upgrade_openmesh $ARGV
 ;;
 +tw150v1)
 +platform_do_upgrade_twarxx $ARGV
 +;;

Looks like definition of platform_do_upgrade_twarxx() is missing from
this patch.

 *)

[OpenWrt-Devel] /var/dhcp.leases empty

2014-03-26 Thread Zhang Weiwu


Using Bleeding Edge, r39770. /var/dhcp.leases is always empty, no matter 
how many hosts in the lan got assigned IPv4 addresses. LUCI also shows 
There are no active leases.


Strange enough, LUCI shows multiple hosts under IPv6 DHCP section. This 
single fact means IPv6 leases are not stored in /var/dhcp.leases, but some 
other places. For hosts listed in Active DHCPv6 Leases, DNS server 
(dnsmasq) cannot resolve them.


Expected behaviour? Bleeding edge bug?

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


Re: [OpenWrt-Devel] /var/dhcp.leases empty

2014-03-26 Thread Yousong Zhou
Hi,

On 26 March 2014 20:56, Zhang Weiwu zhangwe...@realss.com wrote:

 Using Bleeding Edge, r39770. /var/dhcp.leases is always empty, no matter how
 many hosts in the lan got assigned IPv4 addresses. LUCI also shows There
 are no active leases.

Not sure about this, but I can confirm that r40007 works fine.


 Strange enough, LUCI shows multiple hosts under IPv6 DHCP section. This
 single fact means IPv6 leases are not stored in /var/dhcp.leases, but some
 other places. For hosts listed in Active DHCPv6 Leases, DNS server
 (dnsmasq) cannot resolve them.

DHCPv6 leases are handled by odhcpd and the records are stored in
/var/hosts/odhcpd.  So it is expected behavior that dnsmasq cannot
resolve those requests.


 Expected behaviour? Bleeding edge bug?

 Thanks.
 Zhang Weiwu
 ___
 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


Re: [OpenWrt-Devel] /var/dhcp.leases empty

2014-03-26 Thread Yousong Zhou
Hi,

On 26 March 2014 21:07, Yousong Zhou yszhou4t...@gmail.com wrote:
 Hi,

 On 26 March 2014 20:56, Zhang Weiwu zhangwe...@realss.com wrote:

 Using Bleeding Edge, r39770. /var/dhcp.leases is always empty, no matter how
 many hosts in the lan got assigned IPv4 addresses. LUCI also shows There
 are no active leases.

 Not sure about this, but I can confirm that r40007 works fine.

Can you check your /etc/config/dhcp and the generated
/var/etc/dnsmasq.conf and confirm that option leasefile is properly
configured?



 Strange enough, LUCI shows multiple hosts under IPv6 DHCP section. This
 single fact means IPv6 leases are not stored in /var/dhcp.leases, but some
 other places. For hosts listed in Active DHCPv6 Leases, DNS server
 (dnsmasq) cannot resolve them.

 DHCPv6 leases are handled by odhcpd and the records are stored in
 /var/hosts/odhcpd.  So it is expected behavior that dnsmasq cannot
 resolve those requests.


 Expected behaviour? Bleeding edge bug?

 Thanks.
 Zhang Weiwu
 ___
 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


Re: [OpenWrt-Devel] /var/dhcp.leases empty

2014-03-26 Thread Zhang Weiwu



On Wed, 26 Mar 2014, Yousong Zhou wrote:


Can you check your /etc/config/dhcp and the generated
/var/etc/dnsmasq.conf and confirm that option leasefile is properly
configured?


Yes, I can confirm in both files the correct path is configured: 
/tmp/dhcp.leases, which is /var/dhcp.leases



DHCPv6 leases are handled by odhcpd and the records are stored in
/var/hosts/odhcpd.  So it is expected behavior that dnsmasq cannot
resolve those requests.


Thanks for the info. Now I realized that ipv6 address are not from dnsmasq. 
I am afraid I have a racing codition here between odhcpd and dnsmasq, and I 
should be able to fix by removing or disabling odhcpd - due to poor ISP 
support, I cannot make use of IPv6 anyway - but I failed to google out how 
to disable odhcpd.

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


[OpenWrt-Devel] amule package not available?

2014-03-26 Thread Zhang Weiwu


Using Bleeding Edge.

opkg list | grep mule yeilds nothing. A visite to the package list
http://downloads.openwrt.org/snapshots/trunk/ar71xx/packages/
confirms that not any mule is there.

I shouldn't be using the Bleeding Edge (not a developer myself) but it was 
so when I got the box. First I thought that I am too edgy to enjoy amule (or 
similiar), but a google search of site:downloads.openwrt.org amule returns 
only the source package, hinting perhaps there wasn't a binary package even 
for the stable releases. True?


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


Re: [OpenWrt-Devel] amule package not available?

2014-03-26 Thread Zhang Weiwu

On Wed, 26 Mar 2014, Jiří Šlachta wrote:


buildbots says that amule is currently broken (=buildbots are
not able to compile amule).

You can wait for this patch to be tested, accepted and applied
( http://patchwork.openwrt.org/patch/5047/ ) or to compile amule
for OpenWrt by yourself.


Thank you for your prompt reply! I haven't be on the edge of compiling for 
too many years, so my option will be to wait.___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Subject: [PATCH 1/1] [package] Rework gnokii package to offer sendsms subpackage and the smsd service.

2014-03-26 Thread Andreas Thienemann

From: Andreas Thienemann andr...@bawue.net

Offer better SMS integration for the gnokii package:

gnokii-sendsms is a ncurses/dialog based frontend to interactively send 
a SMS message through a supported modem.
gnoki-smsd is a SMS spooling service based on gnokii. Messages dropped 
into a spooldir are sent automatically while incoming messages are sent 
to a handler script to flexibly deal with the message.


Signed-off-by: Andreas Thienemann andr...@bawue.net

---
 utils/gnokii/Makefile  |   83 
+++--
 utils/gnokii/files/sms-handler.sh  |   32 


 utils/gnokii/files/smsd.config |5 +++
 utils/gnokii/files/smsd.init   |   31 
+++

 utils/gnokii/patches/001-smsd-modules.patch|   14 ++
 utils/gnokii/patches/002-libtool-destdir.patch |   12 +
 6 files changed, 174 insertions(+), 3 deletions(-)
 create mode 100644 utils/gnokii/files/sms-handler.sh
 create mode 100644 utils/gnokii/files/smsd.config
 create mode 100644 utils/gnokii/files/smsd.init
 create mode 100644 utils/gnokii/patches/001-smsd-modules.patch
 create mode 100644 utils/gnokii/patches/002-libtool-destdir.patch

diff --git a/utils/gnokii/Makefile b/utils/gnokii/Makefile
index 45f8f91..e06b418 100644
--- a/utils/gnokii/Makefile
+++ b/utils/gnokii/Makefile
@@ -21,14 +21,18 @@ PKG_BUILD_PARALLEL:=0

 include $(INCLUDE_DIR)/package.mk

-define Package/gnokii
+define Package/gnokii/Default
   SECTION:=utils
   CATEGORY:=Utilities
-  DEPENDS:=+libusb-compat
-  TITLE:=Gnokii - Datasuite for the mobile phones
   URL:=http://www.gnokii.org/
 endef

+define Package/gnokii
+  $(call Package/gnokii/Default)
+  TITLE:=Gnokii - Datasuite for the mobile phones
+  DEPENDS:=+libusb-compat
+endef
+
 define Package/gnokii/description
Gnokii is a suite of programs linked against a backend
library that allows communication with the phones. It
@@ -36,6 +40,28 @@ define Package/gnokii/description
capable mobiles as well as Symbian phones.
 endef

+define Package/gnokii-sendsms
+  $(call Package/gnokii/Default)
+  TITLE:=Gnokii - Dialog based frontend for sending short messages
+  DEPENDS:=+gnokii +bash +dialog
+endef
+
+define Package/gnokii/description
+   Ncurses frontend to easily send short messages via gnokii
+endef
+
+define Package/gnokii-smsd
+  $(call Package/gnokii/Default)
+  DEPENDS:=+gnokii +glib2
+  TITLE:=Gnokii SMS Server
+endef
+
+define Package/gnokii-smsd/description
+   SMS Spooling server based on gnokii
+   Only the file backend is supported for now.
+endef
+
+
 define Build/Configure
$(call Build/Configure/Default, \
--without-libiconv-prefix \
@@ -53,6 +79,27 @@ define Build/Configure
)
 endef

+define Build/Compile
+   $(call Build/Compile/gnokii)
+   $(call Build/Compile/gnokii-smsd)
+endef
+
+define Build/Compile/gnokii-smsd
+   $(MAKE) -C $(PKG_BUILD_DIR)/smsd
+endef
+
+
+define Build/Install
+   $(call Build/Install/Default)
+   $(call Build/Install/gnokii-smsd)
+endef
+
+define Build/Install/gnokii-smsd
+   $(MAKE) -C $(PKG_BUILD_DIR)/smsd \
+   DESTDIR=$(PKG_INSTALL_DIR) \
+   install
+endef
+
 define Package/gnokii/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/usr/sbin
@@ -65,4 +112,34 @@ define Package/gnokii/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnokii.so $(1)/usr/lib
 endef

+define Package/gnokii-sendsms/install
+   $(INSTALL_DIR) $(1)/usr/bin
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sendsms $(1)/usr/bin
+endef
+
+define Package/gnokii-smsd/install
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smsd $(1)/usr/sbin
+   $(INSTALL_BIN) ./files/sms-handler.sh $(1)/usr/sbin
+   $(INSTALL_DIR) $(1)/etc/init.d
+   $(INSTALL_BIN) ./files/smsd.init $(1)/etc/init.d/smsd
+   $(INSTALL_DIR) $(1)/etc/config
+   $(INSTALL_CONF) ./files/smsd.config $(1)/etc/config/smsd
+   $(INSTALL_DIR) $(1)/usr/lib/smsd
+   $(CP) $(PKG_INSTALL_DIR)/usr/lib/smsd/libfile.so $(1)/usr/lib/smsd
+   $(CP) $(PKG_INSTALL_DIR)/usr/lib/smsd/libfile.la $(1)/usr/lib/smsd
+endef
+
+define Package/mrelay/prerm
+   #!/bin/sh
+   # check if we are on real system
+   if [ -z $${IPKG_INSTROOT} ]; then
+   echo Removing rc.d symlink for smsd
+   /etc/init.d/smsd disable
+   fi
+   exit 0
+endef
+
 $(eval $(call BuildPackage,gnokii))
+$(eval $(call BuildPackage,gnokii-sendsms))
+$(eval $(call BuildPackage,gnokii-smsd))
diff --git a/utils/gnokii/files/sms-handler.sh 
b/utils/gnokii/files/sms-handler.sh

new file mode 100644
index 000..d7b4359
--- /dev/null
+++ b/utils/gnokii/files/sms-handler.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Very simple SMS handler for smsd.
+# All it does is spool received messages into the 

Re: [OpenWrt-Devel] [PATCHv2] netifd: Reload proto on topology change

2014-03-26 Thread Helmut Schaa
On Tue, Mar 25, 2014 at 4:50 PM, Felix Fietkau n...@openwrt.org wrote:
 On 2014-03-25 16:44, Helmut Schaa wrote:
 On Thu, Mar 20, 2014 at 4:26 PM, Helmut Schaa
 helmut.sc...@googlemail.com wrote:
 Introduce a new device event topology change that gets signaled
 by bridges on adding/removing members.

 On topology changes the proto handlers are requested to renew
 which is most useful for DHCP.

 Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
 ---

 Changes in v2:
 - Only run renew handler if registered during proto init

 Felix, did you have a chance to review this yet?
 Sorry, I forgot to ping you back. I merged this one a few days ago.


Thanks, I'll send patches for the dhcp and dhcpv6 proto scripts then ...
Helmut
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCHv2 2/2] odhcp6c: Add renew handler for proto dhcpv6

2014-03-26 Thread Helmut Schaa

Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
---

Changes in v2: Tell netifd core that we have a renew handler


 package/network/ipv6/odhcp6c/files/dhcpv6.sh | 8 
 1 file changed, 8 insertions(+)

diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh 
b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
index 9b6275e..cd03c25 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
@@ -5,6 +5,8 @@
 init_proto $@
 
 proto_dhcpv6_init_config() {
+   renew_handler=1
+
proto_config_add_string 'reqaddress:or(try,force,none)'
proto_config_add_string 'reqprefix:or(auto,no,range(0, 64))'
proto_config_add_string clientid
@@ -67,6 +69,12 @@ proto_dhcpv6_setup() {
$opts $iface
 }
 
+proto_dhcpv6_renew() {
+   local interface=$1
+   # SIGUSR1 forces odhcp6c to renew its lease
+   proto_kill_command $interface 16
+}
+
 proto_dhcpv6_teardown() {
local interface=$1
proto_kill_command $interface
-- 
1.8.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCHv2 1/2] netifd: Add renew handler for proto dhcp

2014-03-26 Thread Helmut Schaa

Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
---
Changes in v2: Tell netifd core that we have a renew handler

 package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 8 
 1 file changed, 8 insertions(+)

diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh 
b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index 93f4a5e..4c03403 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -5,6 +5,8 @@
 init_proto $@
 
 proto_dhcp_init_config() {
+   renew_handler=1 
+
proto_config_add_string 'ipaddr:ipaddr'
proto_config_add_string 'netmask:ipaddr'
proto_config_add_string 'hostname:hostname'
@@ -52,6 +54,12 @@ proto_dhcp_setup() {
$clientid $broadcast $dhcpopts
 }
 
+proto_dhcp_renew() {
+   local interface=$1
+   # SIGUSR1 forces udhcpc to renew its lease
+   proto_kill_command $interface 16
+}
+
 proto_dhcp_teardown() {
local interface=$1
proto_kill_command $interface
-- 
1.8.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCHv2 2/2] odhcp6c: Add renew handler for proto dhcpv6

2014-03-26 Thread Helmut Schaa
On Wed, Mar 26, 2014 at 5:41 PM, Jonas Gorski j...@openwrt.org wrote:
 On Wed, Mar 26, 2014 at 5:11 PM, Helmut Schaa
 helmut.sc...@googlemail.com wrote:

 Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
 ---

 Changes in v2: Tell netifd core that we have a renew handler


  package/network/ipv6/odhcp6c/files/dhcpv6.sh | 8 
  1 file changed, 8 insertions(+)

 diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh 
 b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
 index 9b6275e..cd03c25 100755
 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
 +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
 @@ -5,6 +5,8 @@
  init_proto $@

  proto_dhcpv6_init_config() {
 +   renew_handler=1
 +
 proto_config_add_string 'reqaddress:or(try,force,none)'
 proto_config_add_string 'reqprefix:or(auto,no,range(0, 64))'
 proto_config_add_string clientid
 @@ -67,6 +69,12 @@ proto_dhcpv6_setup() {
 $opts $iface
  }

 +proto_dhcpv6_renew() {
 +   local interface=$1
 +   # SIGUSR1 forces odhcp6c to renew its lease
 +   proto_kill_command $interface 16

 SIGUSR1 is 16 only for mips; other arches use different values (see
 e.g. 
 http://de.wikipedia.org/wiki/Signal_(Computer)#G.C3.A4ngige_UNIX-Signale).

Ouch, thanks for catching that!
Helmut
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCHv2 2/2] odhcp6c: Add renew handler for proto dhcpv6

2014-03-26 Thread Jonas Gorski
On Wed, Mar 26, 2014 at 5:11 PM, Helmut Schaa
helmut.sc...@googlemail.com wrote:

 Signed-off-by: Helmut Schaa helmut.sc...@googlemail.com
 ---

 Changes in v2: Tell netifd core that we have a renew handler


  package/network/ipv6/odhcp6c/files/dhcpv6.sh | 8 
  1 file changed, 8 insertions(+)

 diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh 
 b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
 index 9b6275e..cd03c25 100755
 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
 +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
 @@ -5,6 +5,8 @@
  init_proto $@

  proto_dhcpv6_init_config() {
 +   renew_handler=1
 +
 proto_config_add_string 'reqaddress:or(try,force,none)'
 proto_config_add_string 'reqprefix:or(auto,no,range(0, 64))'
 proto_config_add_string clientid
 @@ -67,6 +69,12 @@ proto_dhcpv6_setup() {
 $opts $iface
  }

 +proto_dhcpv6_renew() {
 +   local interface=$1
 +   # SIGUSR1 forces odhcp6c to renew its lease
 +   proto_kill_command $interface 16

SIGUSR1 is 16 only for mips; other arches use different values (see
e.g. 
http://de.wikipedia.org/wiki/Signal_(Computer)#G.C3.A4ngige_UNIX-Signale).


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


[OpenWrt-Devel] [PATCH v1] x86_64 kernel config - add ATA drivers to boot vmware images

2014-03-26 Thread Darren Lissimore

I needed to add the ATA drivers to the defalut x86_64 kernel config to get the 
VMware disk images booting. 

Tested and verified functioning on VMware Workstation 9.0.3 . 

diff --git a/target/linux/x86_64/config-default b/target/linux/x86_64/config-
default
index ad27973..76922a7 100644
--- a/target/linux/x86_64/config-default
+++ b/target/linux/x86_64/config-default
@@ -61,7 +61,9 @@ CONFIG_ARCH_WANT_FRAME_POINTERS=y
 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 # CONFIG_ASUS_LAPTOP is not set
 CONFIG_ATA=y
-# CONFIG_ATA_SFF is not set
+CONFIG_ATA_GENERIC=y
+CONFIG_ATA_PIIX=y
+CONFIG_ATA_SFF=y
 CONFIG_AUDIT_ARCH=y
 CONFIG_BINFMT_MISC=y
 CONFIG_BLK_DEV_SD=y

Signed-off-by: Darren Lissimore darren.lissim...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Netgear R6300 v1/ broadcom 4306 support

2014-03-26 Thread Brink Huffine
I have a netgear r6300v1 and would like to help port it to openwrt. I have
compiled the netgear toolchain as well as the dd-wrt toolchain for this
router from source. Serial cable is attached and nand support is now with
openwrt so using these tools at my disposal I would like to help create a
build environment for it.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Long-distance links ath9k

2014-03-26 Thread Sergey Ryazanov
2014-03-26 9:13 GMT+04:00 Bill Moffitt bmoff...@ayrstone.com:
 It's clear that SOMETHING is getting time-limited, but I have distance=0 and
 dissassoc_low_ack=0 on both the AP and the station, and I'm not sure what
 else I can tweak.

Configure distance parameter according to real distance between points.

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


Re: [OpenWrt-Devel] [PATCH v1] x86_64 kernel config - add ATA drivers to boot vmware images

2014-03-26 Thread Jiri Slachta
Hi,

almost the same patch submitted a while ago was rejected. I do not think your 
patch will be accepted, see:

http://patchwork.openwrt.org/patch/4832/

Jiri

On March 26, 2014 6:16:44 PM CET, Darren Lissimore darren.lissim...@gmail.com 
wrote:

I needed to add the ATA drivers to the defalut x86_64 kernel config to
get the 
VMware disk images booting. 

Tested and verified functioning on VMware Workstation 9.0.3 . 

diff --git a/target/linux/x86_64/config-default
b/target/linux/x86_64/config-
default
index ad27973..76922a7 100644
--- a/target/linux/x86_64/config-default
+++ b/target/linux/x86_64/config-default
@@ -61,7 +61,9 @@ CONFIG_ARCH_WANT_FRAME_POINTERS=y
 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 # CONFIG_ASUS_LAPTOP is not set
 CONFIG_ATA=y
-# CONFIG_ATA_SFF is not set
+CONFIG_ATA_GENERIC=y
+CONFIG_ATA_PIIX=y
+CONFIG_ATA_SFF=y
 CONFIG_AUDIT_ARCH=y
 CONFIG_BINFMT_MISC=y
 CONFIG_BLK_DEV_SD=y

Signed-off-by: Darren Lissimore darren.lissim...@gmail.com
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

-- 
Odesláno z mého telefonu s Androidem pomocí pošty K-9 Mail. Omluvte prosím moji 
stručnost.___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Long-distance links ath9k

2014-03-26 Thread Bill Moffitt


On March 26, 2014 11:29:59 AM PDT, Sergey Ryazanov ryazanov@gmail.com 
wrote:
2014-03-26 9:13 GMT+04:00 Bill Moffitt bmoff...@ayrstone.com:
 It's clear that SOMETHING is getting time-limited, but I have
distance=0 and
 dissassoc_low_ack=0 on both the AP and the station, and I'm not sure
what
 else I can tweak.

Configure distance parameter according to real distance between points.

-- 
BR,
Sergey

Sorry, should have mentioned that, of course, I tried that, and various 
variants of that. At 2 miles (~3000 meters) it had a good connection and could 
consistently measure bandwidth with iperf. Bandwidth was maximized when 
distance=6000 (as expected) and distance=0 (as expected). At 5 miles, it would 
not pass traffic with any value of distance. I tried every value than that made 
any sense (0, 8000, 16000) and some that didn't (3, 50) and the results 
were the same (nothing).

I note that it appeared to be passing authentication data (per the log) but 
failing to authenticate.

I'd be very interested in hearing from anyone who has successfully set up an 
encrypted 5+ mile link (8+ km) with this kind of a setup (Ath7k, AA).

Thanks,

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


Re: [OpenWrt-Devel] Long-distance links ath9k

2014-03-26 Thread Outback Dingo
On Wed, Mar 26, 2014 at 3:04 PM, Bill Moffitt bmoff...@ayrstone.com wrote:



 On March 26, 2014 11:29:59 AM PDT, Sergey Ryazanov ryazanov@gmail.com
 wrote:

 2014-03-26 9:13 GMT+04:00 Bill Moffitt bmoff...@ayrstone.com:

  It's clear that SOMETHING is getting time-limited, but I have distance=0 
 and
  dissassoc_low_ack=0 on both the AP and the station, and I'm not sure what
  else I can tweak.


 Configure distance parameter according to real distance between points.


 Sorry, should have mentioned that, of course, I tried that, and various
 variants of that. At 2 miles (~3000 meters) it had a good connection and
 could consistently measure bandwidth with iperf. Bandwidth was maximized
 when distance=6000 (as expected) and distance=0 (as expected). At 5 miles,
 it would not pass traffic with any value of distance. I tried every value
 than that made any sense (0, 8000, 16000) and some that didn't (3, 50)
 and the results were the same (nothing).

 I note that it appeared to be passing authentication data (per the log)
 but failing to authenticate.

 I'd be very interested in hearing from anyone who has successfully set up
 an encrypted 5+ mile link (8+ km) with this kind of a setup (Ath7k, AA).


5 Miles with a picostation 2MP??? Ive done longer 20+ km with Bullet 2HPs
and higher gain antennas, which is my first thought, stick a bigger antenna
on it, just might help



 Thanks,

 Bill

 ___
 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


Re: [OpenWrt-Devel] [PATCHv2 2/2] odhcp6c: Add renew handler for proto dhcpv6

2014-03-26 Thread Bastian Bittorf
* Jonas Gorski j...@openwrt.org [26.03.2014 20:18]:
  +proto_dhcpv6_renew() {
  +   local interface=$1
  +   # SIGUSR1 forces odhcp6c to renew its lease
  +   proto_kill_command $interface 16
 
 SIGUSR1 is 16 only for mips; other arches use different values (see
 e.g. 
 http://de.wikipedia.org/wiki/Signal_(Computer)#G.C3.A4ngige_UNIX-Signale).
 

yes, have this on my todo-list:
the signal should be humanreadable e.g. 'SIGUSR1' and
then translated to the specific value, e.g. in
/lib/netifd/netifd-proto.sh

proto_kill_command()
{
local signal=$2   # e.g. USR1
local code=$( kill -l | grep  $signal | cut -d')' -f1 )

...
}

can i send a patch or is this a bad idea?

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


Re: [OpenWrt-Devel] Long-distance links ath9k

2014-03-26 Thread Sergey Ryazanov
2014-03-26 23:04 GMT+04:00 Bill Moffitt bmoff...@ayrstone.com:
 On March 26, 2014 11:29:59 AM PDT, Sergey Ryazanov ryazanov@gmail.com
 wrote:

 2014-03-26 9:13 GMT+04:00 Bill Moffitt bmoff...@ayrstone.com:

  It's clear that SOMETHING is getting time-limited, but I have distance=0
 and
  dissassoc_low_ack=0 on both the AP and the station, and I'm not sure
 what
  else I can tweak.


 Configure distance parameter according to real distance between points.


 Sorry, should have mentioned that, of course, I tried that, and various
 variants of that.

Hmm, I had to assume this.


 I note that it appeared to be passing authentication data (per the log) but
 failing to authenticate.

This message: wlan0: authenticated says us that client thinks that
it passed an authentication. And this message: wlan0: disassociated
from 00:15:6d:4c:45:09 (Reason: 7) says us that AP considers
opposite. Could you provide logs from AP side?

 I'd be very interested in hearing from anyone who has successfully set up an
 encrypted 5+ mile link (8+ km) with this kind of a setup (Ath7k, AA).

Do you tried to establish link without encryption, to be sure that the
root cause of failure is hostapd/wpa_supplicant?

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


Re: [OpenWrt-Devel] [PATCHv2 2/2] odhcp6c: Add renew handler for proto dhcpv6

2014-03-26 Thread Michel Stempin
Hi Bastian,

Le 26/03/2014 20:25, Bastian Bittorf a écrit :
 * Jonas Gorski j...@openwrt.org [26.03.2014 20:18]:
 +proto_dhcpv6_renew() {
 +   local interface=$1
 +   # SIGUSR1 forces odhcp6c to renew its lease
 +   proto_kill_command $interface 16

 SIGUSR1 is 16 only for mips; other arches use different values (see
 e.g. 
 http://de.wikipedia.org/wiki/Signal_(Computer)#G.C3.A4ngige_UNIX-Signale).

 
 yes, have this on my todo-list:
 the signal should be humanreadable e.g. 'SIGUSR1' and
 then translated to the specific value, e.g. in
 /lib/netifd/netifd-proto.sh
 
 proto_kill_command()
 {
   local signal=$2   # e.g. USR1
   local code=$( kill -l | grep  $signal | cut -d')' -f1 )
 
   ...
 }
 
 can i send a patch or is this a bad idea?

The Busybox kill applet accepts named as well as numeric signals, i.e. kill 
-USR1 pid should work.

--
Michel

 
 bye, bastian
 ___
 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


Re: [OpenWrt-Devel] Long-distance links ath9k

2014-03-26 Thread Bill


On 3/26/2014 12:36 PM, Sergey Ryazanov wrote:

2014-03-26 23:04 GMT+04:00 Bill Moffitt bmoff...@ayrstone.com:

On March 26, 2014 11:29:59 AM PDT, Sergey Ryazanov ryazanov@gmail.com
wrote:

2014-03-26 9:13 GMT+04:00 Bill Moffitt bmoff...@ayrstone.com:

  It's clear that SOMETHING is getting time-limited, but I have distance=0
and
  dissassoc_low_ack=0 on both the AP and the station, and I'm not sure
what
  else I can tweak.


Configure distance parameter according to real distance between points.


Sorry, should have mentioned that, of course, I tried that, and various
variants of that.


Hmm, I had to assume this.


I note that it appeared to be passing authentication data (per the log) but
failing to authenticate.


This message: wlan0: authenticated says us that client thinks that
it passed an authentication. And this message: wlan0: disassociated
from 00:15:6d:4c:45:09 (Reason: 7) says us that AP considers
opposite. Could you provide logs from AP side?


I'd be very interested in hearing from anyone who has successfully set up an
encrypted 5+ mile link (8+ km) with this kind of a setup (Ath7k, AA).


Do you tried to establish link without encryption, to be sure that the
root cause of failure is hostapd/wpa_supplicant?


Sergey-

Thank you again for your response.

Alas, I did not capture the log on the AP side.

I did not have time to re-establish the link without encryption. 
Unfortunately, it takes a long time to travel the 5 miles between the 
two locations because (1) it takes a couple of hours to set up the two 
sites, and (2) they're connected by about 15 miles of very windy road. 
Clearly, you're right, that's what I'll have to try next, and I'll have 
to remember to get the AP log then.


I had hoped in posting this that someone who has set up long-distance 
encrypted links with OpenWRT on ath9k devices would look at it and say, 
Oh, I did this and found you have to change a parameter in a 
little-known config file like this:


No luck so far... but I still have hope!

Thanks again,

Bill

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


[OpenWrt-Devel] [PATCH 1/2] Add Support for ZyXEL NBG 6716

2014-03-26 Thread André Valentin
With this patch OpenWRT supports the following on the ZyXEL NBG 6716:
-WiFi 2G
-WiFi 5G
-NAND flash
-2 Ethernet interfaces
-USB
-LEDs (except switch LEDs)
-sysupgrade process
-reasonale defaults at first boot

Signed-off-by: André Valentin avalen...@marcant.net
---
 package/boot/uboot-envtools/files/ar71xx   |3 +
 target/linux/ar71xx/base-files/etc/diag.sh |3 +
 .../ar71xx/base-files/etc/uci-defaults/01_leds |8 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |7 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   21 +-
 target/linux/ar71xx/config-3.10|1 +
 .../ar71xx/files/arch/mips/ath79/mach-nbg6716.c|  278 
 target/linux/ar71xx/image/Makefile |   42 +++
 target/linux/ar71xx/image/ubinize-nbg6716.ini  |   29 ++
 target/linux/ar71xx/nand/config-default|4 +-
 target/linux/ar71xx/nand/profiles/zyxel.mk |   18 ++
 .../patches-3.10/704-MIPS-ath79-add-NBG6716.patch  |   37 +++
 13 files changed, 451 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-nbg6716.c
 create mode 100644 target/linux/ar71xx/image/ubinize-nbg6716.ini
 create mode 100644 target/linux/ar71xx/nand/profiles/zyxel.mk
 create mode 100644 
target/linux/ar71xx/patches-3.10/704-MIPS-ath79-add-NBG6716.patch

diff --git a/package/boot/uboot-envtools/files/ar71xx 
b/package/boot/uboot-envtools/files/ar71xx
index 574f149..14528ac 100644
--- a/package/boot/uboot-envtools/files/ar71xx
+++ b/package/boot/uboot-envtools/files/ar71xx
@@ -23,6 +23,9 @@ mr600v2 | \
 wndr3700)
ubootenv_add_uci_config /dev/mtd1 0x0 0x1 0x1
;;
+nbg6716)
+   ubootenv_add_uci_config /dev/mtd1 0x0 0x1 0x1
+   ;;
 alfa-ap96 | \
 all0315n | \
 om2p | \
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index b328766..572f28b 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -94,6 +94,9 @@ get_status_led() {
nbg460n_550n_550nh)
status_led=nbg460n:green:power
;;
+   nbg6716)
+   status_led=nbg6716:white:power
+   ;;
om2p | \
om2p-hs | \
om2p-lc)
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 
b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
index a986dbc..bff6b0e 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
@@ -133,6 +133,14 @@ nbg460n_550n_550nh)
ucidef_set_led_wlan wlan WLAN nbg460n:green:wlan phy0tpt
;;
 
+nbg6716)
+   ucidef_set_led_netdev wan WAN nbg6716:white:internet eth1
+   ucidef_set_led_wlan wlan WLAN nbg6716:white:wifi2g phy1tpt
+   ucidef_set_led_wlan wlan5 WLAN5 nbg6716:white:wifi5g phy0tpt
+   ucidef_set_led_usbdev usb1 USB1 nbg6716:white:usb0 1-1
+   ucidef_set_led_usbdev usb2 USB2 nbg6716:white:usb1 2-1
+   ;;
+
 om2p | \
 om2p-hs | \
 om2p-lc)
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 
b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 9a1a285..8a46cc4 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -86,6 +86,13 @@ nbg460n_550n_550nh)
ucidef_add_switch_vlan switch0 0 0 1 2 3 5
;;
 
+nbg6716)
+   ucidef_set_interfaces_lan_wan eth0.1 eth1
+   ucidef_add_switch switch0 1 1
+   ucidef_add_switch_vlan switch0 1 0t 1 2 3 4
+   ucidef_add_switch_vlan switch0 2 5 6
+   ;;
+
 rb-433 |\
 rb-433u)
ucidef_set_interfaces_lan_wan eth1 eth0
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 06f128b..990c2e0 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -342,6 +342,9 @@ ar71xx_board_detect() {
*NBG460N/550N/550NH)
name=nbg460n_550n_550nh
;;
+   *Zyxel NBG6716)
+   name=nbg6716
+   ;;
*OM2P)
name=om2p
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 0028e8a..7793d2a 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -106,6 +106,20 @@ platform_do_upgrade_compex() {
fi
 }
 
+platform_do_upgrade_nand() {
+   local fw_mtd_kfs=$1
+   local fw_mtd=$2
+   local fw_file=$3
+
+   if [ -n $fw_mtd ]; then
+   sync
+   dd if=$fw_file bs=128k count=16 2/dev/null | \
+   mtd -e $fw_mtd_kfs write - $fw_mtd_kfs
+  

[OpenWrt-Devel] [PATCH 2/2] fstools: fix jffs2 detection on ubi/nand platform

2014-03-26 Thread André Valentin
Normally a jffs fs start with a know marker. If ubi is used, the
partition does not habe such a marker. Just 0x. This patch
checks if the partition is of type ubivol and has 0x at the
beginning. In this case the partition is mounted as a jffs.

Signed-off-by: André Valentin avalen...@marcant.net
---
 .../system/fstools/patches/001-jffs-empty.patch|   87 
 1 file changed, 87 insertions(+)
 create mode 100644 package/system/fstools/patches/001-jffs-empty.patch

diff --git a/package/system/fstools/patches/001-jffs-empty.patch 
b/package/system/fstools/patches/001-jffs-empty.patch
new file mode 100644
index 000..c40cbbf
--- /dev/null
+++ b/package/system/fstools/patches/001-jffs-empty.patch
@@ -0,0 +1,87 @@
+diff -uNrp a/backend/base.c b/backend/base.c
+--- a/backend/base.c   2014-03-21 10:15:20.0 +0100
 b/backend/base.c   2014-03-26 11:19:08.0 +0100
+@@ -67,6 +67,12 @@ start(int argc, char **argv)
+ 
+   switch (mtd_identify(mtd)) {
+   case FS_NONE:
++  if (mtd_is_ubivol(mtd)) {
++  backend_mount(overlay);
++  break;
++  }
++  return ramoverlay();
++
+   case FS_DEADCODE:
+   return ramoverlay();
+ 
+@@ -101,6 +107,10 @@ done(int argc, char **argv)
+ 
+   switch (mtd_identify(mtd)) {
+   case FS_NONE:
++  if (mtd_is_ubivol(mtd)) {
++  return jffs2_switch(argc, argv);
++  }
++  return ramoverlay();
+   case FS_DEADCODE:
+   return jffs2_switch(argc, argv);
+   }
+diff -uNrp a/backend/jffs2.c b/backend/jffs2.c
+--- a/backend/jffs2.c  2014-03-21 10:15:20.0 +0100
 b/backend/jffs2.c  2014-03-26 11:23:58.0 +0100
+@@ -309,6 +309,16 @@ jffs2_switch(int argc, char **argv)
+   switch (mtd_identify(mtd)) {
+   case FS_NONE:
+   fprintf(stderr, no jffs2 marker found\n);
++  if (mtd_is_ubivol(mtd)) {
++  ret = jffs2_mount();
++  if (ret)
++  break;
++  if (mount_move(/tmp, , /overlay) || 
fopivot(/overlay, /rom)) {
++  fprintf(stderr, switching to jffs2 failed\n);
++  ret = -1;
++  }
++  break;
++  }
+   /* fall through */
+ 
+   case FS_DEADCODE:
+diff -uNrp a/lib/mtd.c b/lib/mtd.c
+--- a/lib/mtd.c2014-03-21 10:15:20.0 +0100
 b/lib/mtd.c2014-03-26 11:18:09.0 +0100
+@@ -199,3 +199,26 @@ mtd_identify(char *mtd)
+ 
+   return FS_NONE;
+ }
++
++int
++mtd_is_ubivol(char *mtd)
++{
++  int fd = mtd_load(mtd);
++  struct mtd_info_user mtdInfo;
++
++  if (!fd) {
++  fprintf(stderr, reading %s failed\n, mtd);
++  return -1;
++  }
++  if (ioctl(fd, MEMGETINFO, mtdInfo)) {
++  fprintf(stderr, Could not get MTD device info from %s\n, mtd);
++  close(fd);
++  return -1;
++  }
++
++  close(fd);
++  if (mtdInfo.type == MTD_UBIVOLUME) {
++  return 1;
++  }
++  return 0;
++}
+diff -uNrp a/lib/mtd.h b/lib/mtd.h
+--- a/lib/mtd.h2014-03-21 10:15:20.0 +0100
 b/lib/mtd.h2014-03-26 11:18:09.0 +0100
+@@ -24,5 +24,6 @@ int mtd_unlock(int fd);
+ int mtd_read_buffer(int fd, void *buf, int offset, int length);
+ int mtd_write_buffer(int fd, void *buf, int offset, int length);
+ int mtd_identify(char *mtd);
++int mtd_is_ubivol(char *mtd);
+ 
+ #endif
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel