Re: [OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

2015-09-15 Thread John kerry
Please can anyone reply

On Tue, Sep 15, 2015 at 2:16 PM, John kerry  wrote:

> Hi,
>
> I have written the following condition in /etc/hotplug.d/button/50-wps file
> if [ "$ACTION" = "pressed" -a "$BUTTON" = "lanwifi" ]; then
> echo "" > /dev/console
> echo "SWITCH TO RJ45" > /dev/console
> echo "255" >
> /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
> fi
>
> So Now whenever i pressed button the Status LED will glow otherwise OFF.
>
> But i need to check one more condition eth0 link UP/Down, If UP only i
> have to ON the status LED.
>
> Could anyone please tell how i can add such condition in this script.
>
> Regards,
>
>
>
> On Tue, Sep 15, 2015 at 2:00 PM, John kerry  wrote:
>
>> Hi,
>>
>> I have to write some condition in
>> /etc/hotplug.d/button/50-wps/ file
>>
>> I have to configure cat /etc/hotplug.d/button/00-wps file for following
>> condition:
>> if [ "$BUTTON" = "BTN_2" ] && [ "$ACTION" = "pressed" ]; then
>>
>> I have to check eth0.1 if link is up then have ON status led otherwise
>> OFF.
>>
>> I am able ON/OFF Status LED based on eth0 link up/down using below
>>
>> config led 'led_status'
>> option name 'STATUS'
>> option interval '50'
>> option sysfs 'wndr3700:green:status'
>> option default '0'
>> option trigger 'netdev'
>> option mode 'link'
>> option dev 'eth0'
>>
>>  But i need to check first above button that is pressed only i have to
>> check eth0 status.
>>
>> I am not able to mix both condition in one place.
>>
>> Could anyone please reply, how i can add such condition in that file.
>>
>
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

2015-09-15 Thread Rafał Miłecki
On 15 September 2015 at 09:17, John kerry  wrote:
> Please can anyone reply

Is someone here your paid support with 1h response time?
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

2015-09-15 Thread John Crispin


On 15/09/2015 09:27, Rafał Miłecki wrote:
> On 15 September 2015 at 09:17, John kerry  wrote:
>> Please can anyone reply
> 
> Is someone here your paid support with 1h response time?

although i find this emails annoying and funny at the same time we can
probably assume that it is not him that thinks so but some manager
further up in his hierachy that does not understand how opensource works
that is pressuring him.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] r46816, remove unused crypt() algorithms -> switch to sha512?

2015-09-15 Thread Felix Fietkau
On 2015-09-15 08:20, Etienne Champetier wrote:
> Hi,
> 
> Le 15 sept. 2015 01:40, "Felix Fietkau"  > a écrit :
>>
>> On 2015-09-15 00:22, Etienne Champetier wrote:
>> > Hi Felix,
>> >
>> > Maybe we should keep sha512 and switch to it? md5 is not best security
>> > practice these days.
>> I don't see the point. It's true that for file integrity purposes, md5
>> is weaker than sha512, but for salted passwords it should not make much
>> of a practical difference. Cryptographic attacks against MD5 don't work
>> here, brute force is still the fastest way to crack those.
> 
> Yep, and there is a 100x between md5 and sha512, so it does matter a bit
> http://blog.codinghorror.com/speed-hashing/
If you're interested in making passwords hard to crack, switching to
SHA512 is an almost pointless band-aid, not a real fix. In the world of
cryptography, a 100x increase isn't exactly a lot. If you want to make
passwords really hard to crack, you could make the code use something
like PBKDF2...

>> > I've checked, ubuntu 14.04 and fedora 22 both use sha512 in /etc/shadow
>> Not a very convincing reason for me. The impractical aspect of switching
>> password hashing algorithms is that we then need to support both the new
>> one and the old one for a long time.
> If 5k is the cost of some more security, i'm personnaly OK to pay the price
If you propose a real fix (e.g. using a hash that was not designed to be
fast), I will have no problem with adding a few kilobytes of bloat...

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


Re: [OpenWrt-Devel] [PATCH] extra configuration options for OpenVPN in init script

2015-09-15 Thread François Kooman
On 09/15/2015 07:20 AM, John Crispin wrote:
> this package is maintained on github. please send a properly formatted
> PR via github. also you patch is missing the SoB line and it is attached
> and not inline.

It seems the OpenVPN init script is not maintained in the packages [0]
repository on GitHub? It seems to be in the repo on git.openwrt.org [1].

Regards,
François

[0] https://github.com/openwrt/packages
[1]
http://git.openwrt.org/?p=openwrt.git;a=tree;f=package/network/services/openvpn
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

2015-09-15 Thread Bastian Bittorf
* John kerry  [15.09.2015 08:52]:
> I have to write some condition in
> /etc/hotplug.d/button/50-wps/ file
> 
> I have to configure cat /etc/hotplug.d/button/00-wps file for following
> condition:
> if [ "$BUTTON" = "BTN_2" ] && [ "$ACTION" = "pressed" ]; then
> 
> I have to check eth0.1 if link is up then have ON status led otherwise OFF.

if i understand you correctly, you want this:

MYDEV='eth0.1'
[ "$BUTTON" = 'BTN_2' -a "$ACTION" = 'pressed' ] && {
  devstatus "$MYDEV" | grep '"up": true' && {
your_action_here
  }
}

but this is at least...rude. better you use the correct
JSON-parser like:

. /usr/share/libubox/jshn.sh
json_load "$( devstatus eth0.1 )"
json_get_var 'JSON_VAR_up' 'up'
json_cleanup

in case your dev is up you have e.g.
$JSON_VAR_up = 1

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


Re: [OpenWrt-Devel] r46816, remove unused crypt() algorithms -> switch to sha512?

2015-09-15 Thread Felix Fietkau
On 2015-09-15 10:00, Felix Fietkau wrote:
> On 2015-09-15 08:20, Etienne Champetier wrote:
>> Hi,
>> 
>> Le 15 sept. 2015 01:40, "Felix Fietkau" > > a écrit :
>>>
>>> On 2015-09-15 00:22, Etienne Champetier wrote:
>>> > Hi Felix,
>>> >
>>> > Maybe we should keep sha512 and switch to it? md5 is not best security
>>> > practice these days.
>>> I don't see the point. It's true that for file integrity purposes, md5
>>> is weaker than sha512, but for salted passwords it should not make much
>>> of a practical difference. Cryptographic attacks against MD5 don't work
>>> here, brute force is still the fastest way to crack those.
>> 
>> Yep, and there is a 100x between md5 and sha512, so it does matter a bit
>> http://blog.codinghorror.com/speed-hashing/
> If you're interested in making passwords hard to crack, switching to
> SHA512 is an almost pointless band-aid, not a real fix. In the world of
> cryptography, a 100x increase isn't exactly a lot. If you want to make
> passwords really hard to crack, you could make the code use something
> like PBKDF2...
And here's another thing: There's an easy way you can increase the
cracking difficulty a lot more than 100x without having to change the
code at all: Just make your passwords two characters longer :)

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


Re: [OpenWrt-Devel] [PATCH] ar71xx: add TP-LINK TL-WDR3320 v2 support

2015-09-15 Thread 高惟杰
Oh, that's a mistake.

