Re: [OpenWrt-Devel] [OpenWrt-Users] unknown network field 'beacon_int" and wpa_supplicant

2013-10-10 Thread Bruno Randolf

Hi, This is a patch against AA which fixes it for us:

wpa_supplicant: fix beacon_int configuration option

wpa_supplicant expects beacon_int instead of beacon_interval in its 
config file.


diff --git a/package/hostapd/files/wpa_supplicant.sh 
b/package/hostapd/files/wpa_supplicant.sh

index 0b5e1d3..bd86801 100644
--- a/package/hostapd/files/wpa_supplicant.sh
+++ b/package/hostapd/files/wpa_supplicant.sh
@@ -119,13 +119,13 @@ wpa_supplicant_setup_vif() {
;;
esac

-   local fixed_freq bssid1 beacon_interval brates mrate
+   local fixed_freq bssid1 beacon_int brates mrate
config_get ifname "$vif" ifname
config_get bridge "$vif" bridge
config_get ssid "$vif" ssid
config_get bssid "$vif" bssid
bssid1=${bssid:+"bssid=$bssid"}
-   beacon_interval=${beacon_int:+"beacon_interval=$beacon_int"}
+   beacon_int=${beacon_int:+"beacon_int=$beacon_int"}

local br brval brsub brstr
[ -n "$basic_rate_list" ] && {
@@ -163,7 +163,7 @@ network={
$proto
$freq
${fixed:+"fixed_freq=1"}
-   $beacon_interval
+   $beacon_int
$brates
$mrate
$ht_str

On 10/10/2013 12:17 AM, Ben West wrote:

I believe this problem appeared on or about r36682, which coincides with
a hostapd update to AA.  This suggests a regression in hostapd w/r/t/ to
beacon interval code.

I can confirm the same problem happens when attempting to specify
beacon_int on a single psk2-encrypted adhoc interface, not just with
multi-VAPs as with the original poster.  My test was on an Engenius
EOC-1650, atheros platform, running Attitude Adjustment r38347 that I
compiled.

The error quoted below goes away when I comment out the "beacon_int"
line in /etc/config/wireless.  Likewise, this wireless config, with the
beacon_int line, works just fine under Attitude Adjustment r36669,
before the hostapd update.

root@OpenWRT:~# wifi restart
command failed: Device or resource busy (-16)
Successfully initialized wpa_supplicant
Line 12: unknown network field 'beacon_interval'.
Line 33: failed to parse network block.
Failed to read or parse configuration '/var/run/wpa_supplicant-wlan0.conf'.
enable_mac80211(radio0): Failed to set up wpa_supplicant for interface wlan0

root@OpenWRT:~# cat /etc/config/wireless
config wifi-device  radio0
 option type mac80211
 option channel  4
 option hwmode   11g
 option macaddr  00:02:6F:XX:XX:XX
 option beacon_int   337
 option diversity 0
 option disabled 0

config wifi-iface
 option network 'mesh'
 option mode 'adhoc'
 option device 'radio0'
 option ssid 'MyMesh'
 option bssid '02:CA:FF:EE:BA:BF'
 option hidden '0'
 option encryption 'psk2'
 option key 'blahblahblahblahblah'

root@OpenWRT:~# cat /var/run/wpa_supplicant-wlan0.conf
ctrl_interface=/var/run/wpa_supplicant-wlan0
ap_scan=2
network={
 mode=1
 scan_ssid=0
 ssid="MyMesh"
 bssid=02:CA:FF:EE:BA:BF
 key_mgmt=WPA-PSK
 proto=RSN
 frequency=2427
 fixed_freq=1
 beacon_interval=337

 psk="blahblahblahblahblah"

}

root@OpenWRT:~# cat /etc/openwrt_release
DISTRIB_ID="MyCustomWRT"
DISTRIB_RELEASE="CustomV2.1"
DISTRIB_REVISION="r38347"
DISTRIB_CODENAME="pre-release"
DISTRIB_TARGET="atheros/generic"
DISTRIB_DESCRIPTION="My Custom Release"

On Fri, Jun 28, 2013 at 9:07 PM, cmsv mailto:c...@wirelesspt.net>> wrote:

Info:
http://wiki.openwrt.org/doc/uci/wireless#wpa.enterprise.access.point


configuration:

/etc/config# cat wireless

config wifi-device 'radio0'
 option type 'mac80211'
 option phy 'phy0'
 option hwmode '11ng'
 option noscan '1'
 option disabled '0'
 option diversity '0'
 option rxantenna '2'
 option txantenna '2'
 option txpower '20'
 option beacon_int '1000'
 option distance '2000'
 list ht_capab 'RX-HT40-SGI'
 list ht_capab 'TX-STBC'
 list ht_capab 'RX-STBC1'
 list ht_capab 'DSSS_CCK-40'
 option channel '1'
 option country 'PT'
 option htmode 'HT20'
 option beacon_int '1000'

config wifi-iface
 option device 'radio0'
 option ifname 'wlan0'
 option network 'lan'
 option mode 'ap'
 option ssid 'test.net '
 option hidden '0'
 option encryption 'none'


config wifi-iface
 option device 'radio0'
 option ifname 'adhoc0'
 option network 'mesh'
 option mode 'adhoc'
 option bssid '02:16:e8:6a:0b:1e'
 option ssid 'mesh.test'
 option hidden '0'
 option macfilter 'allow'
 option encryption 'psk2'
 option key '1234567890'

Problem:

wifi down
wifi up
comman

Re: [OpenWrt-Devel] [OpenWrt-Users] unknown network field 'beacon_int" and wpa_supplicant

2013-10-10 Thread cmsv
I have encountered the following error while trying to patch the file:

patching file attitude_adjustment/package/hostapd/files/wpa_supplicant.sh
Hunk #1 FAILED at 119.
Hunk #2 FAILED at 163.
2 out of 2 hunks FAILED -- saving rejects to file
attitude_adjustment/package/hostapd/files/wpa_supplicant.sh.rej

AA revision 38351


On 10/10/2013 03:22 AM, Bruno Randolf wrote:
> Hi, This is a patch against AA which fixes it for us:
> 
> wpa_supplicant: fix beacon_int configuration option
> 
> wpa_supplicant expects beacon_int instead of beacon_interval in its
> config file.
> 
> diff --git a/package/hostapd/files/wpa_supplicant.sh
> b/package/hostapd/files/wpa_supplicant.sh
> index 0b5e1d3..bd86801 100644
> --- a/package/hostapd/files/wpa_supplicant.sh
> +++ b/package/hostapd/files/wpa_supplicant.sh
> @@ -119,13 +119,13 @@ wpa_supplicant_setup_vif() {
> ;;
> esac
> 
> -   local fixed_freq bssid1 beacon_interval brates mrate
> +   local fixed_freq bssid1 beacon_int brates mrate
> config_get ifname "$vif" ifname
> config_get bridge "$vif" bridge
> config_get ssid "$vif" ssid
> config_get bssid "$vif" bssid
> bssid1=${bssid:+"bssid=$bssid"}
> -   beacon_interval=${beacon_int:+"beacon_interval=$beacon_int"}
> +   beacon_int=${beacon_int:+"beacon_int=$beacon_int"}
> 
> local br brval brsub brstr
> [ -n "$basic_rate_list" ] && {
> @@ -163,7 +163,7 @@ network={
> $proto
> $freq
> ${fixed:+"fixed_freq=1"}
> -   $beacon_interval
> +   $beacon_int
> $brates
> $mrate
> $ht_str
> 
> On 10/10/2013 12:17 AM, Ben West wrote:
>> I believe this problem appeared on or about r36682, which coincides with
>> a hostapd update to AA.  This suggests a regression in hostapd w/r/t/ to
>> beacon interval code.
>>
>> I can confirm the same problem happens when attempting to specify
>> beacon_int on a single psk2-encrypted adhoc interface, not just with
>> multi-VAPs as with the original poster.  My test was on an Engenius
>> EOC-1650, atheros platform, running Attitude Adjustment r38347 that I
>> compiled.
>>
>> The error quoted below goes away when I comment out the "beacon_int"
>> line in /etc/config/wireless.  Likewise, this wireless config, with the
>> beacon_int line, works just fine under Attitude Adjustment r36669,
>> before the hostapd update.
>>
>> root@OpenWRT:~# wifi restart
>> command failed: Device or resource busy (-16)
>> Successfully initialized wpa_supplicant
>> Line 12: unknown network field 'beacon_interval'.
>> Line 33: failed to parse network block.
>> Failed to read or parse configuration
>> '/var/run/wpa_supplicant-wlan0.conf'.
>> enable_mac80211(radio0): Failed to set up wpa_supplicant for interface
>> wlan0
>>
>> root@OpenWRT:~# cat /etc/config/wireless
>> config wifi-device  radio0
>>  option type mac80211
>>  option channel  4
>>  option hwmode   11g
>>  option macaddr  00:02:6F:XX:XX:XX
>>  option beacon_int   337
>>  option diversity 0
>>  option disabled 0
>>
>> config wifi-iface
>>  option network 'mesh'
>>  option mode 'adhoc'
>>  option device 'radio0'
>>  option ssid 'MyMesh'
>>  option bssid '02:CA:FF:EE:BA:BF'
>>  option hidden '0'
>>  option encryption 'psk2'
>>  option key 'blahblahblahblahblah'
>>
>> root@OpenWRT:~# cat /var/run/wpa_supplicant-wlan0.conf
>> ctrl_interface=/var/run/wpa_supplicant-wlan0
>> ap_scan=2
>> network={
>>  mode=1
>>  scan_ssid=0
>>  ssid="MyMesh"
>>  bssid=02:CA:FF:EE:BA:BF
>>  key_mgmt=WPA-PSK
>>  proto=RSN
>>  frequency=2427
>>  fixed_freq=1
>>  beacon_interval=337
>>
>>  psk="blahblahblahblahblah"
>>
>> }
>>
>> root@OpenWRT:~# cat /etc/openwrt_release
>> DISTRIB_ID="MyCustomWRT"
>> DISTRIB_RELEASE="CustomV2.1"
>> DISTRIB_REVISION="r38347"
>> DISTRIB_CODENAME="pre-release"
>> DISTRIB_TARGET="atheros/generic"
>> DISTRIB_DESCRIPTION="My Custom Release"
>>
>> On Fri, Jun 28, 2013 at 9:07 PM, cmsv > > wrote:
>>
>> Info:
>> http://wiki.openwrt.org/doc/uci/wireless#wpa.enterprise.access.point
>>
>>
>> configuration:
>>
>> /etc/config# cat wireless
>>
>> config wifi-device 'radio0'
>>  option type 'mac80211'
>>  option phy 'phy0'
>>  option hwmode '11ng'
>>  option noscan '1'
>>  option disabled '0'
>>  option diversity '0'
>>  option rxantenna '2'
>>  option txantenna '2'
>>  option txpower '20'
>>  option beacon_int '1000'
>>  option distance '2000'
>>  list ht_capab 'RX-HT40-SGI'
>>  list ht_capab 'TX-STBC'
>>  list ht_capab 'RX-STBC1'
>>  list ht_capab 'DSSS_CCK-40'
>>  option channel '1'
>>  option country 'PT'
>>  option htmode 'HT20'
>>  option beacon

[OpenWrt-Devel] [PATCH 01/10] cron: improve init script

2013-10-10 Thread Bruno Randolf
Add PATH in case it is missing (e.g. when executing the script from
ssh, like "ssh IP /etc/init.d/cron restart").

Signed-off-by: Bruno Randolf 
---
 package/busybox/files/cron | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/busybox/files/cron b/package/busybox/files/cron
index 465b1ab..79b0a46 100755
--- a/package/busybox/files/cron
+++ b/package/busybox/files/cron
@@ -5,6 +5,8 @@ START=50
 
 SERVICE_USE_PID=1
 
+PATH="/usr/sbin/:$PATH"
+
 start () {
loglevel=$(uci_get "system.@system[0].cronloglevel")
[ -z "$(ls /etc/crontabs/)" ] && exit 1
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 02/10] mark base-files, kernel, opkg as essential packages

2013-10-10 Thread Bruno Randolf
Mark as essential to prevent removal from a running system.

Signed-off-by: Bruno Randolf 
---
 package/base-files/Makefile | 1 +
 package/kernel/Makefile | 2 +-
 package/opkg/Makefile   | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 2152edd..b08afbc 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -12,6 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 
 PKG_NAME:=base-files
 PKG_RELEASE:=118.2
+PKG_FLAGS:=essential
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=opkg/host
diff --git a/package/kernel/Makefile b/package/kernel/Makefile
index 8050817..2b0f1df 100644
--- a/package/kernel/Makefile
+++ b/package/kernel/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=kernel
-PKG_FLAGS:=hold
+PKG_FLAGS:=hold essential
 
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages
 SCAN_DEPS=modules/*.mk $(TOPDIR)/target/linux/*/modules.mk
diff --git a/package/opkg/Makefile b/package/opkg/Makefile
index f6e9875..036818e 100644
--- a/package/opkg/Makefile
+++ b/package/opkg/Makefile
@@ -24,6 +24,7 @@ PKG_REMOVE_FILES = autogen.sh aclocal.m4
 PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
+PKG_FLAGS:=essential
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 00/10] Some patches for AA 12.09

2013-10-10 Thread Bruno Randolf
Hi,

Here are some patches for the 12.09 AA branch, some of which we have been
carrying along in our internal version for quite some while now.

Bruno Randolf (9):
  cron: improve init script
  mark base-files, kernel, opkg as essential packages
  mkfwimage: Increase RSPRO maximum size to 0xF0 (15 MiB)
  opkg: remove patch which disables "upgrade all"
  iw: add patch to support 802.11j frequencies
  mac80211: fix iwconfig for ibss
  wpa_supplicant: fix beacon_int configuration option
  x86: fix condition in base-files.mk
  net48xx: fix scx200_hrt clocksource

Kentaro Matsuyama (1):
  ppp: Add IP unnumbered for PPPoE protocol

 package/base-files/Makefile|  1 +
 package/busybox/files/cron |  2 +
 package/hostapd/files/wpa_supplicant.sh|  6 +-
 package/iw/patches/140-freq-11j.patch  | 85 ++
 package/kernel/Makefile|  2 +-
 package/mac80211/Makefile  |  2 +-
 .../patches/920-mac80211-iwconfig-ibss-freq.patch  | 18 +
 package/opkg/Makefile  |  1 +
 package/opkg/patches/009-remove-upgrade-all.patch  | 41 ---
 package/ppp/Makefile   |  2 +
 package/ppp/files/ip_unnumbered.sh | 45 
 target/linux/x86/base-files.mk |  2 +-
 .../004-clocksrouce-scx200_hrt-fix.patch   | 45 
 tools/firmware-utils/src/mkfwimage.c   |  2 +-
 14 files changed, 206 insertions(+), 48 deletions(-)
 create mode 100644 package/iw/patches/140-freq-11j.patch
 create mode 100644 
package/mac80211/patches/920-mac80211-iwconfig-ibss-freq.patch
 delete mode 100644 package/opkg/patches/009-remove-upgrade-all.patch
 create mode 100755 package/ppp/files/ip_unnumbered.sh
 create mode 100644 
target/linux/x86/patches-3.3/004-clocksrouce-scx200_hrt-fix.patch

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


[OpenWrt-Devel] [PATCH 03/10] mkfwimage: Increase RSPRO maximum size to 0xF00000 (15 MiB)

2013-10-10 Thread Bruno Randolf
RSPRO has 16MiB of Flash, using the following layout:

[2.93] 0x-0x0003 : "RedBoot"
[2.94] 0x0003-0x0013 : "kernel"
[2.95] 0x0013-0x00ff : "rootfs"
[2.96] 0x00ff-0x00fff000 : "FIS directory"
[2.97] 0x00fff000-0x0100 : "RedBoot config"

Firmware images contain kernel and rootfs, so they can use up to 0xFF -
0x3 = 0xFC (15,75MiB) of space. We don't include the RedBoot and FIS
partitions and leave an extra 0xC (768KiB) of space.

This is based on revision 18410 which sets the limit to 0xB0 (11 MiB).

Signed-off-by: Bruno Randolf 
---
 tools/firmware-utils/src/mkfwimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/firmware-utils/src/mkfwimage.c 
b/tools/firmware-utils/src/mkfwimage.c
index a527014..e3a03c1 100644
--- a/tools/firmware-utils/src/mkfwimage.c
+++ b/tools/firmware-utils/src/mkfwimage.c
@@ -61,7 +61,7 @@ fw_layout_t fw_layout_data[] = {
.name   =   "RSPRO",
.kern_start =   0xbf03,
.kern_entry =   0x8006,
-   .firmware_max_length=   0x00B0,
+   .firmware_max_length=   0x00F0,
},
{
.name   =   "LS-SR71",
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 05/10] ppp: Add IP unnumbered for PPPoE protocol

2013-10-10 Thread Bruno Randolf
From: Kentaro Matsuyama 

Some PPP connections don't use a dedicated IP, instead an IP address of another
local interface is "reused" on the PPP interface.

Some Internet providers require this, since their PPPoE server pushes the
network address when routing multiple IPs, and some customers want to use it to
save IP addresses.

Reference: http://www.sustworks.com/site/ipr_guide/unnumbered.html

I have added an UCI option 'unnumbered' 'INTF' which means "reuse the IP
address of INTF" (e.g. unnumbered LAN will put the IP of the LAN interface on
the ppp interface as well), and the following script in /etc/ppp/ip-up.d/.

It works, but it is not integrated with netifd, e.g. netifd does not know about
the IP address we assigned.

Signed-off-by: Bruno Randolf 
---
 package/ppp/Makefile   |  2 ++
 package/ppp/files/ip_unnumbered.sh | 45 ++
 2 files changed, 47 insertions(+)
 create mode 100755 package/ppp/files/ip_unnumbered.sh

diff --git a/package/ppp/Makefile b/package/ppp/Makefile
index b6fbded..9617087 100644
--- a/package/ppp/Makefile
+++ b/package/ppp/Makefile
@@ -206,6 +206,8 @@ define Package/ppp-mod-pppoe/install
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
$(1)/usr/lib/pppd/$(PKG_VERSION)/
+   $(INSTALL_DIR) $(1)/etc/ppp/ip-up.d
+   $(INSTALL_BIN) ./files/ip_unnumbered.sh $(1)/etc/ppp/ip-up.d
 endef
 
 define Package/ppp-mod-radius/install
diff --git a/package/ppp/files/ip_unnumbered.sh 
b/package/ppp/files/ip_unnumbered.sh
new file mode 100755
index 000..38919ad
--- /dev/null
+++ b/package/ppp/files/ip_unnumbered.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+#pppoe-WAN eth0 0 192.168.71.5 10.0.0.1 WAN
+P_LOCAL=$4
+P_REMOTE=$5
+P_IFACE=$1
+P_NET=$6
+
+hook_unnumbered() {
+   local cfg="$1"
+   local proto ifname unnumbered
+
+   config_get proto "$cfg" proto
+   [ "$proto" = "pppoe" ] || return 0
+
+   config_get ifname "$cfg" ifname
+   [ "x$P_IFACE" = "x$ifname" ] || return 0
+
+   config_get unnumbered "$cfg" unnumbered
+   [ -n "$unnumbered" ] || return 0
+
+   # Get ipaddr and netmask from unnumbered interface.
+   # And that interface must be static one.
+   local proto ipaddr netmask
+   config_get proto "$unnumbered" proto
+   config_get ipaddr "$unnumbered" ipaddr
+   config_get netmask "$unnumbered" netmask
+   [ -n "$ipaddr" -a -n "$netmask" -a "x$proto" = "xstatic" ] || return 0
+
+   eval "$(ipcalc.sh $ipaddr $netmask)"
+
+   # Validate netowrk address
+   if [ "x$P_LOCAL" = "x$NETWORK" ]; then
+   /sbin/ifconfig ${P_IFACE} "$ipaddr" pointopoint ${P_REMOTE}
+   /sbin/route add default gw ${P_REMOTE}
+   fi
+}
+
+. /etc/functions.sh
+include /lib/network
+scan_interfaces
+config_load network
+
+hook_unnumbered $P_NET
+
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 06/10] iw: add patch to support 802.11j frequencies

2013-10-10 Thread Bruno Randolf
A similar change was recently merged in iw commit
58b46da26ab9b5ff31c7033e175351eb1301d9af

Signed-off-by: Bruno Randolf 
---
 package/iw/patches/140-freq-11j.patch | 85 +++
 1 file changed, 85 insertions(+)
 create mode 100644 package/iw/patches/140-freq-11j.patch

diff --git a/package/iw/patches/140-freq-11j.patch 
b/package/iw/patches/140-freq-11j.patch
new file mode 100644
index 000..eae1f21
--- /dev/null
+++ b/package/iw/patches/140-freq-11j.patch
@@ -0,0 +1,85 @@
+--- a/iw.h
 b/iw.h
+@@ -146,7 +146,7 @@ void print_ht_capability(__u16 cap);
+ 
+ const char *iftype_name(enum nl80211_iftype iftype);
+ const char *command_name(enum nl80211_commands cmd);
+-int ieee80211_channel_to_frequency(int chan);
++int ieee80211_channel_to_frequency(int chan, enum nl80211_band band);
+ int ieee80211_frequency_to_channel(int freq);
+ 
+ void print_ssid_escaped(const uint8_t len, const uint8_t *data);
+--- a/phy.c
 b/phy.c
+@@ -66,8 +66,12 @@ static int handle_freqchan(struct nl_msg
+   if (*end)
+   return 1;
+ 
+-  if (chan)
+-  freq = ieee80211_channel_to_frequency(freq);
++  if (chan) {
++  enum nl80211_band band;
++  band = freq <= 14 ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
++  freq = ieee80211_channel_to_frequency(freq, band);
++  }
++
+ 
+   NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
+   NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, htval);
+--- a/util.c
 b/util.c
+@@ -248,31 +248,37 @@ const char *command_name(enum nl80211_co
+   return cmdbuf;
+ }
+ 
+-int ieee80211_channel_to_frequency(int chan)
++int ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
+ {
+-  if (chan < 14)
+-  return 2407 + chan * 5;
+-
+-  if (chan == 14)
+-  return 2484;
+-
+-  /* FIXME: dot11ChannelStartingFactor (802.11-2007 17.3.8.3.2) */
+-  return (chan + 1000) * 5;
++  /* see 802.11-2007 17.3.8.3.2 and Annex J
++   * there are overlapping channel numbers in 5GHz and 2GHz bands */
++  if (band == NL80211_BAND_5GHZ) {
++  if (chan >= 182 && chan <= 196)
++  return 4000 + chan * 5;
++  else
++  return 5000 + chan * 5;
++  } else { /* NL80211_BAND_2GHZ */
++  if (chan == 14)
++  return 2484;
++  else if (chan < 14)
++  return 2407 + chan * 5;
++  else
++  return 0; /* not supported */
++  }
+ }
+ 
+ int ieee80211_frequency_to_channel(int freq)
+ {
++  /* see 802.11-2007 17.3.8.3.2 and Annex J */
+   if (freq == 2484)
+   return 14;
+-
+-  if (freq < 2484)
++  else if (freq < 2484)
+   return (freq - 2407) / 5;
+-
+-  /* FIXME: dot11ChannelStartingFactor (802.11-2007 17.3.8.3.2) */
+-  if (freq < 45000)
+-  return freq/5 - 1000;
+-
+-  if (freq >= 58320 && freq <= 64800)
++  else if (freq >= 4910 && freq <= 4980)
++  return (freq - 4000) / 5;
++  else if (freq < 45000)
++  return (freq - 5000) / 5;
++  else if (freq >= 58320 && freq <= 64800)
+   return (freq - 56160) / 2160;
+ 
+   return 0;
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 09/10] x86: fix condition in base-files.mk

2013-10-10 Thread Bruno Randolf
TARGET_x86_generic_Soekris48xx is not defined,
CONFIG_TARGET_x86_generic_Soekris48xx is

This changes makes it possible to override the network config for soekris 
net48xx
and net45xx targets.

Signed-off-by: Bruno Randolf 
---
 target/linux/x86/base-files.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/x86/base-files.mk b/target/linux/x86/base-files.mk
index 889f944..6c6e6f1 100644
--- a/target/linux/x86/base-files.mk
+++ b/target/linux/x86/base-files.mk
@@ -1,4 +1,4 @@
-ifneq ($(TARGET_x86_generic_Soekris48xx)$(TARGET_x86_generic_Soekris45xx),)
+ifneq 
($(CONFIG_TARGET_x86_generic_Soekris48xx)$(CONFIG_TARGET_x86_generic_Soekris45xx),)
 define Package/base-files/install-target
rm -f $(1)/etc/config/network
 endef
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 07/10] mac80211: fix iwconfig for ibss

2013-10-10 Thread Bruno Randolf
Fix kernel warning when using iwconfig for configuring ad-hoc mode, e.g.
"iwconfig wlan0 essid test channel 1"

[ 1003.46] WARNING: at 
/home/taka/openwrt-12.09/openwrt-rsp/build_dir/linux-ar71xx_generi
c/compat-wireless-2013-06-27/net/wireless/chan.c:373 
cfg80211_chandef_usable+0x50/0x21c [cfg8
0211]()

It is caused by an uninitialized variable center_freq1.

The same was recently merged in wireless-testing commit
f478f33a93f9353dcd1fe55445343d76b1c3f84a.

Signed-off-by: Bruno Randolf 
---
 package/mac80211/Makefile  |  2 +-
 .../patches/920-mac80211-iwconfig-ibss-freq.patch  | 18 ++
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 
package/mac80211/patches/920-mac80211-iwconfig-ibss-freq.patch

diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile
index e4fa925..9583e37 100644
--- a/package/mac80211/Makefile
+++ b/package/mac80211/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 PKG_NAME:=mac80211
 
 PKG_VERSION:=2013-06-27
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
 PKG_BACKPORT_VERSION:=.1
 PKG_MD5SUM:=73bd220c64c5c6fdc22b3bb7f180644f
diff --git a/package/mac80211/patches/920-mac80211-iwconfig-ibss-freq.patch 
b/package/mac80211/patches/920-mac80211-iwconfig-ibss-freq.patch
new file mode 100644
index 000..6296142
--- /dev/null
+++ b/package/mac80211/patches/920-mac80211-iwconfig-ibss-freq.patch
@@ -0,0 +1,18 @@
+--- a/net/wireless/ibss.c
 b/net/wireless/ibss.c
+@@ -263,6 +263,7 @@ int cfg80211_ibss_wext_join(struct cfg80
+   if (chan->flags & IEEE80211_CHAN_DISABLED)
+   continue;
+   wdev->wext.ibss.chandef.chan = chan;
++  wdev->wext.ibss.chandef.center_freq1 = 
chan->center_freq;
+   break;
+   }
+ 
+@@ -347,6 +348,7 @@ int cfg80211_ibss_wext_siwfreq(struct ne
+   if (chan) {
+   wdev->wext.ibss.chandef.chan = chan;
+   wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT;
++  wdev->wext.ibss.chandef.center_freq1 = freq;
+   wdev->wext.ibss.channel_fixed = true;
+   } else {
+   /* cfg80211_ibss_wext_join will pick one if needed */
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 10/10] net48xx: fix scx200_hrt clocksource

2013-10-10 Thread Bruno Randolf
Backport and fix upstream commit 12d6d41276def096cb3f7dc36f438db9ed6a0a8d for
scx200_hrt to avoid warnings like below on Soekris net48xx boards.

[   13.310053] [ cut here ]
[   13.310053] WARNING: at kernel/time/timekeeping.c:863 do_timer+0x6bc/0x880()
[   13.310053] Adjusting scx200_hrt more then 11% (-100663424 vs 360710144)
[   13.310053] Modules linked in:
[   13.310053] Pid: 617, comm: dd Tainted: GW3.3.8 #9
[   13.310053] Call Trace:
[   13.310053]  [] ? warn_slowpath_common+0x87/0xb0
[   13.310053]  [] ? do_timer+0x6bc/0x880
[   13.310053]  [] ? warn_slowpath_fmt+0x33/0x40
[   13.310053]  [] ? do_timer+0x6bc/0x880
[   13.310053]  [] ? tick_do_update_jiffies64+0xba/0x100
[   13.310053]  [] ? tick_sched_timer+0x4d/0xb0
[   13.310053]  [] ? __remove_hrtimer+0x2b/0xa0
[   13.310053]  [] ? __run_hrtimer.isra.35+0x3a/0xb0
[   13.310053]  [] ? hrtimer_interrupt+0xdd/0x1f0
[   13.310053]  [] ? timer_interrupt+0x10/0x20
[   13.310053]  [] ? handle_irq_event_percpu+0x21/0x120
[   13.310053]  [] ? cond_unmask_irq+0x40/0x40
[   13.310053]  [] ? handle_irq_event+0x19/0x30
[   13.310053]  [] ? handle_level_irq+0x66/0x70
[   13.310053][] ? do_IRQ+0x3a/0xb0
[   13.310053]  [] ? common_interrupt+0x29/0x30
[   13.310053] ---[ end trace ac85af0b4252a378 ]---

Signed-off-by: Bruno Randolf 
---
 .../004-clocksrouce-scx200_hrt-fix.patch   | 45 ++
 1 file changed, 45 insertions(+)
 create mode 100644 
target/linux/x86/patches-3.3/004-clocksrouce-scx200_hrt-fix.patch

diff --git a/target/linux/x86/patches-3.3/004-clocksrouce-scx200_hrt-fix.patch 
b/target/linux/x86/patches-3.3/004-clocksrouce-scx200_hrt-fix.patch
new file mode 100644
index 000..b771246
--- /dev/null
+++ b/target/linux/x86/patches-3.3/004-clocksrouce-scx200_hrt-fix.patch
@@ -0,0 +1,45 @@
+--- a/drivers/clocksource/scx200_hrt.c
 b/drivers/clocksource/scx200_hrt.c
+@@ -49,9 +49,6 @@ static cycle_t read_hrt(struct clocksour
+   return (cycle_t) inl(scx200_cb_base + SCx200_TIMER_OFFSET);
+ }
+ 
+-#define HRT_SHIFT_1   22
+-#define HRT_SHIFT_27  26
+-
+ static struct clocksource cs_hrt = {
+   .name   = "scx200_hrt",
+   .rating = 250,
+@@ -63,6 +60,7 @@ static struct clocksource cs_hrt = {
+ 
+ static int __init init_hrt_clocksource(void)
+ {
++  u32 freq;
+   /* Make sure scx200 has initialized the configuration block */
+   if (!scx200_cb_present())
+   return -ENODEV;
+@@ -79,19 +77,14 @@ static int __init init_hrt_clocksource(v
+   outb(HR_TMEN | (mhz27 ? HR_TMCLKSEL : 0),
+scx200_cb_base + SCx200_TMCNFG_OFFSET);
+ 
+-  if (mhz27) {
+-  cs_hrt.shift = HRT_SHIFT_27;
+-  cs_hrt.mult = clocksource_hz2mult((HRT_FREQ + ppm) * 27,
+-cs_hrt.shift);
+-  } else {
+-  cs_hrt.shift = HRT_SHIFT_1;
+-  cs_hrt.mult = clocksource_hz2mult(HRT_FREQ + ppm,
+-cs_hrt.shift);
+-  }
++  freq = (HRT_FREQ + ppm);
++  if (mhz27)
++  freq *= 27;
++
+   printk(KERN_INFO "enabling scx200 high-res timer (%s MHz +%d ppm)\n",
+   mhz27 ? "27":"1", ppm);
+ 
+-  return clocksource_register(&cs_hrt);
++  return clocksource_register_hz(&cs_hrt, freq);
+ }
+ 
+ module_init(init_hrt_clocksource);
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 04/10] opkg: remove patch which disables "upgrade all"

2013-10-10 Thread Bruno Randolf
The patch disables the upgrade "all packages" feature of opkg, by removing the
patch we enable "opkg upgrade" to upgrade all new packages. As noted in the
OpenWRT wiki, this feature has to be used with caution, especially with
SquashFS file systems, but it works really well with writable filesystems such
as JFFS2. As OpenWRT is used on a variety of systems, some with plenty of
writeable flash space, I suggest to not unconditionally disable "upgrade all".

Signed-off-by: Bruno Randolf 
---
 package/opkg/patches/009-remove-upgrade-all.patch | 41 ---
 1 file changed, 41 deletions(-)
 delete mode 100644 package/opkg/patches/009-remove-upgrade-all.patch

diff --git a/package/opkg/patches/009-remove-upgrade-all.patch 
b/package/opkg/patches/009-remove-upgrade-all.patch
deleted file mode 100644
index 395a2a6..000
--- a/package/opkg/patches/009-remove-upgrade-all.patch
+++ /dev/null
@@ -1,41 +0,0 @@
 a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -551,18 +551,6 @@ opkg_upgrade_cmd(int argc, char **argv)
-   err = -1;
-}
- }
-- } else {
--pkg_vec_t *installed = pkg_vec_alloc();
--
--pkg_info_preinstall_check();
--
--pkg_hash_fetch_all_installed(installed);
--for (i = 0; i < installed->len; i++) {
-- pkg = installed->pkgs[i];
-- if (opkg_upgrade_pkg(pkg))
-- err = -1;
--}
--pkg_vec_free(installed);
-  }
- 
-  if (opkg_configure_packages(NULL))
-@@ -1258,7 +1246,7 @@ opkg_print_architecture_cmd(int argc, ch
-array for easier maintenance */
- static opkg_cmd_t cmds[] = {
-  {"update", 0, (opkg_cmd_fun_t)opkg_update_cmd, 
PFM_DESCRIPTION|PFM_SOURCE},
-- {"upgrade", 0, (opkg_cmd_fun_t)opkg_upgrade_cmd, 
PFM_DESCRIPTION|PFM_SOURCE},
-+ {"upgrade", 1, (opkg_cmd_fun_t)opkg_upgrade_cmd, 
PFM_DESCRIPTION|PFM_SOURCE},
-  {"list", 0, (opkg_cmd_fun_t)opkg_list_cmd, PFM_SOURCE},
-  {"list_installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd, 
PFM_SOURCE},
-  {"list-installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd, 
PFM_SOURCE},
 a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -221,7 +221,7 @@ usage()
- 
-   printf("\nPackage Manipulation:\n");
-   printf("\tupdateUpdate list of available 
packages\n");
--  printf("\tupgrade   Upgrade installed packages\n");
-+  printf("\tupgrade Upgrade packages\n");
-   printf("\tinstall Install package(s)\n");
-   printf("\tconfigure   Configure unpacked package(s)\n");
-   printf("\tremove   Remove package(s)\n");
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 08/10] wpa_supplicant: fix beacon_int configuration option

2013-10-10 Thread Bruno Randolf
wpa_supplicant expects beacon_int instead of beacon_interval in its config
file.

Signed-off-by: Bruno Randolf 
---
 package/hostapd/files/wpa_supplicant.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/hostapd/files/wpa_supplicant.sh 
b/package/hostapd/files/wpa_supplicant.sh
index 0b5e1d3..bd86801 100644
--- a/package/hostapd/files/wpa_supplicant.sh
+++ b/package/hostapd/files/wpa_supplicant.sh
@@ -119,13 +119,13 @@ wpa_supplicant_setup_vif() {
;;
esac
 
-   local fixed_freq bssid1 beacon_interval brates mrate
+   local fixed_freq bssid1 beacon_int brates mrate
config_get ifname "$vif" ifname
config_get bridge "$vif" bridge
config_get ssid "$vif" ssid
config_get bssid "$vif" bssid
bssid1=${bssid:+"bssid=$bssid"}
-   beacon_interval=${beacon_int:+"beacon_interval=$beacon_int"}
+   beacon_int=${beacon_int:+"beacon_int=$beacon_int"}
 
local br brval brsub brstr
[ -n "$basic_rate_list" ] && {
@@ -163,7 +163,7 @@ network={
$proto
$freq
${fixed:+"fixed_freq=1"}
-   $beacon_interval
+   $beacon_int
$brates
$mrate
$ht_str
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [OpenWrt-Users] unknown network field 'beacon_int" and wpa_supplicant

2013-10-10 Thread Bruno Randolf

On 10/10/2013 11:28 AM, cmsv wrote:

I have encountered the following error while trying to patch the file:

patching file attitude_adjustment/package/hostapd/files/wpa_supplicant.sh
Hunk #1 FAILED at 119.
Hunk #2 FAILED at 163.
2 out of 2 hunks FAILED -- saving rejects to file
attitude_adjustment/package/hostapd/files/wpa_supplicant.sh.rej

AA revision 38351


Hi,

Check the patch I just posted which is against current AA 12.09. If it 
does not apply to your revision, the patch is simple enough so you can 
make the same changes by hand.


bruno




On 10/10/2013 03:22 AM, Bruno Randolf wrote:

Hi, This is a patch against AA which fixes it for us:

wpa_supplicant: fix beacon_int configuration option

wpa_supplicant expects beacon_int instead of beacon_interval in its
config file.

diff --git a/package/hostapd/files/wpa_supplicant.sh
b/package/hostapd/files/wpa_supplicant.sh
index 0b5e1d3..bd86801 100644
--- a/package/hostapd/files/wpa_supplicant.sh
+++ b/package/hostapd/files/wpa_supplicant.sh
@@ -119,13 +119,13 @@ wpa_supplicant_setup_vif() {
 ;;
 esac

-   local fixed_freq bssid1 beacon_interval brates mrate
+   local fixed_freq bssid1 beacon_int brates mrate
 config_get ifname "$vif" ifname
 config_get bridge "$vif" bridge
 config_get ssid "$vif" ssid
 config_get bssid "$vif" bssid
 bssid1=${bssid:+"bssid=$bssid"}
-   beacon_interval=${beacon_int:+"beacon_interval=$beacon_int"}
+   beacon_int=${beacon_int:+"beacon_int=$beacon_int"}

 local br brval brsub brstr
 [ -n "$basic_rate_list" ] && {
@@ -163,7 +163,7 @@ network={
 $proto
 $freq
 ${fixed:+"fixed_freq=1"}
-   $beacon_interval
+   $beacon_int
 $brates
 $mrate
 $ht_str

On 10/10/2013 12:17 AM, Ben West wrote:

I believe this problem appeared on or about r36682, which coincides with
a hostapd update to AA.  This suggests a regression in hostapd w/r/t/ to
beacon interval code.

I can confirm the same problem happens when attempting to specify
beacon_int on a single psk2-encrypted adhoc interface, not just with
multi-VAPs as with the original poster.  My test was on an Engenius
EOC-1650, atheros platform, running Attitude Adjustment r38347 that I
compiled.

The error quoted below goes away when I comment out the "beacon_int"
line in /etc/config/wireless.  Likewise, this wireless config, with the
beacon_int line, works just fine under Attitude Adjustment r36669,
before the hostapd update.

root@OpenWRT:~# wifi restart
command failed: Device or resource busy (-16)
Successfully initialized wpa_supplicant
Line 12: unknown network field 'beacon_interval'.
Line 33: failed to parse network block.
Failed to read or parse configuration
'/var/run/wpa_supplicant-wlan0.conf'.
enable_mac80211(radio0): Failed to set up wpa_supplicant for interface
wlan0

root@OpenWRT:~# cat /etc/config/wireless
config wifi-device  radio0
  option type mac80211
  option channel  4
  option hwmode   11g
  option macaddr  00:02:6F:XX:XX:XX
  option beacon_int   337
  option diversity 0
  option disabled 0

config wifi-iface
  option network 'mesh'
  option mode 'adhoc'
  option device 'radio0'
  option ssid 'MyMesh'
  option bssid '02:CA:FF:EE:BA:BF'
  option hidden '0'
  option encryption 'psk2'
  option key 'blahblahblahblahblah'

root@OpenWRT:~# cat /var/run/wpa_supplicant-wlan0.conf
ctrl_interface=/var/run/wpa_supplicant-wlan0
ap_scan=2
network={
  mode=1
  scan_ssid=0
  ssid="MyMesh"
  bssid=02:CA:FF:EE:BA:BF
  key_mgmt=WPA-PSK
  proto=RSN
  frequency=2427
  fixed_freq=1
  beacon_interval=337

  psk="blahblahblahblahblah"

}

root@OpenWRT:~# cat /etc/openwrt_release
DISTRIB_ID="MyCustomWRT"
DISTRIB_RELEASE="CustomV2.1"
DISTRIB_REVISION="r38347"
DISTRIB_CODENAME="pre-release"
DISTRIB_TARGET="atheros/generic"
DISTRIB_DESCRIPTION="My Custom Release"

On Fri, Jun 28, 2013 at 9:07 PM, cmsv mailto:c...@wirelesspt.net>> wrote:

 Info:
 http://wiki.openwrt.org/doc/uci/wireless#wpa.enterprise.access.point


 configuration:

 /etc/config# cat wireless

 config wifi-device 'radio0'
  option type 'mac80211'
  option phy 'phy0'
  option hwmode '11ng'
  option noscan '1'
  option disabled '0'
  option diversity '0'
  option rxantenna '2'
  option txantenna '2'
  option txpower '20'
  option beacon_int '1000'
  option distance '2000'
  list ht_capab 'RX-HT40-SGI'
  list ht_capab 'TX-STBC'
  list ht_capab 'RX-STBC1'
  list ht_capab 'DSSS_CCK-40'
  option channel '1'
  option country 'PT'
  option htmode 'HT20'
  option beacon_int '1000'

 config wifi-iface
  option device 'radio0'

[OpenWrt-Devel] [PATCH 1/7] libgphoto2 depends on libusb, not libusb-1.0

2013-10-10 Thread Bruno Randolf
Signed-off-by: Bruno Randolf 
---
 libs/libgphoto2/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libs/libgphoto2/Makefile b/libs/libgphoto2/Makefile
index cc45ece..e31b30a 100644
--- a/libs/libgphoto2/Makefile
+++ b/libs/libgphoto2/Makefile
@@ -37,7 +37,7 @@ endef
 
 define Package/libgphoto2-drivers
   $(call Package/libgphoto2/Default)
-  DEPENDS:=libgphoto2 +libusb-1.0 +libgd
+  DEPENDS:=libgphoto2 +libusb +libgd
   TITLE:=Gphoto2 drivers for various cameras
 endef
 
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/7] ddns-scripts: add init script

2013-10-10 Thread Bruno Randolf
Signed-off-by: Bruno Randolf 
---
 net/ddns-scripts/Makefile  |  2 ++
 net/ddns-scripts/files/etc/init.d/ddns | 12 
 2 files changed, 14 insertions(+)
 create mode 100644 net/ddns-scripts/files/etc/init.d/ddns

diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile
index 651c623..0e9f0f3 100644
--- a/net/ddns-scripts/Makefile
+++ b/net/ddns-scripts/Makefile
@@ -37,6 +37,8 @@ endef
 define Package/ddns-scripts/install
$(INSTALL_DIR) $(1)
$(CP) ./files/* $(1)/
+   $(INSTALL_DIR) $(1)/etc/init.d
+   $(INSTALL_BIN) ./files/etc/init.d/ddns $(1)/etc/init.d/
 endef
 
 $(eval $(call BuildPackage,ddns-scripts))
diff --git a/net/ddns-scripts/files/etc/init.d/ddns 
b/net/ddns-scripts/files/etc/init.d/ddns
new file mode 100644
index 000..3171d5a
--- /dev/null
+++ b/net/ddns-scripts/files/etc/init.d/ddns
@@ -0,0 +1,12 @@
+#!/bin/sh /etc/rc.common
+START=95
+
+start() {
+   . /usr/lib/ddns/dynamic_dns_functions.sh
+   start_daemon_for_all_ddns_sections
+}
+
+stop() {
+   killall -9 dynamic_dns_updater.sh
+}
+
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/7] Patches for packages AA 12.09

2013-10-10 Thread Bruno Randolf
Here some patches against AA 12.09 packages...

Bruno Randolf (7):
  libgphoto2 depends on libusb, not libusb-1.0
  LIBCONFIG: enabling c++ support (lconfig++).
  ddns-scripts: add init script
  pptpd: Add uci configuration for PPTPD.
  pptpd: remove IP in options.pptp
  isc-dhcp: dhcrelay: add UCI config and init script
  isc-dhcp: dhcrelay: Add RFC3527 link selection sub-option

 libs/libconfig/Makefile|   6 +-
 libs/libgphoto2/Makefile   |   2 +-
 net/ddns-scripts/Makefile  |   2 +
 net/ddns-scripts/files/etc/init.d/ddns |  12 +++
 net/isc-dhcp/Makefile  |   6 +-
 net/isc-dhcp/files/dhcrelay.config |  19 
 net/isc-dhcp/files/dhcrelay.init   |  59 
 .../patches/100-relay-rfc3527-link-selection.patch | 100 +
 net/pptpd/Makefile |   3 +
 net/pptpd/files/options.pptpd  |   1 -
 net/pptpd/files/pptpd.init |  41 -
 net/pptpd/files/pptpd.uciconf  |   8 ++
 12 files changed, 252 insertions(+), 7 deletions(-)
 create mode 100644 net/ddns-scripts/files/etc/init.d/ddns
 create mode 100644 net/isc-dhcp/files/dhcrelay.config
 create mode 100755 net/isc-dhcp/files/dhcrelay.init
 create mode 100644 net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch
 create mode 100644 net/pptpd/files/pptpd.uciconf

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


[OpenWrt-Devel] [PATCH 2/7] LIBCONFIG: enabling c++ support (lconfig++).

2013-10-10 Thread Bruno Randolf
Signed-off-by: Bruno Randolf 
---
 libs/libconfig/Makefile | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libs/libconfig/Makefile b/libs/libconfig/Makefile
index f56de43..5eb0ed8 100644
--- a/libs/libconfig/Makefile
+++ b/libs/libconfig/Makefile
@@ -42,20 +42,24 @@ endef
 CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
-   --disable-cxx
+   --enable-cxx \
+   --disable-examples
 
 define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/libconfig.h $(1)/usr/include/
+   $(CP) $(PKG_INSTALL_DIR)/usr/include/libconfig.h++ $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfig.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libconfig.pc 
$(1)/usr/lib/pkgconfig/
+   $(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfig++.{a,so} $(1)/usr/lib/
 endef
 
 define Package/libconfig/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfig.so* $(1)/usr/lib/
+   $(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfig++.so.* $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,libconfig))
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 6/7] isc-dhcp: dhcrelay: add UCI config and init script

2013-10-10 Thread Bruno Randolf
Signed-off-by: Bruno Randolf 
---
 net/isc-dhcp/Makefile  |  6 +++--
 net/isc-dhcp/files/dhcrelay.config | 15 +++
 net/isc-dhcp/files/dhcrelay.init   | 51 ++
 3 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 net/isc-dhcp/files/dhcrelay.config
 create mode 100755 net/isc-dhcp/files/dhcrelay.init

diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile
index 798ee32..d3aa397 100644
--- a/net/isc-dhcp/Makefile
+++ b/net/isc-dhcp/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=isc-dhcp
 UPSTREAM_NAME:=dhcp
 PKG_VERSION:=4.2.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(UPSTREAM_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/$(PKG_VERSION)
@@ -171,8 +171,10 @@ define Build/Compile
 endef
 
 define Package/isc-dhcp-relay-$(BUILD_VARIANT)/install
-   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcrelay $(1)/usr/sbin
+   $(INSTALL_BIN) ./files/dhcrelay.init $(1)/etc/init.d/dhcrelay
+   $(INSTALL_BIN) ./files/dhcrelay.config $(1)/etc/config/dhcrelay
 endef
 
 define Package/isc-dhcp-server-$(BUILD_VARIANT)/install
diff --git a/net/isc-dhcp/files/dhcrelay.config 
b/net/isc-dhcp/files/dhcrelay.config
new file mode 100644
index 000..a303a60
--- /dev/null
+++ b/net/isc-dhcp/files/dhcrelay.config
@@ -0,0 +1,15 @@
+config 'dhcrelay'
+   option 'enabled' '0'
+
+   # IP address of the server
+   option 'server' ''
+
+   # network interfaces to listen on (e.g. lan or wan)
+   option 'interfaces' ''
+
+   # What to do about packets that already have a relay option:
+   # 'append': Forward and append our own relay option
+   # 'replace': Forward, but replace theirs with ours (default)
+   # 'forward': Forward without changes
+   # 'discard': Don't forward
+   option 'relay_mode' ''
diff --git a/net/isc-dhcp/files/dhcrelay.init b/net/isc-dhcp/files/dhcrelay.init
new file mode 100755
index 000..e66d34b
--- /dev/null
+++ b/net/isc-dhcp/files/dhcrelay.init
@@ -0,0 +1,51 @@
+#!/bin/sh /etc/rc.common
+START=75
+
+BIN="/usr/sbin/dhcrelay"
+
+dhcrelay_start() {
+   local cfg="$1"
+   local args=""
+
+   local enabled
+   config_get_bool enabled "$cfg" enabled 0
+   [ "${enabled}" -eq 0 ] && return 0
+
+   # listen interfaces
+   local interfaces
+   config_get interfaces "$cfg" interfaces
+   if [ -n "${interfaces}" ]; then
+   for net in $interfaces; do
+   local ifname
+   config_get ifname "$net" ifname
+   [ -n "$ifname" ] && append args "-i $ifname"
+   done
+   else
+   return 0
+   fi
+
+   # relay mode
+   local relay_mode
+   config_get relay_mode "$cfg" relay_mode
+   [ -n "$relay_mode" ] && append args "-m $relay_mode"
+
+   # dhcp server address
+   local server
+   config_get server "$cfg" server
+   [ -n "${server}" ] || return 0
+   append args "${server}"
+
+   start-stop-daemon -S -x ${BIN} -- -q ${args}
+   return $?
+}
+
+start() {
+   include /lib/network
+   scan_interfaces
+   config_load dhcrelay
+   config_foreach dhcrelay_start dhcrelay
+}
+
+stop() {
+   start-stop-daemon -K -x ${BIN}
+}
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 7/7] isc-dhcp: dhcrelay: Add RFC3527 link selection sub-option

2013-10-10 Thread Bruno Randolf
RFC3527 link selection sub-option is used to select the "uplink" interface of
dhcrelay in cases where the DHCP server does not know how to reach the dhcrelay
based on the DHCP range. This can happen in weird network configurations like
Mesh networks.

Signed-off-by: Bruno Randolf 
---
 net/isc-dhcp/Makefile  |   2 +-
 net/isc-dhcp/files/dhcrelay.config |   4 +
 net/isc-dhcp/files/dhcrelay.init   |   8 ++
 .../patches/100-relay-rfc3527-link-selection.patch | 100 +
 4 files changed, 113 insertions(+), 1 deletion(-)
 create mode 100644 net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch

diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile
index d3aa397..4d0bd5e 100644
--- a/net/isc-dhcp/Makefile
+++ b/net/isc-dhcp/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=isc-dhcp
 UPSTREAM_NAME:=dhcp
 PKG_VERSION:=4.2.4
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(UPSTREAM_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/$(PKG_VERSION)
diff --git a/net/isc-dhcp/files/dhcrelay.config 
b/net/isc-dhcp/files/dhcrelay.config
index a303a60..06111a7 100644
--- a/net/isc-dhcp/files/dhcrelay.config
+++ b/net/isc-dhcp/files/dhcrelay.config
@@ -13,3 +13,7 @@ config 'dhcrelay'
# 'forward': Forward without changes
# 'discard': Don't forward
option 'relay_mode' ''
+
+   # enable RFC3527 link selection sub-option and use the IP address of
+   # the specified network interface as "uplink" IP address (e.g. wan)
+   option 'link_selection' ''
diff --git a/net/isc-dhcp/files/dhcrelay.init b/net/isc-dhcp/files/dhcrelay.init
index e66d34b..9c11a2d 100755
--- a/net/isc-dhcp/files/dhcrelay.init
+++ b/net/isc-dhcp/files/dhcrelay.init
@@ -24,6 +24,14 @@ dhcrelay_start() {
return 0
fi
 
+   # link selection sub-option (RFC3527)
+   local link_selection
+   config_get link_selection "$cfg" link_selection
+   if [ -n "$link_selection" ]; then
+   config_get ifname "$link_selection" ifname
+   append args "-l $ifname"
+   fi
+
# relay mode
local relay_mode
config_get relay_mode "$cfg" relay_mode
diff --git a/net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch 
b/net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch
new file mode 100644
index 000..1f593ee
--- /dev/null
+++ b/net/isc-dhcp/patches/100-relay-rfc3527-link-selection.patch
@@ -0,0 +1,100 @@
+--- a/relay/dhcrelay.c
 b/relay/dhcrelay.c
+@@ -65,6 +65,7 @@ int server_packets_relayed = 0;  /* Packe
+ int client_packet_errors = 0; /* Errors sending packets to clients. */
+ 
+ int add_agent_options = 0;/* If nonzero, add relay agent options. */
++int add_rfc3527_suboption = 0;/* If nonzero, add RFC3527 link 
selection sub-option. */
+ 
+ int agent_option_errors = 0;/* Number of packets forwarded without
+  agent options because there was no room. */
+@@ -104,6 +105,8 @@ struct server_list {
+   struct sockaddr_in to;
+ } *servers;
+ 
++struct interface_info *uplink;
++
+ #ifdef DHCPv6
+ struct stream_list {
+   struct stream_list *next;
+@@ -144,6 +147,7 @@ static const char url[] =
+ " [-pf ] [--no-pid]\n"\
+ " [-m append|replace|forward|discard]\n" \
+ " [-i interface0 [ ... -i interfaceN]\n" \
++" [-l interface]\n" \
+ " server0 [ ... serverN]\n\n" \
+ "   dhcrelay -6   [-d] [-q] [-I] [-c ] [-p ]\n" \
+ " [-pf ] [--no-pid]\n"\
+@@ -157,6 +161,7 @@ static const char url[] =
+ "[-pf ] [--no-pid]\n"\
+ "[-m append|replace|forward|discard]\n" \
+ "[-i interface0 [ ... -i interfaceN]\n" \
++"[-l interface]\n" \
+ "server0 [ ... serverN]\n\n"
+ #endif
+ 
+@@ -314,6 +319,20 @@ main(int argc, char **argv) {
+   agent_relay_mode = discard;
+   } else
+   usage();
++  } else if (!strcmp (argv [i], "-l")) {
++  add_agent_options = 1;
++  add_rfc3527_suboption = 1;
++  if (++i == argc)
++  usage();
++
++  status = interface_allocate(&uplink, MDL);
++  if (status != ISC_R_SUCCESS)
++  log_fatal("%s: interface_allocate: %s",
++argv[i],
++isc_result_totext(status));
++  strcpy(uplink->name, argv[i]);
++  interface_snorf(uplink, INTERFACE_REQUESTED);
++  //interface_dereference(&uplink, MDL);
+   } else if (!strcmp(argv[i], "-D")) {
+ #ifdef DHCPv6
+   if (

[OpenWrt-Devel] [PATCH 4/7] pptpd: Add uci configuration for PPTPD.

2013-10-10 Thread Bruno Randolf
Signed-off-by: Bruno Randolf 
---
 net/pptpd/Makefile|  3 +++
 net/pptpd/files/pptpd.init| 41 +++--
 net/pptpd/files/pptpd.uciconf |  8 
 3 files changed, 50 insertions(+), 2 deletions(-)
 create mode 100644 net/pptpd/files/pptpd.uciconf

diff --git a/net/pptpd/Makefile b/net/pptpd/Makefile
index e79e0a7..0a2f642 100644
--- a/net/pptpd/Makefile
+++ b/net/pptpd/Makefile
@@ -41,6 +41,7 @@ MAKE_FLAGS += \
 define Package/pptpd/conffiles
 /etc/pptpd.conf
 /etc/ppp/options.pptpd
+/etc/config/pptpd
 endef
 
 define Package/pptpd/install
@@ -58,6 +59,8 @@ define Package/pptpd/install
$(INSTALL_BIN) ./files/pptpd.init $(1)/etc/init.d/pptpd
$(INSTALL_DIR) $(1)/etc/ppp
$(INSTALL_DATA) ./files/options.pptpd $(1)/etc/ppp/
+   $(INSTALL_DIR) $(1)/etc/config
+   $(INSTALL_DATA) ./files/pptpd.uciconf $(1)/etc/config/pptpd
 endef
 
 $(eval $(call BuildPackage,pptpd))
diff --git a/net/pptpd/files/pptpd.init b/net/pptpd/files/pptpd.init
index a74973c..849b34e 100644
--- a/net/pptpd/files/pptpd.init
+++ b/net/pptpd/files/pptpd.init
@@ -6,14 +6,51 @@ BIN=pptpd
 DEFAULT=/etc/default/$BIN
 RUN_D=/var/run
 PID_F=$RUN_D/$BIN.pid
+CONFIG=/tmp/pptpd.conf
+CHAP_SECRETS=/etc/ppp/chap-secrets
 
-start() {
+setup_user() {
+   local section="$1"
+
+   config_get user "$section" user
+   config_get passwd "$section" passwd
+   [ -n "$user" ] || return 0
+   [ -n "$passwd" ] || return 0
+
+   echo "$user pptp-server $passwd *" >> $CHAP_SECRETS
+}
+
+setup_config() {
+   local section="$1"
+
+   config_get enabled "$section" enabled
+   [ "$enabled" -eq 0 ] && return 1
+
+   config_get localip "$section" localip
+   config_get remoteip "$section" remoteip
+   [ -n "$localip" ] || return 0
+   [ -n "$remoteip" ] || return 0
+
+   cp /etc/pptpd.conf $CONFIG
+   echo "localip  $localip" >> $CONFIG
+   echo "remoteip  $remoteip" >> $CONFIG
+}
+
+start_pptpd() {
[ -f $DEFAULT ] && . $DEFAULT
mkdir -p $RUN_D
for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async ppp_mppe_mppc; 
do
insmod $m >/dev/null 2>&1
done
-   $BIN $OPTIONS
+   $BIN $OPTIONS -c $CONFIG
+}
+
+start() {
+   [ -e "$CHAP_SECRETS" ] && rm -f $CHAP_SECRETS
+   config_load pptpd
+   config_foreach setup_user key
+   setup_config pptpd
+   start_pptpd
 }
 
 stop() {
diff --git a/net/pptpd/files/pptpd.uciconf b/net/pptpd/files/pptpd.uciconf
new file mode 100644
index 000..66cf0be
--- /dev/null
+++ b/net/pptpd/files/pptpd.uciconf
@@ -0,0 +1,8 @@
+config service 'pptpd'
+   option 'enabled' '0'
+   option 'localip' '192.168.0.1'
+   option 'remoteip' '192.168.0.20-30'
+
+config 'key'
+   option 'user' 'youruser'
+   option 'passwd' 'yourpass'
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/7] pptpd: remove IP in options.pptp

2013-10-10 Thread Bruno Randolf
ppp has obsoleted this option (as of v2.4.3-7) according to
http://wiki.openwrt.org/doc/howto/vpn.server.pptpd

Signed-off-by: Bruno Randolf 
---
 net/pptpd/files/options.pptpd | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/pptpd/files/options.pptpd b/net/pptpd/files/options.pptpd
index 5dd2daf..f73eeea 100644
--- a/net/pptpd/files/options.pptpd
+++ b/net/pptpd/files/options.pptpd
@@ -1,6 +1,5 @@
 #debug
 #logfile /tmp/pptp-server.log
-172.16.1.1:
 auth
 name "pptp-server"
 lcp-echo-failure 3
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 6/7] isc-dhcp: dhcrelay: add UCI config and init script

2013-10-10 Thread Bruno Randolf
Please forget this patch, it is slightly incompatible with the version 
that already exists in trunk... I will update trunk instead.


bruno

On 10/10/2013 01:16 PM, Bruno Randolf wrote:

Signed-off-by: Bruno Randolf 
---
  net/isc-dhcp/Makefile  |  6 +++--
  net/isc-dhcp/files/dhcrelay.config | 15 +++
  net/isc-dhcp/files/dhcrelay.init   | 51 ++
  3 files changed, 70 insertions(+), 2 deletions(-)
  create mode 100644 net/isc-dhcp/files/dhcrelay.config
  create mode 100755 net/isc-dhcp/files/dhcrelay.init

diff --git a/net/isc-dhcp/Makefile b/net/isc-dhcp/Makefile
index 798ee32..d3aa397 100644
--- a/net/isc-dhcp/Makefile
+++ b/net/isc-dhcp/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
  PKG_NAME:=isc-dhcp
  UPSTREAM_NAME:=dhcp
  PKG_VERSION:=4.2.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3

  PKG_SOURCE:=$(UPSTREAM_NAME)-$(PKG_VERSION).tar.gz
  PKG_SOURCE_URL:=ftp://ftp.isc.org/isc/dhcp/$(PKG_VERSION)
@@ -171,8 +171,10 @@ define Build/Compile
  endef

  define Package/isc-dhcp-relay-$(BUILD_VARIANT)/install
-   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcrelay $(1)/usr/sbin
+   $(INSTALL_BIN) ./files/dhcrelay.init $(1)/etc/init.d/dhcrelay
+   $(INSTALL_BIN) ./files/dhcrelay.config $(1)/etc/config/dhcrelay
  endef

  define Package/isc-dhcp-server-$(BUILD_VARIANT)/install
diff --git a/net/isc-dhcp/files/dhcrelay.config 
b/net/isc-dhcp/files/dhcrelay.config
new file mode 100644
index 000..a303a60
--- /dev/null
+++ b/net/isc-dhcp/files/dhcrelay.config
@@ -0,0 +1,15 @@
+config 'dhcrelay'
+   option 'enabled' '0'
+
+   # IP address of the server
+   option 'server' ''
+
+   # network interfaces to listen on (e.g. lan or wan)
+   option 'interfaces' ''
+
+   # What to do about packets that already have a relay option:
+   # 'append': Forward and append our own relay option
+   # 'replace': Forward, but replace theirs with ours (default)
+   # 'forward': Forward without changes
+   # 'discard': Don't forward
+   option 'relay_mode' ''
diff --git a/net/isc-dhcp/files/dhcrelay.init b/net/isc-dhcp/files/dhcrelay.init
new file mode 100755
index 000..e66d34b
--- /dev/null
+++ b/net/isc-dhcp/files/dhcrelay.init
@@ -0,0 +1,51 @@
+#!/bin/sh /etc/rc.common
+START=75
+
+BIN="/usr/sbin/dhcrelay"
+
+dhcrelay_start() {
+   local cfg="$1"
+   local args=""
+
+   local enabled
+   config_get_bool enabled "$cfg" enabled 0
+   [ "${enabled}" -eq 0 ] && return 0
+
+   # listen interfaces
+   local interfaces
+   config_get interfaces "$cfg" interfaces
+   if [ -n "${interfaces}" ]; then
+   for net in $interfaces; do
+   local ifname
+   config_get ifname "$net" ifname
+   [ -n "$ifname" ] && append args "-i $ifname"
+   done
+   else
+   return 0
+   fi
+
+   # relay mode
+   local relay_mode
+   config_get relay_mode "$cfg" relay_mode
+   [ -n "$relay_mode" ] && append args "-m $relay_mode"
+
+   # dhcp server address
+   local server
+   config_get server "$cfg" server
+   [ -n "${server}" ] || return 0
+   append args "${server}"
+
+   start-stop-daemon -S -x ${BIN} -- -q ${args}
+   return $?
+}
+
+start() {
+   include /lib/network
+   scan_interfaces
+   config_load dhcrelay
+   config_foreach dhcrelay_start dhcrelay
+}
+
+stop() {
+   start-stop-daemon -K -x ${BIN}
+}


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


[OpenWrt-Devel] [PATCH] Update bind to 9.9.4

2013-10-10 Thread Thomas Heil
>From bf8914ee8dc72dbe289c4383388b66a7f2acb81c Mon Sep 17 00:00:00 2001
From: Thommas Heil 
Date: Thu, 10 Oct 2013 14:33:45 +0200
Subject: package: bind - update to 9.9.4-1 - refresh patches - disable
ecdsa -

Signed-off-by: Thommas Heil 
---
 net/bind/Makefile   |5 ++-
 net/bind/patches/001-no-tests.patch |   14 +---
 net/bind/patches/002-no-ecdsa-testing.patch |   43
---
 3 files changed, 12 insertions(+), 50 deletions(-)
 delete mode 100644 net/bind/patches/002-no-ecdsa-testing.patch

diff --git a/net/bind/Makefile b/net/bind/Makefile
index 433b54e..7b1f8f7 100644
--- a/net/bind/Makefile
+++ b/net/bind/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bind
-PKG_VERSION:=9.9.2-P2
+PKG_VERSION:=9.9.4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
 ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \
 http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION)
-PKG_MD5SUM:=2be7763c99b7e7b42ac3a18a267ce1aa
+PKG_MD5SUM:=f69757adc86776daed8e5acb0ee7c0ca
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
@@ -95,6 +95,7 @@ CONFIGURE_ARGS += \
 --enable-epoll=yes \
 --with-gost=no \
 --with-gssapi=no \
+--with-ecdsa=no \
 --with-readline=no
 
 CONFIGURE_VARS += \
diff --git a/net/bind/patches/001-no-tests.patch
b/net/bind/patches/001-no-tests.patch
index 5fc1787..c969c5e 100644
--- a/net/bind/patches/001-no-tests.patch
+++ b/net/bind/patches/001-no-tests.patch
@@ -1,16 +1,20 @@
 a/bin/Makefile.in
-+++ b/bin/Makefile.in
+Index: bind-9.9.4/bin/Makefile.in
+===
+--- bind-9.9.4.orig/bin/Makefile.in
 bind-9.9.4/bin/Makefile.in
 @@ -19,7 +19,7 @@ srcdir =@srcdir@
  VPATH =@srcdir@
  top_srcdir =@top_srcdir@
 
--SUBDIRS =named rndc dig dnssec tests tools nsupdate \
+-SUBDIRS =named rndc dig dnssec tools tests nsupdate \
 +SUBDIRS =named rndc dig dnssec tools nsupdate \
  check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@
  TARGETS =
 
 a/lib/Makefile.in
-+++ b/lib/Makefile.in
+Index: bind-9.9.4/lib/Makefile.in
+===
+--- bind-9.9.4.orig/lib/Makefile.in
 bind-9.9.4/lib/Makefile.in
 @@ -23,7 +23,7 @@ top_srcdir =@top_srcdir@
  # Attempt to disable parallel processing.
  .NOTPARALLEL:
diff --git a/net/bind/patches/002-no-ecdsa-testing.patch
b/net/bind/patches/002-no-ecdsa-testing.patch
deleted file mode 100644
index 901e246..000
--- a/net/bind/patches/002-no-ecdsa-testing.patch
+++ /dev/null
@@ -1,43 +0,0 @@
 a/configure.in
-+++ b/configure.in
-@@ -763,40 +763,6 @@ esac
- AC_MSG_RESULT(no)
- fi
-
--AC_CHECK_FUNCS(EVP_sha256 EVP_sha384 EVP_sha512)
--
--AC_MSG_CHECKING(for OpenSSL ECDSA support)
--have_ecdsa=""
--AC_TRY_RUN([
--#include 
--#include 
--#include 
--int main() {
--EC_KEY *ec256, *ec384;
--
--#if !defined(HAVE_EVP_SHA256) || !defined(HAVE_EVP_SHA384)
--return (1);
--#endif
--ec256 = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
--ec384 = EC_KEY_new_by_curve_name(NID_secp384r1);
--if (ec256 == NULL || ec384 == NULL)
--return (2);
--return (0);
--}
--],
--[AC_MSG_RESULT(yes)
--have_ecdsa="yes"],
--[AC_MSG_RESULT(no)
--have_ecdsa="no"])
--case $have_ecdsa in
--yes)
--OPENSSL_ECDSA="yes"
--AC_DEFINE(HAVE_OPENSSL_ECDSA)
--;;
--*)
--;;
--esac
--
- AC_MSG_CHECKING(for OpenSSL GOST support)
- have_gost=""
- AC_TRY_RUN([
-- 
1.7.1

>From bf8914ee8dc72dbe289c4383388b66a7f2acb81c Mon Sep 17 00:00:00 2001
From: Thommas Heil 
Date: Thu, 10 Oct 2013 14:33:45 +0200
Subject: package: bind - update to 9.9.4-1 - refresh patches - disable ecdsa -

Signed-off-by: Thommas Heil 
---
 net/bind/Makefile   |5 ++-
 net/bind/patches/001-no-tests.patch |   14 +---
 net/bind/patches/002-no-ecdsa-testing.patch |   43 ---
 3 files changed, 12 insertions(+), 50 deletions(-)
 delete mode 100644 net/bind/patches/002-no-ecdsa-testing.patch

diff --git a/net/bind/Makefile b/net/bind/Makefile
index 433b54e..7b1f8f7 100644
--- a/net/bind/Makefile
+++ b/net/bind/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bind
-PKG_VERSION:=9.9.2-P2
+PKG_VERSION:=9.9.4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
 	ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \
 	http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION)
-PKG_MD5SUM:=2be7763c99b7e7b42ac3a18a267ce1aa
+PKG_MD5SUM:=f69757adc86776daed8e5acb0ee7c0ca
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
@@ -95,6 +95,7 @@ CONFIGURE_ARGS += \
 	--enable-epoll=yes \
 	--with-gost=no \
 	--with-gssa

Re: [OpenWrt-Devel] [PATCH 00/10] Some patches for AA 12.09

2013-10-10 Thread Jo-Philipp Wich
Hello Bruno.

Are these patches backports from trunk? If not please rebase them on
current trunk so we can apply them there and backport to 12.09 afterwards.

~ Jow



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] Update bind to 9.9.4

2013-10-10 Thread Jo-Philipp Wich
Applied in r38353 with slightly modified commit message.
Thanks.

~ Jow



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] ar71xx / hang during early boot in kernel loader

2013-10-10 Thread Bastian Bittorf
* Bastian Bittorf  [08.10.2013 09:24]:
> Decompressing kernel... failed, data error!
> 
> System halted!
> 
> 
> it's clear, that in this stage we cannot make use of
> kernel features (e.g. panic_on_oops), because there is
> no kernel yet 8-) IMHO we should enforce a reboot in this
> stage, maybe after waiting some seconds (600?). It's
> very annoying in a production/rooftop-scenario if everything
> is alright, but the router had a bitflip...

i digged i bit trough the source and in a lot of loaders i found:
(e.g. in target/linux/ar71xx/image/lzma-loader/src/loader.c)

static void halt(void)
{
printf("System halted!");
for(;;);
}

so it waits forever when _any_ error occurs.

for doing a full reboot in this stage (i think) we have to call
somehow 'machine_restart(args)' - but where can i find the
board-specific code/headers?

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


Re: [OpenWrt-Devel] [PATCH 00/10] Some patches for AA 12.09

2013-10-10 Thread Bruno Randolf

On 10/10/2013 02:50 PM, Jo-Philipp Wich wrote:

Are these patches backports from trunk? If not please rebase them on
current trunk so we can apply them there and backport to 12.09 afterwards.


I made the patches originally for 12.09. I am now forward-porting them 
to trunk, but due to the folder restructuring it's not just rebase or 
cherry-pick... Will send the patches for trunk soon...


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


Re: [OpenWrt-Devel] [PATCHv2] dropbear: update to 2013.59 (released 4 october 2013)

2013-10-10 Thread Jo-Philipp Wich
Applied in r38356 - thanks!

~ Jow



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] GPIO and pinctrl problem

2013-10-10 Thread Gerhard Bertelsmann
Hi,

I'm having a problem with getting and freeing GPIOs. Please have a look at
this simple module:
-8<
#include 
#include 
#include 
#include 

#define DRV_NAME "GPIO Test"
#define PFX DRV_NAME ": "
#define GPIO_TEST_PIN 12

static int __init mymodule_init(void) {
int err;
printk (KERN_INFO PFX "requesting GPIO %d\n", GPIO_TEST_PIN);
err = gpio_request(GPIO_TEST_PIN, "GPIO TEST");
if (err ) {
printk (KERN_ERR PFX "didn't get %d\n", GPIO_TEST_PIN);
return -1;
}
return 0;
}

static void __exit mymodule_exit(void) {
   printk (KERN_INFO PFX "freeing GPIO %d\n", GPIO_TEST_PIN);
   gpio_free(GPIO_TEST_PIN);
   return;
}

module_init(mymodule_init);
module_exit(mymodule_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mister X");
->8

It just request a GPIO and freeing it at module unload. Here is the according
dmesg: (Carambola 1 with RT3052 using actual trunk)

insmod gpio-test
[ 3814.15] GPIO Test: requesting GPIO 12
[ 3814.15] rt2880-pinmux pinctrl.1: request pin 12 (io12) for pio:12
rmmod gpio-test
[ 3825.00] GPIO Test: freeing GPIO 12
insmod gpio-test # again
[ 3832.25] GPIO Test: requesting GPIO 12
[ 3832.25] rt2880-pinmux pinctrl.1: request pin 12 (io12) for pio:12
[ 3832.25] rt2880-pinmux pinctrl.1: pin io12 already requested by pio:12; 
cannot claim for pio:12
[ 3832.26] rt2880-pinmux pinctrl.1: pin-12 (pio:12) status -22
[ 3832.27] GPIO Test: didn't get 12

Why is gpio_free() not enough ? Is there a missing peace in GPIO pinctrl glue ?
Any hint is greatly welcome ...

Regards

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


Re: [OpenWrt-Devel] [PATCH][packages] udpxy: Update to version 1.0.23-9

2013-10-10 Thread Jo-Philipp Wich
Applied in r38357 with slightly modified commit message and changed
source url.

~ Jow



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] iwinfo: make 'type' visible in wrapped iwinfo

2013-10-10 Thread Jo-Philipp Wich
I do not understand the purpose of this patch.
Can you outline such a callsite which is attempting to read the type
attribute?

~ Jow



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] opkg development and OpenWRT

2013-10-10 Thread Jo-Philipp Wich
Hi Paul.
> I'd really like to hear from whoever is maintaining
> the build recipe and patches for opkg within OpenWRT to ensure that we
> help each other out rather than stepping on each others toes.

That would be me. I already planned to give current opkg git a try soon
and see how we can merge our rebase out patches against it.

~ Jow



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [packages] ppp: correct module loaded check in proto_pptp_setup

2013-10-10 Thread Jo-Philipp Wich
Applied in r38358 - thanks!

~ Jow



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 08/10] wpa_supplicant: fix beacon_int configuration option

2013-10-10 Thread Ben West
Here is that same patch, but against current trunk.



On Thu, Oct 10, 2013 at 6:02 AM, Bruno Randolf  wrote:

> wpa_supplicant expects beacon_int instead of beacon_interval in its config
> file.
>
> Signed-off-by: Bruno Randolf 
> ---
>  package/hostapd/files/wpa_supplicant.sh | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/package/hostapd/files/wpa_supplicant.sh
> b/package/hostapd/files/wpa_supplicant.sh
> index 0b5e1d3..bd86801 100644
> --- a/package/hostapd/files/wpa_supplicant.sh
> +++ b/package/hostapd/files/wpa_supplicant.sh
> @@ -119,13 +119,13 @@ wpa_supplicant_setup_vif() {
> ;;
> esac
>
> -   local fixed_freq bssid1 beacon_interval brates mrate
> +   local fixed_freq bssid1 beacon_int brates mrate
> config_get ifname "$vif" ifname
> config_get bridge "$vif" bridge
> config_get ssid "$vif" ssid
> config_get bssid "$vif" bssid
> bssid1=${bssid:+"bssid=$bssid"}
> -   beacon_interval=${beacon_int:+"beacon_interval=$beacon_int"}
> +   beacon_int=${beacon_int:+"beacon_int=$beacon_int"}
>
> local br brval brsub brstr
> [ -n "$basic_rate_list" ] && {
> @@ -163,7 +163,7 @@ network={
> $proto
> $freq
> ${fixed:+"fixed_freq=1"}
> -   $beacon_interval
> +   $beacon_int
> $brates
> $mrate
> $ht_str
> --
> 1.8.1.2
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>



-- 
Ben West
http://gowasabi.net
b...@gowasabi.net
314-246-9434


fix_wpa_supplicant_beacon_int.patch
Description: Binary data
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [OpenWrt-Users] unknown network field 'beacon_int" and wpa_supplicant

2013-10-10 Thread Ben West
Hi cmsv,

Bruno's patch seems to have had its tab spacing munged in transit, which is
why the patch failed.  I'm attaching a Gzipped version of that same patch,
against AA r38347, which should apply cleanly to your build tree.

As for leaving beacon_int unspecified, that would tell the driver to use
whatever default interval it has defined, which is likely driver-specific
(and probably rather small, i.e. 10ms or 50ms).

Note that Bruno and I have both also submitted this as a patch against
current trunk, meaning hopefully this will eventually get ported into AA.



On Thu, Oct 10, 2013 at 6:07 AM, Bruno Randolf  wrote:

> On 10/10/2013 11:28 AM, cmsv wrote:
>
>> I have encountered the following error while trying to patch the file:
>>
>> patching file attitude_adjustment/package/**hostapd/files/wpa_supplicant.
>> **sh
>> Hunk #1 FAILED at 119.
>> Hunk #2 FAILED at 163.
>> 2 out of 2 hunks FAILED -- saving rejects to file
>> attitude_adjustment/package/**hostapd/files/wpa_supplicant.**sh.rej
>>
>> AA revision 38351
>>
>
> Hi,
>
> Check the patch I just posted which is against current AA 12.09. If it
> does not apply to your revision, the patch is simple enough so you can make
> the same changes by hand.
>
> bruno
>
>
>
>
>> On 10/10/2013 03:22 AM, Bruno Randolf wrote:
>>
>>> Hi, This is a patch against AA which fixes it for us:
>>>
>>> wpa_supplicant: fix beacon_int configuration option
>>>
>>> wpa_supplicant expects beacon_int instead of beacon_interval in its
>>> config file.
>>>
>>> diff --git a/package/hostapd/files/wpa_**supplicant.sh
>>> b/package/hostapd/files/wpa_**supplicant.sh
>>> index 0b5e1d3..bd86801 100644
>>> --- a/package/hostapd/files/wpa_**supplicant.sh
>>> +++ b/package/hostapd/files/wpa_**supplicant.sh
>>> @@ -119,13 +119,13 @@ wpa_supplicant_setup_vif() {
>>>  ;;
>>>  esac
>>>
>>> -   local fixed_freq bssid1 beacon_interval brates mrate
>>> +   local fixed_freq bssid1 beacon_int brates mrate
>>>  config_get ifname "$vif" ifname
>>>  config_get bridge "$vif" bridge
>>>  config_get ssid "$vif" ssid
>>>  config_get bssid "$vif" bssid
>>>  bssid1=${bssid:+"bssid=$bssid"**}
>>> -   beacon_interval=${beacon_int:+**"beacon_interval=$beacon_int"}
>>> +   beacon_int=${beacon_int:+"**beacon_int=$beacon_int"}
>>>
>>>  local br brval brsub brstr
>>>  [ -n "$basic_rate_list" ] && {
>>> @@ -163,7 +163,7 @@ network={
>>>  $proto
>>>  $freq
>>>  ${fixed:+"fixed_freq=1"}
>>> -   $beacon_interval
>>> +   $beacon_int
>>>  $brates
>>>  $mrate
>>>  $ht_str
>>>
>>> On 10/10/2013 12:17 AM, Ben West wrote:
>>>
 I believe this problem appeared on or about r36682, which coincides with
 a hostapd update to AA.  This suggests a regression in hostapd w/r/t/ to
 beacon interval code.

 I can confirm the same problem happens when attempting to specify
 beacon_int on a single psk2-encrypted adhoc interface, not just with
 multi-VAPs as with the original poster.  My test was on an Engenius
 EOC-1650, atheros platform, running Attitude Adjustment r38347 that I
 compiled.

 The error quoted below goes away when I comment out the "beacon_int"
 line in /etc/config/wireless.  Likewise, this wireless config, with the
 beacon_int line, works just fine under Attitude Adjustment r36669,
 before the hostapd update.

 root@OpenWRT:~# wifi restart
 command failed: Device or resource busy (-16)
 Successfully initialized wpa_supplicant
 Line 12: unknown network field 'beacon_interval'.
 Line 33: failed to parse network block.
 Failed to read or parse configuration
 '/var/run/wpa_supplicant-**wlan0.conf'.
 enable_mac80211(radio0): Failed to set up wpa_supplicant for interface
 wlan0

 root@OpenWRT:~# cat /etc/config/wireless
 config wifi-device  radio0
   option type mac80211
   option channel  4
   option hwmode   11g
   option macaddr  00:02:6F:XX:XX:XX
   option beacon_int   337
   option diversity 0
   option disabled 0

 config wifi-iface
   option network 'mesh'
   option mode 'adhoc'
   option device 'radio0'
   option ssid 'MyMesh'
   option bssid '02:CA:FF:EE:BA:BF'
   option hidden '0'
   option encryption 'psk2'
   option key 'blahblahblahblahblah'

 root@OpenWRT:~# cat /var/run/wpa_supplicant-wlan0.**conf
 ctrl_interface=/var/run/wpa_**supplicant-wlan0
 ap_scan=2
 network={
   mode=1
   scan_ssid=0
   ssid="MyMesh"
   bssid=02:CA:FF:EE:BA:BF
   key_mgmt=WPA-PSK
   proto=RSN
   frequency=2427
   fixed_freq=1
   beacon_interval=337

   psk="blahblahblahblahblah"

 }

 root@OpenWRT:~# cat /etc/openwrt_release
 DIST

[OpenWrt-Devel] [PATCH 0/8] Various patches for trunk

2013-10-10 Thread Bruno Randolf
Here I'm resending the patches which still apply to trunk from my previous
series which was for AA.

Bruno Randolf (8):
  mark base-files, kernel, opkg as essential packages
  mkfwimage: Increase RSPRO maximum size to 0xF0 (15 MiB)
  opkg: remove patch which disables "upgrade all"
  iw: add patch to support 802.11j frequencies
  wpa_supplicant: fix beacon_int configuration option
  x86: fix condition in base-files.mk
  ppp: [RFC] Add IP unnumbered for PPPoE protocol
  libconfig: enable c++ support (libconfig++).

 package/base-files/Makefile|  1 +
 package/kernel/linux/Makefile  |  2 +-
 package/libs/libconfig/Makefile|  4 +-
 .../services/hostapd/files/wpa_supplicant.sh   |  6 +-
 package/network/services/ppp/Makefile  |  2 +
 .../network/services/ppp/files/ip_unnumbered.sh| 45 
 .../network/utils/iw/patches/140-freq-11j.patch| 85 ++
 package/system/opkg/Makefile   |  1 +
 .../opkg/patches/009-remove-upgrade-all.patch  | 41 ---
 target/linux/x86/base-files.mk |  2 +-
 tools/firmware-utils/src/mkfwimage.c   |  2 +-
 11 files changed, 143 insertions(+), 48 deletions(-)
 create mode 100644 package/network/services/ppp/files/ip_unnumbered.sh
 create mode 100644 package/network/utils/iw/patches/140-freq-11j.patch
 delete mode 100644 package/system/opkg/patches/009-remove-upgrade-all.patch

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


[OpenWrt-Devel] [PATCH 1/8] mark base-files, kernel, opkg as essential packages

2013-10-10 Thread Bruno Randolf
Mark as essential to prevent removal from a running system.

Signed-off-by: Bruno Randolf 
---
 package/base-files/Makefile   | 1 +
 package/kernel/linux/Makefile | 2 +-
 package/system/opkg/Makefile  | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 3ba30c3..3e57525 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -12,6 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 
 PKG_NAME:=base-files
 PKG_RELEASE:=146
+PKG_FLAGS:=essential
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=opkg/host
diff --git a/package/kernel/linux/Makefile b/package/kernel/linux/Makefile
index e10e99c..ef0e5f6 100644
--- a/package/kernel/linux/Makefile
+++ b/package/kernel/linux/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=kernel
-PKG_FLAGS:=hold
+PKG_FLAGS:=hold essential
 
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages
 SCAN_DEPS=modules/*.mk $(TOPDIR)/target/linux/*/modules.mk
diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index 624f2ed..58237ba 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -28,6 +28,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
+PKG_FLAGS:=essential
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/8] opkg: remove patch which disables "upgrade all"

2013-10-10 Thread Bruno Randolf
The patch disables the upgrade "all packages" feature of opkg, by removing
the patch we enable "opkg upgrade" to upgrade all new packages. As noted in the
OpenWRT wiki, this feature has to be used with caution, especially with
SquashFS file systems, but it works really well with writable filesystems such
as JFFS2. As OpenWRT is used on a variety of systems, some with plenty of
writeable flash space, I suggest to not unconditionally disable "upgrade all".

Signed-off-by: Bruno Randolf 
---
 .../opkg/patches/009-remove-upgrade-all.patch  | 41 --
 1 file changed, 41 deletions(-)
 delete mode 100644 package/system/opkg/patches/009-remove-upgrade-all.patch

diff --git a/package/system/opkg/patches/009-remove-upgrade-all.patch 
b/package/system/opkg/patches/009-remove-upgrade-all.patch
deleted file mode 100644
index 395a2a6..000
--- a/package/system/opkg/patches/009-remove-upgrade-all.patch
+++ /dev/null
@@ -1,41 +0,0 @@
 a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -551,18 +551,6 @@ opkg_upgrade_cmd(int argc, char **argv)
-   err = -1;
-}
- }
-- } else {
--pkg_vec_t *installed = pkg_vec_alloc();
--
--pkg_info_preinstall_check();
--
--pkg_hash_fetch_all_installed(installed);
--for (i = 0; i < installed->len; i++) {
-- pkg = installed->pkgs[i];
-- if (opkg_upgrade_pkg(pkg))
-- err = -1;
--}
--pkg_vec_free(installed);
-  }
- 
-  if (opkg_configure_packages(NULL))
-@@ -1258,7 +1246,7 @@ opkg_print_architecture_cmd(int argc, ch
-array for easier maintenance */
- static opkg_cmd_t cmds[] = {
-  {"update", 0, (opkg_cmd_fun_t)opkg_update_cmd, 
PFM_DESCRIPTION|PFM_SOURCE},
-- {"upgrade", 0, (opkg_cmd_fun_t)opkg_upgrade_cmd, 
PFM_DESCRIPTION|PFM_SOURCE},
-+ {"upgrade", 1, (opkg_cmd_fun_t)opkg_upgrade_cmd, 
PFM_DESCRIPTION|PFM_SOURCE},
-  {"list", 0, (opkg_cmd_fun_t)opkg_list_cmd, PFM_SOURCE},
-  {"list_installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd, 
PFM_SOURCE},
-  {"list-installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd, 
PFM_SOURCE},
 a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -221,7 +221,7 @@ usage()
- 
-   printf("\nPackage Manipulation:\n");
-   printf("\tupdateUpdate list of available 
packages\n");
--  printf("\tupgrade   Upgrade installed packages\n");
-+  printf("\tupgrade Upgrade packages\n");
-   printf("\tinstall Install package(s)\n");
-   printf("\tconfigure   Configure unpacked package(s)\n");
-   printf("\tremove   Remove package(s)\n");
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/8] wpa_supplicant: fix beacon_int configuration option

2013-10-10 Thread Bruno Randolf
wpa_supplicant expects beacon_int instead of beacon_interval in its config
file.

Signed-off-by: Bruno Randolf 
---
 package/network/services/hostapd/files/wpa_supplicant.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/hostapd/files/wpa_supplicant.sh 
b/package/network/services/hostapd/files/wpa_supplicant.sh
index 0b5e1d3..bd86801 100644
--- a/package/network/services/hostapd/files/wpa_supplicant.sh
+++ b/package/network/services/hostapd/files/wpa_supplicant.sh
@@ -119,13 +119,13 @@ wpa_supplicant_setup_vif() {
;;
esac
 
-   local fixed_freq bssid1 beacon_interval brates mrate
+   local fixed_freq bssid1 beacon_int brates mrate
config_get ifname "$vif" ifname
config_get bridge "$vif" bridge
config_get ssid "$vif" ssid
config_get bssid "$vif" bssid
bssid1=${bssid:+"bssid=$bssid"}
-   beacon_interval=${beacon_int:+"beacon_interval=$beacon_int"}
+   beacon_int=${beacon_int:+"beacon_int=$beacon_int"}
 
local br brval brsub brstr
[ -n "$basic_rate_list" ] && {
@@ -163,7 +163,7 @@ network={
$proto
$freq
${fixed:+"fixed_freq=1"}
-   $beacon_interval
+   $beacon_int
$brates
$mrate
$ht_str
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/8] mkfwimage: Increase RSPRO maximum size to 0xF00000 (15 MiB)

2013-10-10 Thread Bruno Randolf
RSPRO has 16MiB of Flash, using the following layout:

[2.93] 0x-0x0003 : "RedBoot"
[2.94] 0x0003-0x0013 : "kernel"
[2.95] 0x0013-0x00ff : "rootfs"
[2.96] 0x00ff-0x00fff000 : "FIS directory"
[2.97] 0x00fff000-0x0100 : "RedBoot config"

Firmware images contain kernel and rootfs, so they can use up to 0xFF -
0x3 = 0xFC (15,75MiB) of space. We don't include the RedBoot and FIS
partitions and leave an extra 0xC (768KiB) of space.

This is based on revision 18410 which sets the limit to 0xB0 (11 MiB).

Signed-off-by: Bruno Randolf 
---
 tools/firmware-utils/src/mkfwimage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/firmware-utils/src/mkfwimage.c 
b/tools/firmware-utils/src/mkfwimage.c
index a527014..e3a03c1 100644
--- a/tools/firmware-utils/src/mkfwimage.c
+++ b/tools/firmware-utils/src/mkfwimage.c
@@ -61,7 +61,7 @@ fw_layout_t fw_layout_data[] = {
.name   =   "RSPRO",
.kern_start =   0xbf03,
.kern_entry =   0x8006,
-   .firmware_max_length=   0x00B0,
+   .firmware_max_length=   0x00F0,
},
{
.name   =   "LS-SR71",
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/8] iw: add patch to support 802.11j frequencies

2013-10-10 Thread Bruno Randolf
A similar change was recently merged in iw commit
58b46da26ab9b5ff31c7033e175351eb1301d9af

Signed-off-by: Bruno Randolf 
---
 .../network/utils/iw/patches/140-freq-11j.patch| 85 ++
 1 file changed, 85 insertions(+)
 create mode 100644 package/network/utils/iw/patches/140-freq-11j.patch

diff --git a/package/network/utils/iw/patches/140-freq-11j.patch 
b/package/network/utils/iw/patches/140-freq-11j.patch
new file mode 100644
index 000..eae1f21
--- /dev/null
+++ b/package/network/utils/iw/patches/140-freq-11j.patch
@@ -0,0 +1,85 @@
+--- a/iw.h
 b/iw.h
+@@ -146,7 +146,7 @@ void print_ht_capability(__u16 cap);
+ 
+ const char *iftype_name(enum nl80211_iftype iftype);
+ const char *command_name(enum nl80211_commands cmd);
+-int ieee80211_channel_to_frequency(int chan);
++int ieee80211_channel_to_frequency(int chan, enum nl80211_band band);
+ int ieee80211_frequency_to_channel(int freq);
+ 
+ void print_ssid_escaped(const uint8_t len, const uint8_t *data);
+--- a/phy.c
 b/phy.c
+@@ -66,8 +66,12 @@ static int handle_freqchan(struct nl_msg
+   if (*end)
+   return 1;
+ 
+-  if (chan)
+-  freq = ieee80211_channel_to_frequency(freq);
++  if (chan) {
++  enum nl80211_band band;
++  band = freq <= 14 ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
++  freq = ieee80211_channel_to_frequency(freq, band);
++  }
++
+ 
+   NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
+   NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, htval);
+--- a/util.c
 b/util.c
+@@ -248,31 +248,37 @@ const char *command_name(enum nl80211_co
+   return cmdbuf;
+ }
+ 
+-int ieee80211_channel_to_frequency(int chan)
++int ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
+ {
+-  if (chan < 14)
+-  return 2407 + chan * 5;
+-
+-  if (chan == 14)
+-  return 2484;
+-
+-  /* FIXME: dot11ChannelStartingFactor (802.11-2007 17.3.8.3.2) */
+-  return (chan + 1000) * 5;
++  /* see 802.11-2007 17.3.8.3.2 and Annex J
++   * there are overlapping channel numbers in 5GHz and 2GHz bands */
++  if (band == NL80211_BAND_5GHZ) {
++  if (chan >= 182 && chan <= 196)
++  return 4000 + chan * 5;
++  else
++  return 5000 + chan * 5;
++  } else { /* NL80211_BAND_2GHZ */
++  if (chan == 14)
++  return 2484;
++  else if (chan < 14)
++  return 2407 + chan * 5;
++  else
++  return 0; /* not supported */
++  }
+ }
+ 
+ int ieee80211_frequency_to_channel(int freq)
+ {
++  /* see 802.11-2007 17.3.8.3.2 and Annex J */
+   if (freq == 2484)
+   return 14;
+-
+-  if (freq < 2484)
++  else if (freq < 2484)
+   return (freq - 2407) / 5;
+-
+-  /* FIXME: dot11ChannelStartingFactor (802.11-2007 17.3.8.3.2) */
+-  if (freq < 45000)
+-  return freq/5 - 1000;
+-
+-  if (freq >= 58320 && freq <= 64800)
++  else if (freq >= 4910 && freq <= 4980)
++  return (freq - 4000) / 5;
++  else if (freq < 45000)
++  return (freq - 5000) / 5;
++  else if (freq >= 58320 && freq <= 64800)
+   return (freq - 56160) / 2160;
+ 
+   return 0;
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 7/8] ppp: [RFC] Add IP unnumbered for PPPoE protocol

2013-10-10 Thread Bruno Randolf
Some PPP connections don't use a dedicated IP, instead an IP address of another
local interface is "reused" on the PPP interface.

Some Internet providers require this, since their PPPoE server pushes the
network address when routing multiple IPs, and some customers want to use it to
save IP addresses.

Reference: http://www.sustworks.com/site/ipr_guide/unnumbered.html

I have added an UCI option 'unnumbered' 'INTF' which means "reuse the IP
address of INTF" (e.g. unnumbered LAN will put the IP of the LAN interface on
the ppp interface as well), and the following script in /etc/ppp/ip-up.d/.

RFC: It works, but it is not integrated with netifd, e.g. netifd does not know
about the IP address we assigned.

Signed-off-by: Bruno Randolf 
---
 package/network/services/ppp/Makefile  |  2 +
 .../network/services/ppp/files/ip_unnumbered.sh| 45 ++
 2 files changed, 47 insertions(+)
 create mode 100644 package/network/services/ppp/files/ip_unnumbered.sh

diff --git a/package/network/services/ppp/Makefile 
b/package/network/services/ppp/Makefile
index d4aab38..51ce4db 100644
--- a/package/network/services/ppp/Makefile
+++ b/package/network/services/ppp/Makefile
@@ -207,6 +207,8 @@ define Package/ppp-mod-pppoe/install
$(INSTALL_DIR) $(1)/usr/lib/pppd/$(PKG_VERSION)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/pppd/$(PKG_VERSION)/rp-pppoe.so \
$(1)/usr/lib/pppd/$(PKG_VERSION)/
+   $(INSTALL_DIR) $(1)/etc/ppp/ip-up.d
+   $(INSTALL_BIN) ./files/ip_unnumbered.sh $(1)/etc/ppp/ip-up.d
 endef
 
 define Package/ppp-mod-radius/install
diff --git a/package/network/services/ppp/files/ip_unnumbered.sh 
b/package/network/services/ppp/files/ip_unnumbered.sh
new file mode 100644
index 000..4fa47f8
--- /dev/null
+++ b/package/network/services/ppp/files/ip_unnumbered.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+#pppoe-WAN eth0 0 192.168.71.5 10.0.0.1 WAN
+P_LOCAL=$4
+P_REMOTE=$5
+P_IFACE=$1
+P_NET=$6
+
+hook_unnumbered() {
+   local cfg="$1"
+   local proto ifname unnumbered
+
+   config_get proto "$cfg" proto
+   [ "$proto" = "pppoe" ] || return 0
+
+   config_get ifname "$cfg" ifname
+   [ "x$P_IFACE" = "x$ifname" ] || return 0
+
+   config_get unnumbered "$cfg" unnumbered
+   [ -n "$unnumbered" ] || return 0
+
+   # Get ipaddr and netmask from unnumbered interface.
+   # And that interface must be static one.
+   local proto ipaddr netmask
+   config_get proto "$unnumbered" proto
+   config_get ipaddr "$unnumbered" ipaddr
+   config_get netmask "$unnumbered" netmask
+   [ -n "$ipaddr" -a -n "$netmask" -a "x$proto" = "xstatic" ] || return 0
+
+   eval "$(ipcalc.sh $ipaddr $netmask)"
+
+   # Validate netowrk address
+   if [ "x$P_LOCAL" = "x$NETWORK" ]; then
+   /sbin/ifconfig ${P_IFACE} "$ipaddr" pointopoint ${P_REMOTE}
+   /sbin/route add default gw ${P_REMOTE}
+   fi
+}
+
+. /lib/functions.sh
+include /lib/network
+scan_interfaces
+config_load network
+
+hook_unnumbered $P_NET
+
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 8/8] libconfig: enable c++ support (libconfig++).

2013-10-10 Thread Bruno Randolf
Signed-off-by: Bruno Randolf 
---
 package/libs/libconfig/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/libs/libconfig/Makefile b/package/libs/libconfig/Makefile
index 5ade648..8723e36 100644
--- a/package/libs/libconfig/Makefile
+++ b/package/libs/libconfig/Makefile
@@ -44,7 +44,8 @@ endef
 CONFIGURE_ARGS += \
--enable-shared \
--disable-static \
-   --disable-cxx
+   --enable-cxx \
+   --disable-examples
 
 define Build/InstallDev
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
@@ -53,6 +54,7 @@ endef
 define Package/libconfig/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfig.so* $(1)/usr/lib/
+   $(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfig++.so.* $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,libconfig))
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 6/8] x86: fix condition in base-files.mk

2013-10-10 Thread Bruno Randolf
TARGET_x86_generic_Soekris48xx is not defined,
CONFIG_TARGET_x86_generic_Soekris48xx is

This changes makes it possible to override the network config for soekris 
net48xx
and net45xx targets.

Signed-off-by: Bruno Randolf 
---
 target/linux/x86/base-files.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/x86/base-files.mk b/target/linux/x86/base-files.mk
index 889f944..6c6e6f1 100644
--- a/target/linux/x86/base-files.mk
+++ b/target/linux/x86/base-files.mk
@@ -1,4 +1,4 @@
-ifneq ($(TARGET_x86_generic_Soekris48xx)$(TARGET_x86_generic_Soekris45xx),)
+ifneq 
($(CONFIG_TARGET_x86_generic_Soekris48xx)$(CONFIG_TARGET_x86_generic_Soekris45xx),)
 define Package/base-files/install-target
rm -f $(1)/etc/config/network
 endef
-- 
1.8.1.2
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 4/7] pptpd: Add uci configuration for PPTPD.

2013-10-10 Thread Yousong Zhou
Hi,

On 10 October 2013 20:16, Bruno Randolf  wrote:
> Signed-off-by: Bruno Randolf 
> ---
>  net/pptpd/Makefile|  3 +++
>  net/pptpd/files/pptpd.init| 41 +++--
>  net/pptpd/files/pptpd.uciconf |  8 
>  3 files changed, 50 insertions(+), 2 deletions(-)
>  create mode 100644 net/pptpd/files/pptpd.uciconf
>
> diff --git a/net/pptpd/Makefile b/net/pptpd/Makefile
> index e79e0a7..0a2f642 100644
> --- a/net/pptpd/Makefile
> +++ b/net/pptpd/Makefile
> @@ -41,6 +41,7 @@ MAKE_FLAGS += \
>  define Package/pptpd/conffiles
>  /etc/pptpd.conf
>  /etc/ppp/options.pptpd
> +/etc/config/pptpd
>  endef
>
>  define Package/pptpd/install
> @@ -58,6 +59,8 @@ define Package/pptpd/install
> $(INSTALL_BIN) ./files/pptpd.init $(1)/etc/init.d/pptpd
> $(INSTALL_DIR) $(1)/etc/ppp
> $(INSTALL_DATA) ./files/options.pptpd $(1)/etc/ppp/
> +   $(INSTALL_DIR) $(1)/etc/config
> +   $(INSTALL_DATA) ./files/pptpd.uciconf $(1)/etc/config/pptpd
>  endef
>
>  $(eval $(call BuildPackage,pptpd))
> diff --git a/net/pptpd/files/pptpd.init b/net/pptpd/files/pptpd.init
> index a74973c..849b34e 100644
> --- a/net/pptpd/files/pptpd.init
> +++ b/net/pptpd/files/pptpd.init
> @@ -6,14 +6,51 @@ BIN=pptpd
>  DEFAULT=/etc/default/$BIN
>  RUN_D=/var/run
>  PID_F=$RUN_D/$BIN.pid
> +CONFIG=/tmp/pptpd.conf
> +CHAP_SECRETS=/etc/ppp/chap-secrets
>
> -start() {
> +setup_user() {
> +   local section="$1"
> +
> +   config_get user "$section" user
> +   config_get passwd "$section" passwd
> +   [ -n "$user" ] || return 0
> +   [ -n "$passwd" ] || return 0
> +
> +   echo "$user pptp-server $passwd *" >> $CHAP_SECRETS
> +}
> +
> +setup_config() {
> +   local section="$1"
> +
> +   config_get enabled "$section" enabled
> +   [ "$enabled" -eq 0 ] && return 1
> +
> +   config_get localip "$section" localip
> +   config_get remoteip "$section" remoteip
> +   [ -n "$localip" ] || return 0
> +   [ -n "$remoteip" ] || return 0
> +
> +   cp /etc/pptpd.conf $CONFIG
> +   echo "localip  $localip" >> $CONFIG
> +   echo "remoteip  $remoteip" >> $CONFIG
> +}
> +
> +start_pptpd() {
> [ -f $DEFAULT ] && . $DEFAULT
> mkdir -p $RUN_D
> for m in arc4 sha1 slhc crc-ccitt ppp_generic ppp_async 
> ppp_mppe_mppc; do
> insmod $m >/dev/null 2>&1
> done
> -   $BIN $OPTIONS
> +   $BIN $OPTIONS -c $CONFIG
> +}
> +
> +start() {
> +   [ -e "$CHAP_SECRETS" ] && rm -f $CHAP_SECRETS
> +   config_load pptpd
> +   config_foreach setup_user key
> +   setup_config pptpd
> +   start_pptpd

To make `enabled 0` a working option, it should be something like

setup_config pptpd && start_pptpd


>  }
>
>  stop() {
> diff --git a/net/pptpd/files/pptpd.uciconf b/net/pptpd/files/pptpd.uciconf
> new file mode 100644
> index 000..66cf0be
> --- /dev/null
> +++ b/net/pptpd/files/pptpd.uciconf
> @@ -0,0 +1,8 @@
> +config service 'pptpd'
> +   option 'enabled' '0'
> +   option 'localip' '192.168.0.1'
> +   option 'remoteip' '192.168.0.20-30'
> +
> +config 'key'
> +   option 'user' 'youruser'
> +   option 'passwd' 'yourpass'
> --
> 1.8.1.2
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

On 10 October 2013 20:16, Bruno Randolf  wrote:
> Signed-off-by: Bruno Randolf 
> ---
>  net/pptpd/Makefile|  3 +++
>  net/pptpd/files/pptpd.init| 41 +++--
>  net/pptpd/files/pptpd.uciconf |  8 
>  3 files changed, 50 insertions(+), 2 deletions(-)
>  create mode 100644 net/pptpd/files/pptpd.uciconf
>
> diff --git a/net/pptpd/Makefile b/net/pptpd/Makefile
> index e79e0a7..0a2f642 100644
> --- a/net/pptpd/Makefile
> +++ b/net/pptpd/Makefile
> @@ -41,6 +41,7 @@ MAKE_FLAGS += \
>  define Package/pptpd/conffiles
>  /etc/pptpd.conf
>  /etc/ppp/options.pptpd
> +/etc/config/pptpd
>  endef
>
>  define Package/pptpd/install
> @@ -58,6 +59,8 @@ define Package/pptpd/install
> $(INSTALL_BIN) ./files/pptpd.init $(1)/etc/init.d/pptpd
> $(INSTALL_DIR) $(1)/etc/ppp
> $(INSTALL_DATA) ./files/options.pptpd $(1)/etc/ppp/
> +   $(INSTALL_DIR) $(1)/etc/config
> +   $(INSTALL_DATA) ./files/pptpd.uciconf $(1)/etc/config/pptpd
>  endef
>
>  $(eval $(call BuildPackage,pptpd))
> diff --git a/net/pptpd/files/pptpd.init b/net/pptpd/files/pptpd.init
> index a74973c..849b34e 100644
> --- a/net/pptpd/files/pptpd.init
> +++ b/net/pptpd/files/pptpd.init
> @@ -6,14 +6,51 @@ BIN=pptpd
>  DEFAULT=/etc/default/$BIN
>  RUN_D=/var/run
>  PID_F=$RUN_D/$BIN.pid
> +CONFIG=/tmp/pptpd.conf
> +CHAP_SECRETS=/etc/ppp/chap-secrets
>
> -start() {
> +setup_user() {
> +   local section="$1"
> +
> +   config_get user "$section" user
> +   config_get passwd "$section" passwd
> +   [ -n "$

Re: [OpenWrt-Devel] [PATCH 01/10] cron: improve init script

2013-10-10 Thread Yousong Zhou
Hi,

On 10 October 2013 19:02, Bruno Randolf  wrote:
> Add PATH in case it is missing (e.g. when executing the script from
> ssh, like "ssh IP /etc/init.d/cron restart").
>
> Signed-off-by: Bruno Randolf 
> ---
>  package/busybox/files/cron | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/package/busybox/files/cron b/package/busybox/files/cron
> index 465b1ab..79b0a46 100755
> --- a/package/busybox/files/cron
> +++ b/package/busybox/files/cron
> @@ -5,6 +5,8 @@ START=50
>
>  SERVICE_USE_PID=1
>
> +PATH="/usr/sbin/:$PATH"

Not sure here. Even `PATH` is needed, it should be `export PATH=xxx`
to make it visible to child processes.

> +
>  start () {
> loglevel=$(uci_get "system.@system[0].cronloglevel")
> [ -z "$(ls /etc/crontabs/)" ] && exit 1
> --
> 1.8.1.2
> ___
> 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] GPIO and pinctrl problem

2013-10-10 Thread Jiapeng Li
I think the new gpio driver(after r38026(include)) of ramips platform has
some bugs, after i set uartf to "gpio uartf" mode, i can't export any gpio.
Maybe there are some relationship between this error and mine.

root@OpenWrt:/sys/class/gpio# echo 1 > export
[ 1056.70] rt2880-pinmux pinctrl.1: pin 1 is not set to gpio mux
[ 1056.72] rt2880-pinmux pinctrl.1: request() failed for pin 1
[ 1056.73] rt2880-pinmux pinctrl.1: pin-1 (pio:1) status -22
ash: write error: Invalid argument
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] GPIO and pinctrl problem

2013-10-10 Thread Jiapeng Li
Which version of trunk do you use? After i downgrade to r38025, all things
work fine.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] iwinfo: make 'type' visible in wrapped iwinfo

2013-10-10 Thread Nathan Hintz
On Thu, 10 Oct 2013 16:52:23 +0200
Jo-Philipp Wich  wrote:

> I do not understand the purpose of this patch.
> Can you outline such a callsite which is attempting to read the type
> attribute?
> 
> ~ Jow
> 

Here are the places in luci that I am aware of:

libs/core/luasrc/model/network.lua (lines 1251 and 1253)
modules/admin-full/luasrc/view/admin_network/wifi_join.htm (line 135)

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