2015-09-15 4:03 GMT+08:00 John Crispin :

> Hi,
>
> On 09/09/2015 16:56, Weijie Gao wrote:
> > Signed-off-by: Weijie Gao 
>
> this line should be the last line and not the first, i manually fixed
> this during the merge
>
> John
>
> >
> > This patch adds support for TP-LINK TL-WDR3320 v2.
> >
> > This router uses a chinese version 2 firmware header,.
> > ---
> >  target/linux/ar71xx/base-files/etc/diag.sh |   1 +
> >  .../ar71xx/base-files/etc/uci-defaults/01_leds |   4 +
> >  .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
> >  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   6 +
> >  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
> >  target/linux/ar71xx/config-4.1 |   1 +
> >  .../files/arch/mips/ath79/mach-tl-wdr3320-v2.c | 146
> +
> >  target/linux/ar71xx/generic/profiles/tp-link.mk|  11 ++
> >  target/linux/ar71xx/image/Makefile |  46 ++-
> >  .../816-MIPS-ath79-add-tl-wdr3320-v2-support.patch |  40 ++
> >  10 files changed, 256 insertions(+), 1 deletion(-)
> >  create mode 100644
> target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3320-v2.c
> >  create mode 100644
> target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-tl-wdr3320-v2-support.patch
> >
> > diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
> b/target/linux/ar71xx/base-files/etc/diag.sh
> > index 36de775..0dcc844 100644
> > --- a/target/linux/ar71xx/base-files/etc/diag.sh
> > +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> > @@ -256,6 +256,7 @@ get_status_led() {
> >   tl-wa901nd | \
> >   tl-wa901nd-v2 | \
> >   tl-wa901nd-v3 | \
> > + tl-wdr3320-v2 | \
> >   tl-wdr3500 | \
> >   tl-wr1041n-v2 | \
> >   tl-wr1043nd | \
> > diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> > index e7f7a4c..4dafc1e 100644
> > --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> > +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds
> > @@ -425,6 +425,10 @@ tl-wa901nd-v2)
> >   ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt"
> >   ;;
> >
> > +tl-wdr3320-v2)
> > + ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:green:wlan5g"
> "phy0tpt"
> > + ;;
> > +
> >  tl-wdr3500)
> >   ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1"
> >   ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:green:wlan2g"
> "phy0tpt"
> > diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> > index 686fce9..37d5a63 100644
> > --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> > +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
> > @@ -435,6 +435,7 @@ tew-712br |\
> >  tl-mr3220 |\
> >  tl-mr3220-v2 |\
> >  tl-mr3420 |\
> > +tl-wdr3320-v2 |\
> >  tl-wdr3500 |\
> >  tl-wr741nd |\
> >  tl-wr741nd-v4 |\
> > diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> > index e1f345e..c5440f9 100755
> > --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> > +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> > @@ -221,6 +221,9 @@ tplink_board_detect() {
> >   "342000"*)
> >   model="TP-Link TL-MR3420"
> >   ;;
> > + "332000"*)
> > + model="TP-Link TL-WDR3320"
> > + ;;
> >   "35"*)
> >   model="TP-Link TL-WDR3500"
> >   ;;
> > @@ -763,6 +766,9 @@ ar71xx_board_detect() {
> >   *"TL-WA901ND v3")
> >   name="tl-wa901nd-v3"
> >   ;;
> > + *"TL-WDR3320 v2")
> > + name="tl-wdr3320-v2"
> > + ;;
> >   *"TL-WDR3500")
> >   name="tl-wdr3500"
> >   ;;
> > diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> > index c1962e4..1d56d99 100755
> > --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> > +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
> > @@ -338,6 +338,7 @@ platform_check_image() {
> >   tl-wa901nd | \
> >   tl-wa901nd-v2 | \
> >   tl-wa901nd-v3 | \
> > + tl-wdr3320-v2 | \
> >   tl-wdr3500 | \
> >   tl-wdr4300 | \
> >   tl-wdr4900-v2 | \
> > diff --git a/target/linux/ar71xx/config-4.1
> b/target/linux/ar71xx/config-4.1
> > index 21c4601..d0a6602 100644
> > --- a/target/linux/ar71xx/config-4.1
> > +++ b/target/linux/ar71xx/config-4.1
> > @@ -121,6 +121,7 @@ CONFIG_ATH79_MACH_TL_WA830RE_V2=y
> >  CONFIG_ATH79_MACH_TL_WA901ND=y
> >  CONFIG_ATH79_MACH_TL_WA901ND_V2=y
> >  CONFIG_ATH79_MACH_TL_WAX50RE=y
> > +CONFIG_ATH79_MACH_TL_WDR3320_V2=y
> >  CONFIG_ATH79_MACH_TL_WDR3500=y
> >  CONFIG_ATH79_MACH_TL_WDR4300=y
> >  CONFIG_ATH79_MACH_TL_WDR6500_V2=y
> > diff --git
> a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr3

Re: [OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

2015-09-15 Thread John kerry
Hi,

I have added following condition but its not working:

MYDEV='eth0'

if [ "$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" ] && {
  devstatus "$MYDEV" | grep '"up": true' && {
echo "255" >
/sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
  }
}

fi

Am i doing any mistake or need to change anything

Regards,
John

On Tue, Sep 15, 2015 at 4:07 PM, Bastian Bittorf 
wrote:

> * John kerry  [15.09.2015 08:52]:
> > I have to write some condition in
> > /etc/hotplug.d/button/50-wps/ file
> >
> > I have to configure cat /etc/hotplug.d/button/00-wps file for following
> > condition:
> > if [ "$BUTTON" = "BTN_2" ] && [ "$ACTION" = "pressed" ]; then
> >
> > I have to check eth0.1 if link is up then have ON status led otherwise
> OFF.
>
> if i understand you correctly, you want this:
>
> MYDEV='eth0.1'
> [ "$BUTTON" = 'BTN_2' -a "$ACTION" = 'pressed' ] && {
>   devstatus "$MYDEV" | grep '"up": true' && {
> your_action_here
>   }
> }
>
> but this is at least...rude. better you use the correct
> JSON-parser like:
>
> . /usr/share/libubox/jshn.sh
> json_load "$( devstatus eth0.1 )"
> json_get_var 'JSON_VAR_up' 'up'
> json_cleanup
>
> in case your dev is up you have e.g.
> $JSON_VAR_up = 1
>
> bye, bastian
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

2015-09-15 Thread John kerry
Hi,

If i am configuring below config under /etc/config/system file , The STATUS
LED working fine based on eth0 link up/down.

config led 'led_status'
option name 'STATUS'
option interval '50'
option sysfs 'db120:green:status'
option default '0'
option trigger 'netdev'
option mode 'link'
option dev 'eth0'

The switch button defined as below under /etc/hotplug.d/button/50-wps

if [ "$ACTION" = "pressed" -a "$BUTTON" = "lanwifi" ]; then
echo "255" >
/sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
fi

This working fine. I need to add condition as below:

if [ "$ACTION" = "pressed" -a "$BUTTON" = "lanwifi" ]; then

NEED TO ADD CONDITION
(config led 'led_status'
option name 'STATUS'
option interval '50'
option sysfs 'db120:green:status'
option default '0'
option trigger 'netdev'
option mode 'link'
option dev 'eth0' )

echo "255" >
/sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
fi

Can anyone help me to solve this.

Regards,
John


On Tue, Sep 15, 2015 at 6:38 PM, John kerry  wrote:

> Hi,
>
> I have added following condition but its not working:
>
> MYDEV='eth0'
>
> if [ "$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" ] && {
>   devstatus "$MYDEV" | grep '"up": true' && {
> echo "255" >
> /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
>   }
> }
>
> fi
>
> Am i doing any mistake or need to change anything
>
> Regards,
> John
>
> On Tue, Sep 15, 2015 at 4:07 PM, Bastian Bittorf 
> wrote:
>
>> * John kerry  [15.09.2015 08:52]:
>> > I have to write some condition in
>> > /etc/hotplug.d/button/50-wps/ file
>> >
>> > I have to configure cat /etc/hotplug.d/button/00-wps file for following
>> > condition:
>> > if [ "$BUTTON" = "BTN_2" ] && [ "$ACTION" = "pressed" ]; then
>> >
>> > I have to check eth0.1 if link is up then have ON status led otherwise
>> OFF.
>>
>> if i understand you correctly, you want this:
>>
>> MYDEV='eth0.1'
>> [ "$BUTTON" = 'BTN_2' -a "$ACTION" = 'pressed' ] && {
>>   devstatus "$MYDEV" | grep '"up": true' && {
>> your_action_here
>>   }
>> }
>>
>> but this is at least...rude. better you use the correct
>> JSON-parser like:
>>
>> . /usr/share/libubox/jshn.sh
>> json_load "$( devstatus eth0.1 )"
>> json_get_var 'JSON_VAR_up' 'up'
>> json_cleanup
>>
>> in case your dev is up you have e.g.
>> $JSON_VAR_up = 1
>>
>> bye, bastian
>>
>
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

2015-09-15 Thread Bastian Bittorf
* John kerry  [15.09.2015 13:44]:
> Hi,
> 
> I have added following condition but its not working:
> 
> MYDEV='eth0'
> 
> if [ "$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" ] && {
  remove the 'if'
>   devstatus "$MYDEV" | grep '"up": true' && {
> echo "255" >
> /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
>   }
> }
> 
> fi
  remove the 'fi'

please change the first line to e.g.
[ "$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" -a "$INTERFACE" = 'wan' ] && {

INTERFACE is the 'name' of the device, e.g. 'wan' or 'lan'
DEVICE is the real thing, e.g. eth0.1

> Am i doing any mistake or need to change anything

you can always TEST you script with e.g.

set -x
INTERFACE=bla
DEVICE=blubb
. name_of_your_script 
set +x

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


Re: [OpenWrt-Devel] i2c device not in /dev

2015-09-15 Thread Baptiste Clenet
2015-09-14 20:17 GMT+02:00 John Crispin :
>
>
> On 14/09/2015 20:09, Daniel Golle wrote:
>> On Mon, Sep 14, 2015 at 07:47:08PM +0200, John Crispin wrote:
>>> On 14/09/2015 19:28, Baptiste Clenet wrote:
 Hi,

 I'm using a MT7628 chip and I try to implement an I2C device which
 will use i2c-ralink adapter. I registered my i2c device with
 module_i2c_driver(i2c_device_driver);

 I can see it on my bus:
 ./sys/bus/i2c/drivers/i2c_device_driver
 But it doesn't appear in /dev.

 What am I doing wrong?

 Regards,

>>>
>>> you are missing CONFIG_I2C_CHARDEV in the kernel config
>>
>> or maybe i2c-dev isn't loaded? try
>> modprobe i2c-dev
>>
>
> i2c-dev is part of i2c-core if that symbol is selected. i2c-core uses
> AutoLoad and not AutoProbe so it should always load.

Thnaks for the answer.

i2c-dev and i2c-core are loaded as well as i2c-ralink and my i2c
driver. How to add CONFIG_I2C_CHARDEV? I added it in
/target/linux/ramips config file of my board but it hasn't changed
anything. How may I check that the config has really been added?

By the way, is there a similar CONFIG for SPI, like CONFIG_SPI_CHARDEV ?

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



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


[OpenWrt-Devel] [PATCH] imx6: add platform_pre_upgrade for sysupgrade

2015-09-15 Thread Rafał Miłecki
We're in process of cleaning nand_do_platform_check. Currently is leaves
a special mark in /tmp/sysupgrade-nand-path triggering some diffent code
path in nand_upgrade_stage1. This can be a bit confusing.

The plan is to have the check function only check the image and nothing
else. Then platform code (platform_pre_upgrade) should trigger NAND
specific upgrade path. This is what this patch implements.

This follows ar71xx, lantiq and partially bcm53xx.

Signed-off-by: Rafał Miłecki 
---
I'd like to push it in a month if I won't get any reply.
---
 target/linux/imx6/base-files/lib/upgrade/platform.sh | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/target/linux/imx6/base-files/lib/upgrade/platform.sh 
b/target/linux/imx6/base-files/lib/upgrade/platform.sh
index c34a47b..c48e2c9 100755
--- a/target/linux/imx6/base-files/lib/upgrade/platform.sh
+++ b/target/linux/imx6/base-files/lib/upgrade/platform.sh
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2010 OpenWrt.org
+# Copyright (C) 2010-2015 OpenWrt.org
 #
 
 . /lib/imx6.sh
@@ -17,3 +17,13 @@ platform_check_image() {
echo "Sysupgrade is not yet supported on $board."
return 1
 }
+
+platform_pre_upgrade() {
+   local board=$(imx6_board_name)
+
+   case "$board" in
+   gw54xx)
+   nand_do_upgrade "$1"
+   ;;
+   esac
+}
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ipq806x: add platform_pre_upgrade for sysupgrade

2015-09-15 Thread Rafał Miłecki
We're in process of cleaning nand_do_platform_check. Currently is leaves
a special mark in /tmp/sysupgrade-nand-path triggering some diffent code
path in nand_upgrade_stage1. This can be a bit confusing.

The plan is to have the check function only check the image and nothing
else. Then platform code (platform_pre_upgrade) should trigger NAND
specific upgrade path. This is what this patch implements.

This follows ar71xx, lantiq and partially bcm53xx.

Signed-off-by: Rafał Miłecki 
---
I'd like to push it in a month if I won't get any reply.
---
 target/linux/ipq806x/base-files/lib/upgrade/platform.sh | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index 75a01b7..c0e19a1 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -16,4 +16,15 @@ platform_check_image() {
esac
 }
 
+platform_pre_upgrade() {
+   local board=$(ipq806x_board_name)
+
+   case "$board" in
+   AP148 |\
+   r7500)
+   nand_do_upgrade "$1"
+   ;;
+   esac
+}
+
 # use default for platform_do_upgrade()
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ipq806x: add platform_pre_upgrade for sysupgrade

2015-09-15 Thread John Crispin


On 15/09/2015 14:18, Rafał Miłecki wrote:
> We're in process of cleaning nand_do_platform_check. Currently is leaves
> a special mark in /tmp/sysupgrade-nand-path triggering some diffent code
> path in nand_upgrade_stage1. This can be a bit confusing.
> 
> The plan is to have the check function only check the image and nothing
> else. Then platform code (platform_pre_upgrade) should trigger NAND
> specific upgrade path. This is what this patch implements.
> 
> This follows ar71xx, lantiq and partially bcm53xx.
> 
> Signed-off-by: Rafał Miłecki 

Ack, looks good

> ---
> I'd like to push it in a month if I won't get any reply.
> ---
>  target/linux/ipq806x/base-files/lib/upgrade/platform.sh | 11 +++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh 
> b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> index 75a01b7..c0e19a1 100644
> --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
> @@ -16,4 +16,15 @@ platform_check_image() {
>   esac
>  }
>  
> +platform_pre_upgrade() {
> + local board=$(ipq806x_board_name)
> +
> + case "$board" in
> + AP148 |\
> + r7500)
> + nand_do_upgrade "$1"
> + ;;
> + esac
> +}
> +
>  # use default for platform_do_upgrade()
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] OpenWRT www version banner a security risk

2015-09-15 Thread Sami Olmari
Mine vote for generally _not do anything_, Defaults are safe as pointed out
here few times... We can not start to babysit users from themselves... We
can guide, we can help and so on, but it's still end user responsibility
when opening port(s) to WAN, or securing access in a big LAN/VPN/VLAN/etc
-enviroment, we can't start pampering them...

 Sami Olmari

On Mon, Sep 14, 2015 at 6:30 PM, Joshua Judson Rosen 
wrote:

> On 2015-09-13 10:21, MauritsVB wrote:
> > At the moment the OpenWRT www login screen provides *very* detailed
> version information before anyone has even entered a password. It displays
> not just “15.05” or “Chaos Calmer” but even the exact git version on the
> banner.
> >
> > While it’s not advised to open this login screen to the world, fact is
> that it does happen intentionally or accidentally. Just a Google search for
> “Powered by LuCI Master (git-“ will provide many accessible OpenWRT login
> screens, including exact version information.
> >
> > As soon as someone discovers a vulnerability in a OpenWRT version all an
> attacker needs to do is perform a Google search to find many installations
> with versions that are vulnerable (even if a patch is already available).
> >
> > In the interest of hardening the default OpenWRT install, can I suggest
> that by default OpenWRT doesn’t disclose the version (not even 15.05 or
> “Chaos Calmer”) on the login screen? For extra safety I would even suggest
> to leave “OpenWRT” off the login screen, the only people who should use
> this screen already know it’s running OpenWRT.
> >
> > Any thoughts?
>
> I think you'd also need to change a number of services to stop
> reporting detailed information in their protocol.
>
> For example: have you noticed that the ETag and Last-Modified
> values that uhttpd returns for a given path are identical
> across all installations of a given version of OpenWrt?
> It doesn't really matter if there's an OpenWrt version-number
> in the *content* fetched over HTTP--the client has already
> got that information before they even get the content.
>
> Another example: the version-info exchanged at the start
> of the SSH protocol.
>
> It's like deciding that you want to send an anonymous letter
> and so avoid signing your name on that letter, but still putting
> your name and return address on the outside of the envelope.
>
> --
> "Don't be afraid to ask (λf.((λx.xx) (λr.f(rr."
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] ralink: RX buffer length setting in ralink_soc_eth.c

2015-09-15 Thread Sven Eckelmann
Hi,

I am currently searching for the reason that MT7621a doesn't want to
receive 1526 byte large ethernet frames (1500 mtu, 14 eth hdr, 4 byte
outer vlan hdr, 4 byte inner vlan hdr, 4 byte fcs).

One thing I found during my search was the odd looking way the PDMA Rx
descriptors were written.

if (priv->flags & FE_FLAG_RX_SG_DMA)
ring->rx_dma[i].rxd2 = RX_DMA_PLEN0(ring->rx_buf_size);
else
ring->rx_dma[i].rxd2 = RX_DMA_LSO;

This assigment with RX_DMA_PLEN0 happens in two places. And here comes
the problem:

#define RX_DMA_PLEN0(_x)(((_x) >> 16) & 0x3fff)

The rx_buf_size length should be something like 1536. And so this macro
always calculates as result a nice "0" (1536 / 65536 -> 0). I would
guess that the actual macro should be:

#define RX_DMA_PLEN0(_x)(((_x) & 0x3fff) << 16)


There is one other place (beside the two previously mentioned ones)
where it is used - but this time to read the received bytes:

pktlen = RX_DMA_PLEN0(trxd.rxd2);

If it is read from the the same place then there should be a second
macro which then could be used here:

 #define RX_DMA_PLEN0_GET(_x)   (((_x) >> 16) & 0x3fff)

 pktlen = RX_DMA_PLEN0_GET(trxd.rxd2);

It did not solve my problem but maybe is a different problem which
may causes other interesting things (or maybe I am completely wrong).

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


Re: [OpenWrt-Devel] [PATCH procd] move /dev/shm to /tmp/shm

2015-09-15 Thread Daniel Gimpelevich
I see procd got an update. Any reason this patch was left out?

On Fri, 2015-09-11 at 13:05 -0700, Daniel Gimpelevich wrote:
> Is there an ETA for merging this?
> 
> On Sun, 2015-07-19 at 19:14 -0700, Daniel Gimpelevich wrote:
> > I'm intending for this fix to be backported to CC as well.
> > 
> > On Tue, 2015-07-14 at 09:59 -0700, Daniel Gimpelevich wrote:
> > > OpenSSL session caches create shared memory segments that appear as
> > > files under /dev/shm. If there is not enough room there, execution
> > > terminates with SIGBUS upon access. Even a single instance would
> > > exceed
> > > 512K.
> > > 
> > > On Tue, 2015-07-14 at 11:50 +0200, John Crispin wrote:
> > > > what kind of usage do you expect ?
> > > > 
> > > > On 11/07/2015 03:58, Daniel Gimpelevich wrote:
> > > > > Since the /dev filesystem is tiny, /dev/shm needs to live
> > > somewhere
> > > > > else.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] i2c device not in /dev

2015-09-15 Thread Baptiste Clenet
2015-09-15 13:57 GMT+02:00 Baptiste Clenet :
> 2015-09-14 20:17 GMT+02:00 John Crispin :
>>
>>
>> On 14/09/2015 20:09, Daniel Golle wrote:
>>> On Mon, Sep 14, 2015 at 07:47:08PM +0200, John Crispin wrote:
 On 14/09/2015 19:28, Baptiste Clenet wrote:
> Hi,
>
> I'm using a MT7628 chip and I try to implement an I2C device which
> will use i2c-ralink adapter. I registered my i2c device with
> module_i2c_driver(i2c_device_driver);
>
> I can see it on my bus:
> ./sys/bus/i2c/drivers/i2c_device_driver
> But it doesn't appear in /dev.
>
> What am I doing wrong?
>
> Regards,
>

 you are missing CONFIG_I2C_CHARDEV in the kernel config
>>>
>>> or maybe i2c-dev isn't loaded? try
>>> modprobe i2c-dev
>>>
>>
>> i2c-dev is part of i2c-core if that symbol is selected. i2c-core uses
>> AutoLoad and not AutoProbe so it should always load.
>
> Thnaks for the answer.
>
> i2c-dev and i2c-core are loaded as well as i2c-ralink and my i2c
> driver. How to add CONFIG_I2C_CHARDEV? I added it in
> /target/linux/ramips config file of my board but it hasn't changed
> anything. How may I check that the config has really been added?
>
> By the way, is there a similar CONFIG for SPI, like CONFIG_SPI_CHARDEV ?
>
>>
>> John
>> ___
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
>
>
> --
> Baptiste


Actually, here is my configuration:
I've got my driver in /sys/bus/i2c/drivers
Nothing in /sys/bus/i2c/devices
Nothing in /sys/class/i2c-dev as well.

Concerning CONFIG_I2C_CHARDEV, it seems that it is automatically added
with i2c-core so it should be compiled in my distrib. (Do you know how
I can check?)

Cheers,


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


[OpenWrt-Devel] [PATCH 1/2] oxnas: drop some unused sysupgrade code

2015-09-15 Thread Rafał Miłecki
First of all platform_do_upgrade_phase2 doesn't seem to be defined
anywhere. Other than that platform_do_upgrade is not likely to be ever
called. There is a call to nand_do_platform_check which triggers
nand_upgrade_stage1 call with "exit 0" in it.

Signed-off-by: Rafał Miłecki 
---
 target/linux/oxnas/base-files/lib/upgrade/platform.sh | 9 -
 1 file changed, 9 deletions(-)

diff --git a/target/linux/oxnas/base-files/lib/upgrade/platform.sh 
b/target/linux/oxnas/base-files/lib/upgrade/platform.sh
index 8591c7d..a43391c 100644
--- a/target/linux/oxnas/base-files/lib/upgrade/platform.sh
+++ b/target/linux/oxnas/base-files/lib/upgrade/platform.sh
@@ -15,15 +15,6 @@ platform_check_image() {
return $?
 }
 
-platform_do_upgrade() {
-   if [ $$ -ne 1 ]; then
-   echo "not PID 1, upgrade aborted."
-   return 1;
-   fi
-   platform_do_upgrade_phase2 "$1" "$CONF_TAR" "$SAVE_CONFIG"
-}
-
-
 disable_watchdog() {
killall watchdog
( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] oxnas: add platform_pre_upgrade for sysupgrade

2015-09-15 Thread Rafał Miłecki
We're in process of cleaning nand_do_platform_check. Currently is leaves
a special mark in /tmp/sysupgrade-nand-path triggering some diffent code
path in nand_upgrade_stage1. This can be a bit confusing.

The plan is to have the check function only check the image and nothing
else. Then platform code (platform_pre_upgrade) should trigger NAND
specific upgrade path. This is what this patch implements.

This follows all other targets making it finally possible to change
nand_do_platform_check.

Signed-off-by: Rafał Miłecki 
---
 target/linux/oxnas/base-files/lib/upgrade/platform.sh | 4 
 1 file changed, 4 insertions(+)

diff --git a/target/linux/oxnas/base-files/lib/upgrade/platform.sh 
b/target/linux/oxnas/base-files/lib/upgrade/platform.sh
index a43391c..006dd0d 100644
--- a/target/linux/oxnas/base-files/lib/upgrade/platform.sh
+++ b/target/linux/oxnas/base-files/lib/upgrade/platform.sh
@@ -15,6 +15,10 @@ platform_check_image() {
return $?
 }
 
+platform_pre_upgrade() {
+   nand_do_upgrade $1
+}
+
 disable_watchdog() {
killall watchdog
( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
-- 
1.8.4.5
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] ar71xx: fix ar724x clock calculation

2015-09-15 Thread Alban
On Wed,  9 Sep 2015 11:19:31 +0800
Weijie Gao  wrote:

Hi,

I'm working a bit on mainline support for the ATH79 and I would really
like to see such patch making it there. I added this patch to my
tree[1] with a few fixes to the log message. Would you mind submitting
it to mainline?

> Signed-off-by: Weijie Gao 

Signed-off-by should be after the log message.
 
> According to the AR7242 datasheet section 2.8, AR724X CPUs use a 40MHz
> input clock as the REF_CLK instead of 5MHz.

I have a similar problem on AR9132, the board I use (WR1043ND) have a
40MHz oscillator however the computation for the clocks assume a 5MHz
input. Sadly I have no datasheet for the AR9132 so I can't fix the
problem myself :/

> The correct CPU PLL calculation procedure is as follows:
> CPU_PLL = (DIV * REF_CLK) / REF_DIV / 2.

In the patch in my tree I replaced DIV with FB (for feedback i think,
see [2]) as it then match with the register name used in the patch.

Alban

[1] https://github.com/AlbanBedel/linux/tree/ath79
[2] 
https://en.wikipedia.org/wiki/Phase-locked_loop#Feedback_path_and_optional_divider
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Project specific settings

2015-09-15 Thread Rüdiger , Christoph
Hello,

I'm quite new to OpenWrt and being faced with an existing build tree here. 
After reading nearly everything I could force Google to bubble it up to the top 
result pages, I'm still struggling with a simple question.

Our build tree is full of custom patches to different packages, mainly in the 
openwrt/package directory. This makes it close to impossible to update the 
repository to a new OpenWrt version without producing a good bunch of merge 
conflicts. Besides that, there is our custom feed with additional packages, 
mainly with custom built software.

What I understood so far is, that you can bring in new packages with feeds. But 
how can I move our changes to the core packages in openwrt/package apart into a 
per-project structure to keep the openwrt/package folder clean for updates?

I've worked in the past with ptxdist, where you have a base build system (the 
ptxdist distribution) with a package repository where you can select packages 
from. On top of this, you have per project its own directory, containing the 
project specific build configuration and the project specific packages plus a 
project specific rootfs overlay. This makes it very easy: Just put a file in 
the project specific rootfs and this one makes it into the images instead of 
the default one. Just put a package into the project specific package directory 
and this one gets build instead of the default one.

Can someone please help me to find the proper places in OpenWrt to store the 
per-project settings? Especially the per-project Makefiles (mostly, we are 
influencing the build process or the package creation process).

Thank you very much.

Best regards,
Christoph


-- 
ThyssenKrupp Elevator Innovation GmbH
PDC Neuhausen
TKEI Elevator Control
Bernhaeuser Straße 45
73765 Neuhausen, Germany

Phone +49 7158 12-2615
christoph.ruedi...@thyssenkrupp.com

Company domicile: Essen  Commercial register: Essen HRB 20 839
Postal address: ThyssenKrupp Allee 1, 45143 Essen, Germany 
Executive Board: Gerhard Thumm, Katrin Huenger, Philippe Choleau


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


Re: [OpenWrt-Devel] Project specific settings

2015-09-15 Thread John Crispin


On 15/09/2015 20:32, Rüdiger, Christoph wrote:
> Hello,
> 
> I'm quite new to OpenWrt and being faced with an existing build tree here. 
> After reading nearly everything I could force Google to bubble it up to the 
> top result pages, I'm still struggling with a simple question.
> 
> Our build tree is full of custom patches to different packages, mainly in the 
> openwrt/package directory. This makes it close to impossible to update the 
> repository to a new OpenWrt version without producing a good bunch of merge 
> conflicts. Besides that, there is our custom feed with additional packages, 
> mainly with custom built software.
> 
> What I understood so far is, that you can bring in new packages with feeds. 
> But how can I move our changes to the core packages in openwrt/package apart 
> into a per-project structure to keep the openwrt/package folder clean for 
> updates?
> 
> I've worked in the past with ptxdist, where you have a base build system (the 
> ptxdist distribution) with a package repository where you can select packages 
> from. On top of this, you have per project its own directory, containing the 
> project specific build configuration and the project specific packages plus a 
> project specific rootfs overlay. This makes it very easy: Just put a file in 
> the project specific rootfs and this one makes it into the images instead of 
> the default one. Just put a package into the project specific package 
> directory and this one gets build instead of the default one.
> 
> Can someone please help me to find the proper places in OpenWrt to store the 
> per-project settings? Especially the per-project Makefiles (mostly, we are 
> influencing the build process or the package creation process).
> 
> Thank you very much.
> 
> Best regards,
> Christoph
> 
> 

Hi,

what kind of changes are we talking about ? just config file stuff or
big changes to how stuff is built and installed ?

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


Re: [OpenWrt-Devel] Project specific settings

2015-09-15 Thread Rüdiger , Christoph
> what kind of changes are we talking about ? just config file stuff or
> big changes to how stuff is built and installed ?

>From what I've seen so far, it is about half in the package Makefiles, so how 
>stuff is built and installed. The other half is shared between changes in the 
>code and changes in the package's conf files (what is placed in /etc).

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


[OpenWrt-Devel] [PATCH] include: download.mk: If checkouts fail, attempt default download method

2015-09-15 Thread Pushpal Sidhu
This will allow a more robust download system, especially in cases when
building an older release where a source checkout system is gone.

Signed-off-by: Pushpal Sidhu 
---
 include/download.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/download.mk b/include/download.mk
index adaa2e6..eb86faf 100644
--- a/include/download.mk
+++ b/include/download.mk
@@ -46,7 +46,7 @@ define DownloadMethod/default
 endef
 
 define wrap_mirror
-   $(if $(if $(MIRROR),$(filter-out 
x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" 
"$(MIRROR_MD5SUM)" || ( $(1) ),$(1))
+   $(if $(if $(MIRROR),$(filter-out 
x,$(MIRROR_MD5SUM))),@$(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(FILE)" 
"$(MIRROR_MD5SUM)" || ( $(1) ), ( $(1) ) || $(DownloadMethod/default))
 endef
 
 define DownloadMethod/cvs
-- 
2.5.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 0/9] Support for three PowerCloud Systems devices

2015-09-15 Thread John Crispin


On 02/09/2015 12:08, Daniel Dickinson wrote:
> The following patch series adds support for three PowerCloud devices.
> The patches have been reworked from the previous bunged up iteration
> and have been tested on the actual devices which are currently in use.
> 
> There is, however, one question on the CR3000 which I had to redo
> from scratch (and it's been quite some time since I did board support
> stuff) and that is whether to get gigibit speeds on the LAN switch
> there is some setting that is needed (currently the switch detects as
> gigabit however link speed only detects as 100Mbit, but I'm not sure
> if the issue is hardware or board support definition).
> 
> Regards,
> 
> Daniel
> 
> Daniel Dickinson (9):
>   ar71xx: PowerCloud CAP324 kernel support
>   ar71xx: PowerCloud CAP324 image generation
>   ar71xx: PowerCloud CAP324 OpenWrt configuration
>   ar71xx: PowerCloud CR3000 kernel support
>   ar71xx: PowerCloud CR3000 image generation
>   ar71xx: PowerCloud CR3000 OpenWrt configuration
>   ar71xx: PowerCloud CR5000 kernel support
>   ar71xx: PowerCloud CR5000 image generation
>   ar71xx: PowerCloud CR5000 openwrt configuration
> 
>  package/boot/uboot-envtools/files/ar71xx   |   3 +
>  target/linux/ar71xx/base-files/etc/diag.sh |   9 +
>  .../ar71xx/base-files/etc/uci-defaults/01_leds |  20 ++
>  .../ar71xx/base-files/etc/uci-defaults/02_network  |   8 +
>  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   9 +
>  .../ar71xx/base-files/lib/upgrade/platform.sh  |   5 +-
>  target/linux/ar71xx/config-4.1 |   3 +
>  target/linux/ar71xx/generic/profiles/pcs.mk| 118 +++
>  target/linux/ar71xx/image/Makefile |  12 ++
>  target/linux/ar71xx/mikrotik/config-default|   3 +
>  target/linux/ar71xx/nand/config-default|   3 +
>  ...-MIPS-ath79-add-powercloud-cap324-support.patch | 175 
>  ...-MIPS-ath79-add-powercloud-cr3000-support.patch | 201 +++
>  ...-MIPS-ath79-add-powercloud-cr5000-support.patch | 219 
> +
>  14 files changed, 787 insertions(+), 1 deletion(-)
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/815-MIPS-ath79-add-powercloud-cap324-support.patch
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/816-MIPS-ath79-add-powercloud-cr3000-support.patch
>  create mode 100644 
> target/linux/ar71xx/patches-4.1/817-MIPS-ath79-add-powercloud-cr5000-support.patch
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 

Hi,

patches dont apply anymore i am afraid. you wanted to resend anyhow with
the new FW building pattern added. i marked them as "Changes requested"
in patchwork. looking fwd to the next version

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


Re: [OpenWrt-Devel] [PATCH v2] ar71xx: Add UBNT airGateway Pro support

2015-09-15 Thread John Crispin
Hi

On 21/08/2015 09:27, Matthew Reeve wrote:
> This patch adds kernel and userspace support for the Ubiquiti Networks 
> airGateway Pro.
> 
> v2: Modify file bases so that git apply will apply it.

the change log should go below the tear line

> Signed-off-by: Matthew Reeve 
> 

which should be here but is missing. i manually fixed this while merging
the patch

John

> --- /dev/null 2015-08-07 21:02:55.557188068 -0600
> +++ 
> b/target/linux/ar71xx/patches-4.1/610-MIPS-ath79-UBNT-add-airGateway-pro-support.patch
> 2015-08-20 17:20:09.149209987 -0600
> @@ -0,0 +1,62 @@ 
> +--- a/arch/mips/ath79/mach-ubnt-xm.c 2015-08-19 21:26:47.694157530 -0600
>  b/arch/mips/ath79/mach-ubnt-xm.c 2015-08-20 16:24:06.908537535 -0600
> +@@ -642,3 +642,59 @@ static void __init ubnt_airgateway_setup
> + MIPS_MACHINE(ATH79_MACH_UBNT_AIRGW, "UBNT-AGW", "Ubiquiti AirGateway",
> +  ubnt_airgateway_setup);
> + 
> ++static struct gpio_led ubnt_airgateway_pro_gpio_leds[] __initdata = {
> ++{
> ++.name  = "ubnt:blue:wlan",
> ++.gpio  = 13,
> ++}, {
> ++.name  = "ubnt:white:status",
> ++.gpio  = 17,
> ++},
> ++};
> ++
> ++
> ++static struct gpio_keys_button airgateway_pro_gpio_keys[] __initdata = {
> ++{
> ++.desc   = "reset",
> ++.type   = EV_KEY,
> ++.code   = KEY_RESTART,
> ++.debounce_interval  = UBNT_XM_KEYS_DEBOUNCE_INTERVAL,
> ++.gpio   = 12,
> ++.active_low = 1,
> ++}
> ++};
> ++
> ++static void __init ubnt_airgateway_pro_setup(void)
> ++{
> ++u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff);
> ++u8 *mac0 = (u8 *) KSEG1ADDR(0x1fff);
> ++
> ++ath79_register_m25p80(NULL);
> ++ath79_register_leds_gpio(-1, ARRAY_SIZE(ubnt_airgateway_pro_gpio_leds),
> ++ ubnt_airgateway_pro_gpio_leds);
> ++
> ++ath79_register_gpio_keys_polled(-1, UBNT_XM_KEYS_POLL_INTERVAL,
> ++ARRAY_SIZE(airgateway_pro_gpio_keys),
> ++airgateway_pro_gpio_keys);
> ++
> ++ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
> ++ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
> ++
> ++
> ++ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
> ++
> ++ath79_register_mdio(1, 0x0);
> ++
> ++/* GMAC0 is left unused in this configuration */
> ++
> ++/* GMAC1 is connected to MAC0 on the internal switch */
> ++/* The PoE/WAN port connects to port 5 on the internal switch */
> ++/* The LAN port connects to port 4 on the internal switch */
> ++ath79_init_mac(ath79_eth1_data.mac_addr, mac0, 0);
> ++ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
> ++ath79_register_eth(1);
> ++
> ++}
> ++
> ++MIPS_MACHINE(ATH79_MACH_UBNT_AIRGWP, "UBNT-AGWP", "Ubiquiti AirGateway Pro",
> ++ ubnt_airgateway_pro_setup);
> --- a/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch   
> 2015-08-19 21:57:36.415324864 -0600
> +++ b/target/linux/ar71xx/patches-4.1/700-MIPS-ath79-openwrt-machines.patch   
> 2015-08-20 17:36:24.402046004 -0600
> @@ -1,6 +1,6 @@ 
>  --- a/arch/mips/ath79/machtypes.h
>  +++ b/arch/mips/ath79/machtypes.h
> -@@ -16,24 +16,207 @@
> +@@ -16,24 +16,208 @@
>   
>   enum ath79_mach_type {
>   ATH79_MACH_GENERIC = 0,
> @@ -159,6 +159,7 @@ 
>  +ATH79_MACH_TL_WR941ND_V5,   /* TP-LINK TL-WR941ND v5 */
>  +ATH79_MACH_TUBE2H,  /* Alfa Network Tube2H */
>  +ATH79_MACH_UBNT_AIRGW,  /* Ubiquiti AirGateway */
> ++ATH79_MACH_UBNT_AIRGWP, /* Ubiquiti AirGateway Pro */
>   ATH79_MACH_UBNT_AIRROUTER,  /* Ubiquiti AirRouter */
>   ATH79_MACH_UBNT_BULLET_M,   /* Ubiquiti Bullet M */
>  +ATH79_MACH_UBNT_LOCO_M_XW,  /* Ubiquiti Loco M XW */
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh2015-08-19 
> 22:04:31.601383634 -0600
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh2015-08-20 
> 17:21:07.789500768 -0600
> @@ -326,6 +326,9 @@  ar71xx_board_detect() {
>   *"AirGateway")
>   name="airgateway"
>   ;;
> + *"AirGateway Pro")
> + name="airgatewaypro"
> + ;;
>   *"AirRouter")
>   name="airrouter"
>   ;;
> --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh  2015-08-19 
> 22:06:58.438111803 -0600
> +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh  2015-08-20 
> 17:21:21.997571222 -0600
> @@ -226,6 +226,7 @@  platform_check_image() {
>   tew-732br | \
>   wrt400n | \
>   airgateway | \
> + airgatewaypro | \
>   airrouter | \
>   bullet-m | \
>   loco-m-xw | \
> --- a/target/linux/ar71xx/image/Makefile  2015-08-19 22:07:52.094377841 
> -0600
> +++ b/target/linux/ar71xx/image/Makefile  2015-08-20 17:22:34.965933053 
> -0600
> @@ -840,6 +840,15

[OpenWrt-Devel] [PATCH] imx6: fix platform checking

2015-09-15 Thread Pushpal Sidhu
Fix platform checking when configuring networks and when doing sysupgrade.

Signed-off-by: Pushpal Sidhu 
---
 target/linux/imx6/base-files/etc/uci-defaults/02_network | 12 ++--
 target/linux/imx6/base-files/lib/upgrade/platform.sh |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/linux/imx6/base-files/etc/uci-defaults/02_network 
b/target/linux/imx6/base-files/etc/uci-defaults/02_network
index 0e60e22..bf83063 100644
--- a/target/linux/imx6/base-files/etc/uci-defaults/02_network
+++ b/target/linux/imx6/base-files/etc/uci-defaults/02_network
@@ -15,16 +15,16 @@ board=$(imx6_board_name)
 ucidef_set_interface_loopback
 
 case "$board" in
-"gw51xx" |\
-"gw52xx")
+*gw51xx |\
+*gw52xx)
ucidef_set_interface_lan 'eth0'
;;
-"gw53xx" |\
-"gw54xx" |\
-"gw552x")
+*gw53xx |\
+*gw54xx |\
+*gw552x)
ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
;;
-"wandboard")
+*wandboard)
ucidef_set_interface_wan 'eth0'
;;
 esac
diff --git a/target/linux/imx6/base-files/lib/upgrade/platform.sh 
b/target/linux/imx6/base-files/lib/upgrade/platform.sh
index c48e2c9..0bbf110 100755
--- a/target/linux/imx6/base-files/lib/upgrade/platform.sh
+++ b/target/linux/imx6/base-files/lib/upgrade/platform.sh
@@ -8,7 +8,7 @@ platform_check_image() {
local board=$(imx6_board_name)
 
case "$board" in
-   gw54xx)
+   *gw5*)
nand_do_platform_check $board $1
return $?;
;;
@@ -22,7 +22,7 @@ platform_pre_upgrade() {
local board=$(imx6_board_name)
 
case "$board" in
-   gw54xx)
+   *gw5*)
nand_do_upgrade "$1"
;;
esac
-- 
2.5.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] uboot-envtools: Add Gateworks Ventana Support

2015-09-15 Thread Pushpal Sidhu
Signed-off-by: Tim Harvey 
Signed-off-by: Pushpal Sidhu 
---
 package/boot/uboot-envtools/files/imx6 | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/package/boot/uboot-envtools/files/imx6 
b/package/boot/uboot-envtools/files/imx6
index fac6436..d7412b2 100644
--- a/package/boot/uboot-envtools/files/imx6
+++ b/package/boot/uboot-envtools/files/imx6
@@ -14,6 +14,17 @@ touch /etc/config/ubootenv
 board=$(imx6_board_name)
 
 case "$board" in
+*gw5*)
+   if [ -c /dev/mtd1 ]; then
+   # board boots from NAND
+   ubootenv_add_uci_config /dev/mtd1 0x0 0x2 0x4
+   ubootenv_add_uci_config /dev/mtd1 0x8 0x2 0x4
+   else
+   # board boots from microSD
+   ubootenv_add_uci_config /dev/mmcblk0 0xb1400 0x2 0x2
+   ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x2 0x2
+   fi
+   ;;
 "wandboard")
ubootenv_add_uci_config "/dev/mmcblk0" "0x6" "0x2000" "0x2000"
;;
-- 
2.5.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Questions about "binutils: add binutils 2.25.1"

2015-09-15 Thread Hauke Mehrtens
On 09/14/2015 02:24 PM, Alexey Brodkin wrote:
> Hi Hauke,
> 
> I noticed your change made in "toolchain/binutils" recently:
> ->8-
> http://git.openwrt.org/?p=openwrt.git;a=commit;h=fece50d94033c1dcfc3f290acbd428f9125c30aa
> 
> binutils: add binutils 2.25.1
> 
> This adds binutils 2.25.1 as an option to OpenWrt.
> 
> Signed-off-by: Hauke Mehrtens 
> 
> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46874 
> 3c298f89-4303-0410-b956-a3cf2f4a3e73
> ->8-
> 
> First of all I cannot find that patch in neither OpenWRT mailing list
> (I mean openwrt-devel@lists.openwrt.org) nor in OpenWRT patchwork.
> 
> Did I overlook something?

I was not on the mailing list, I created the patch directly and
committed it.

> But my real question was in "toolchain/binutils/Config.in" you added
> the following:
> ->8-
>config BINUTILS_VERSION_2_25_1
>bool "Linaro binutils 2.25.1" <-- note "Linaro" word
> ->8-
> 
> But in all other places I see there's no mention of "Linaro" for that
> 2.25.1 version.
> 
> In fact PKG_SOURCE_URL:=@GNU/binutils/ for it so it looks like this is
> pristine binutils with no Linaro changes.
> 
> So probably description of BINUTILS_VERSION_2_25_1 should be changed.

Thanks for the report, the description was wrong, I committed a fixed
description in r46946.

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


Re: [OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

2015-09-15 Thread John kerry
Hi,

I have changed the script as below:

MYDEV='eth0.2'

 ["$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" -a "INTERFACE" = 'wan'] &&
   {
devstatus "$MYDEV" | grep '"up": true' &&
   {
echo "255" >
/sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
}
}


but its not working.

What mistake i am doing.

Could you please correct it me.

Regards,
John

On Tue, Sep 15, 2015 at 7:51 PM, Bastian Bittorf 
wrote:

> * John kerry  [15.09.2015 13:44]:
> > Hi,
> >
> > I have added following condition but its not working:
> >
> > MYDEV='eth0'
> >
> > if [ "$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" ] && {
>   remove the 'if'
> >   devstatus "$MYDEV" | grep '"up": true' && {
> > echo "255" >
> > /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
> >   }
> > }
> >
> > fi
>   remove the 'fi'
>
> please change the first line to e.g.
> [ "$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" -a "$INTERFACE" = 'wan' ]
> && {
>
> INTERFACE is the 'name' of the device, e.g. 'wan' or 'lan'
> DEVICE is the real thing, e.g. eth0.1
>
> > Am i doing any mistake or need to change anything
>
> you can always TEST you script with e.g.
>
> set -x
> INTERFACE=bla
> DEVICE=blubb
> . name_of_your_script
> set +x
>
> bye, bastian
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

2015-09-15 Thread John kerry
Hi,

I have tried script:









*["$ACTION" = "pressed" -a "$BUTTON" = "BUT_2"] && {   ["${ACTION}" =
"ifup" -a "${INTERFACE}" = "wan"] && {echo "" > /dev/console
echo "SWITCH TO RJ45" > /dev/consoleecho "255" >
/sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
} &  }*



*but still no luck :(*
Could anyone please figure out what mistakes i am doing.

Regards,
John

On Wed, Sep 16, 2015 at 9:12 AM, John kerry  wrote:

> Hi,
>
> I have changed the script as below:
>
> MYDEV='eth0.2'
>
>  ["$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" -a "INTERFACE" = 'wan'] &&
>{
> devstatus "$MYDEV" | grep '"up": true' &&
>{
> echo "255" >
> /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
> }
> }
>
>
> but its not working.
>
> What mistake i am doing.
>
> Could you please correct it me.
>
> Regards,
> John
>
> On Tue, Sep 15, 2015 at 7:51 PM, Bastian Bittorf 
> wrote:
>
>> * John kerry  [15.09.2015 13:44]:
>> > Hi,
>> >
>> > I have added following condition but its not working:
>> >
>> > MYDEV='eth0'
>> >
>> > if [ "$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" ] && {
>>   remove the 'if'
>> >   devstatus "$MYDEV" | grep '"up": true' && {
>> > echo "255" >
>> > /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
>> >   }
>> > }
>> >
>> > fi
>>   remove the 'fi'
>>
>> please change the first line to e.g.
>> [ "$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" -a "$INTERFACE" = 'wan' ]
>> && {
>>
>> INTERFACE is the 'name' of the device, e.g. 'wan' or 'lan'
>> DEVICE is the real thing, e.g. eth0.1
>>
>> > Am i doing any mistake or need to change anything
>>
>> you can always TEST you script with e.g.
>>
>> set -x
>> INTERFACE=bla
>> DEVICE=blubb
>> . name_of_your_script
>> set +x
>>
>> bye, bastian
>>
>
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] AR9344 OpenWRT LED Handling

2015-09-15 Thread Afkar Rafique
Hi Everyone,

I have configured the /etc/config/system file as below:

config led 'led_status'
option name 'STATUS'
option interval '50'
option sysfs 'db120:green:status'
option default '0'
option trigger 'netdev'
option mode 'link'
option dev 'eth0.2'

so It is working fine whenever i connect eth0.2 is UP ON the Status LED and
OFF the LED in case of  eth0.2 is down.

I need to add one more condition before checking eth0.2 UP/DOWN to handle
the Status LED.

I need to check whether "$ACTION" = "pressed" -a "$BUTTON" = "BUT_1" is
pressed or not, then will check eth0.2 UP/down.

If BUT_1 pressed and eth0.2 up --> Status LED ON otherwise OFF.

Could anyone tell how i can add Button condition in /etc/config/system file.

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


Re: [OpenWrt-Devel] OpenWrt /etc/hotplug.d/button/00-wps

2015-09-15 Thread Bastian Bittorf
* John kerry  [16.09.2015 08:10]:
> Hi,
> 
> I have changed the script as below:
> 
> MYDEV='eth0.2'
> 
>  ["$ACTION" = "pressed" -a "$BUTTON" = "BUT_2" -a "INTERFACE" = 'wan'] &&
   ^^^ a space here, so [ "$ACTION" - the same at the end: 'wan' ]
use "$INTERFACE" with the '$'

please learn shell-scripting. maybe it's an good idea to use a static
checker like http://www.shellcheck.net/

>{
> devstatus "$MYDEV" | grep '"up": true' &&
>{
> echo "255" >
> /sys/devices/platform/leds-gpio/leds/db120:green:status/brightness
> }
> }
> 
> 
> but its not working.
> 
> What mistake i am doing.

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