Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-23 Thread Bastian Bittorf
 not possible to get more resolution than 1 second, at least with
 the 
 date command. I'd like to know if there's a way to get a resolution

you can start with 'date +%s'
the tic() toc() approach is nice, here is what
we do to measure exact time between 2 events:

read t1 trash /proc/uptime
do_something()
read t2 trash /proc/uptime
duration=$(( ${t2//./} - ${t1//./} ))
logger -s lasts $(( $duration / 100 )).$(( $duration % 100 )) sec

which outputs something like:
lasts 7.64 sec

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


[OpenWrt-Devel] [PATCH] kmod-batman-adv: Use current /lib/functions/network.sh in hotplug.d scripts

2012-11-23 Thread Gui Iribarren
In legacy ubnt2 devices, when trying to bring 3 VAPs, one in adhoc
mode managed with batman-adv, a race condition occurs and /var/state
doesn't get the .ifname updated quickly enough at boot time. Using
(the newer) ubus call infrastructure overcomes the race condition.

Signed-off-by: Gui Iribarren g...@altermundi.net
---

~/openwrt/trunk/feeds/packages$ svn diff net/batman-adv
Index: net/batman-adv/files/lib/batman-adv/config.sh
===
--- net/batman-adv/files/lib/batman-adv/config.sh   (revision 34303)
+++ net/batman-adv/files/lib/batman-adv/config.sh   (working copy)
@@ -44,6 +44,8 @@

 bat_add_interface()
 {
+   . /lib/functions/network.sh
+
local mesh=$1
local interface=$2
local interfaces
@@ -52,7 +54,7 @@
config_get interfaces $mesh interfaces
for iface in $interfaces; do
[ -f /sys/class/net/$iface/batman_adv/mesh_iface ] || {
-   iface=$(uci -q -P/var/state get network.$iface.ifname)
+   network_get_physdev iface $iface
[ -f
/sys/class/net/$iface/batman_adv/mesh_iface ] || continue
}

@@ -62,6 +64,8 @@

 bat_del_interface()
 {
+   . /lib/functions/network.sh
+
local mesh=$1
local interface=$2
local interfaces
@@ -69,7 +73,7 @@
config_get interfaces $mesh interfaces
for iface in $interfaces; do
[ -f /sys/class/net/$iface/batman_adv/mesh_iface ] || {
-   iface=$(uci -q -P/var/state get network.$iface.ifname)
+   network_get_physdev iface $iface
[ -f
/sys/class/net/$iface/batman_adv/mesh_iface ] || continue
}
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] kmod-batman-adv: Use current /lib/functions/network.sh in hotplug.d scripts

2012-11-23 Thread Jonh Wendell
hi. why did you include that file twice? is there any reason to not do a
single include in the beginning of the the script?


2012/11/23 Gui Iribarren g...@altermundi.net

 In legacy ubnt2 devices, when trying to bring 3 VAPs, one in adhoc
 mode managed with batman-adv, a race condition occurs and /var/state
 doesn't get the .ifname updated quickly enough at boot time. Using
 (the newer) ubus call infrastructure overcomes the race condition.

 Signed-off-by: Gui Iribarren g...@altermundi.net
 ---

 ~/openwrt/trunk/feeds/packages$ svn diff net/batman-adv
 Index: net/batman-adv/files/lib/batman-adv/config.sh
 ===
 --- net/batman-adv/files/lib/batman-adv/config.sh   (revision 34303)
 +++ net/batman-adv/files/lib/batman-adv/config.sh   (working copy)
 @@ -44,6 +44,8 @@

  bat_add_interface()
  {
 +   . /lib/functions/network.sh
 +
 local mesh=$1
 local interface=$2
 local interfaces
 @@ -52,7 +54,7 @@
 config_get interfaces $mesh interfaces
 for iface in $interfaces; do
 [ -f /sys/class/net/$iface/batman_adv/mesh_iface ] || {
 -   iface=$(uci -q -P/var/state get
 network.$iface.ifname)
 +   network_get_physdev iface $iface
 [ -f
 /sys/class/net/$iface/batman_adv/mesh_iface ] || continue
 }

 @@ -62,6 +64,8 @@

  bat_del_interface()
  {
 +   . /lib/functions/network.sh
 +
 local mesh=$1
 local interface=$2
 local interfaces
 @@ -69,7 +73,7 @@
 config_get interfaces $mesh interfaces
 for iface in $interfaces; do
 [ -f /sys/class/net/$iface/batman_adv/mesh_iface ] || {
 -   iface=$(uci -q -P/var/state get
 network.$iface.ifname)
 +   network_get_physdev iface $iface
 [ -f
 /sys/class/net/$iface/batman_adv/mesh_iface ] || continue
 }
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/mailman/listinfo/openwrt-devel




-- 
Jonh Wendell
http://www.bani.com.br
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] kmod-batman-adv: Use current /lib/functions/network.sh in hotplug.d scripts

2012-11-23 Thread Gui Iribarren
On Fri, Nov 23, 2012 at 7:11 AM, Jonh Wendell jonh.wend...@gmail.com wrote:
 hi. why did you include that file twice? is there any reason to not do a
 single include in the beginning of the the script?

Those two functions differ very little, and could probably be
refactored into one, but first i'll see what the package maintainer
thinks about it :)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Snapshot buildbots: two buildslaves (Nico and Carme) upload nothing and discard binaries

2012-11-23 Thread Hannu Nyman
Nico and Carme, two buildslaves doing the trunk snapshots upload  
nothing and discard the compiled firmwares. I hate seeing scarce  
resources wasted, so I am bugging about this. Those two are doing 4/9  
of the simultaneous builds, so quite a large amount of work gets  
partially wasted.


Due to these faulty buildbots, xburst has not seen a new binary at  
http://downloads.openwrt.org/snapshots/trunk/ in 14 days, despite it  
having been compiled succesfully three times after that (  
http://buildbot.openwrt.org/builders/xburst ). It has always got  
either carme or nico :-(


Same goes also for ixp4xx (  
http://buildbot.openwrt.org/builders/ixp4xx ). It has been compiled  
several times succesfully after the server breakdown, but as the  
buildslave has always been carme or nico, there still are no binaries  
at all for ixp4xx.


Both seem to fail for SSH key reasons, or something like that.

Carme's error:

ixp4xx
Upload Snapshot to Openwrt
Permission denied (publickey,password).

rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.8]
Permission denied (publickey,password).

rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.8]

program finished with exit code 0
elapsedTime=4.396710



Nico's error:

Upload Snapshot to Openwrt
@@@
@WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
13:db:59:eb:6a:f5:94:c9:12:cc:b7:11:35:33:cf:1b.
Please contact your system administrator.
Add correct host key in /home/fnord/.ssh/known_hosts to get rid of  
this message.

Offending key in /home/fnord/.ssh/known_hosts:1
RSA host key for openwrt.org has changed and you have requested strict  
checking.

Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.7]
@@@
@WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
13:db:59:eb:6a:f5:94:c9:12:cc:b7:11:35:33:cf:1b.
Please contact your system administrator.
Add correct host key in /home/fnord/.ssh/known_hosts to get rid of  
this message.

Offending key in /home/fnord/.ssh/known_hosts:1
RSA host key for openwrt.org has changed and you have requested strict  
checking.

Host key verification failed.

rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.7]
program finished with exit code 0
elapsedTime=1.065284





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


Re: [OpenWrt-Devel] Snapshot buildbots: two buildslaves (Nico and Carme) upload nothing and discard binaries

2012-11-23 Thread Travis Kemen
nico is fixed, I still don't know what is going on with carme, hopefully
I can get it fixed soon.

Travis

On Fri, Nov 23, 2012 at 6:34 AM, Hannu Nyman hannu.ny...@iki.fi wrote:

 Nico and Carme, two buildslaves doing the trunk snapshots upload nothing
 and discard the compiled firmwares. I hate seeing scarce resources wasted,
 so I am bugging about this. Those two are doing 4/9 of the simultaneous
 builds, so quite a large amount of work gets partially wasted.

 Due to these faulty buildbots, xburst has not seen a new binary at
 http://downloads.openwrt.org/**snapshots/trunk/http://downloads.openwrt.org/snapshots/trunk/in
  14 days, despite it having been compiled succesfully three times after
 that ( 
 http://buildbot.openwrt.org/**builders/xbursthttp://buildbot.openwrt.org/builders/xburst).
  It has always got either carme or nico :-(

 Same goes also for ixp4xx ( 
 http://buildbot.openwrt.org/**builders/ixp4xxhttp://buildbot.openwrt.org/builders/ixp4xx).
  It has been compiled several times succesfully after the server
 breakdown, but as the buildslave has always been carme or nico, there still
 are no binaries at all for ixp4xx.

 Both seem to fail for SSH key reasons, or something like that.

 Carme's error:

 ixp4xx
 Upload Snapshot to Openwrt
 Permission denied (publickey,password).

 rsync: connection unexpectedly closed (0 bytes received so far) [sender]
 rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.8]
 Permission denied (publickey,password).

 rsync: connection unexpectedly closed (0 bytes received so far) [sender]
 rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.8]

 program finished with exit code 0
 elapsedTime=4.396710



 Nico's error:

 Upload Snapshot to Openwrt
 @@**@
 @WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
 @@**@
 IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
 Someone could be eavesdropping on you right now (man-in-the-middle attack)!
 It is also possible that the RSA host key has just been changed.
 The fingerprint for the RSA key sent by the remote host is
 13:db:59:eb:6a:f5:94:c9:12:cc:**b7:11:35:33:cf:1b.
 Please contact your system administrator.
 Add correct host key in /home/fnord/.ssh/known_hosts to get rid of this
 message.
 Offending key in /home/fnord/.ssh/known_hosts:1
 RSA host key for openwrt.org has changed and you have requested strict
 checking.
 Host key verification failed.
 rsync: connection unexpectedly closed (0 bytes received so far) [sender]
 rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.7]
 @@**@
 @WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
 @@**@
 IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
 Someone could be eavesdropping on you right now (man-in-the-middle attack)!
 It is also possible that the RSA host key has just been changed.
 The fingerprint for the RSA key sent by the remote host is
 13:db:59:eb:6a:f5:94:c9:12:cc:**b7:11:35:33:cf:1b.
 Please contact your system administrator.
 Add correct host key in /home/fnord/.ssh/known_hosts to get rid of this
 message.
 Offending key in /home/fnord/.ssh/known_hosts:1
 RSA host key for openwrt.org has changed and you have requested strict
 checking.
 Host key verification failed.

 rsync: connection unexpectedly closed (0 bytes received so far) [sender]
 rsync error: unexplained error (code 255) at io.c(601) [sender=3.0.7]
 program finished with exit code 0
 elapsedTime=1.065284





 __**_
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.**org openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/**mailman/listinfo/openwrt-develhttps://lists.openwrt.org/mailman/listinfo/openwrt-devel

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


Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-23 Thread Luiz Angelo Daros de Luca
/proc/uptime is much simplier :-)
---
 Luiz Angelo Daros de Luca, Me.
luizl...@gmail.com


2012/11/23 Bastian Bittorf bitt...@bluebottle.com:
 not possible to get more resolution than 1 second, at least with
 the
 date command. I'd like to know if there's a way to get a resolution

 you can start with 'date +%s'
 the tic() toc() approach is nice, here is what
 we do to measure exact time between 2 events:

 read t1 trash /proc/uptime
 do_something()
 read t2 trash /proc/uptime
 duration=$(( ${t2//./} - ${t1//./} ))
 logger -s lasts $(( $duration / 100 )).$(( $duration % 100 )) sec

 which outputs something like:
 lasts 7.64 sec

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


Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-23 Thread Bastian Bittorf
 /proc/uptime is much simplier :-)

and it's even monotonic...and...fast.
(date +%s can jump into future and past)

  read t1 trash /proc/uptime
  do_something()
  read t2 trash /proc/uptime

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


[OpenWrt-Devel] [PATCH] image.mk: don't squash file permissions in JFFS2 images

2012-11-23 Thread Jonh Wendell
Currently we call mkfs.jffs2 --squash, which will change
both file permissions and owners.

If we have some file with suid bits, it will clear these bits.

Thus it's enough to just squash file owners, by replacing that
argument to --squash-uids.

Signed-off-by: Jonh Wendell jonh.wend...@oiwifi.com.br
---
 include/image.mk |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 1977fc8..10850a6 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -18,9 +18,9 @@ KDIR=$(KERNEL_BUILD_DIR)
 IMG_PREFIX:=openwrt-$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))

 ifneq ($(CONFIG_BIG_ENDIAN),)
-  JFFS2OPTS :=  --pad --big-endian --squash -v
+  JFFS2OPTS :=  --pad --big-endian --squash-uids -v
 else
-  JFFS2OPTS :=  --pad --little-endian --squash -v
+  JFFS2OPTS :=  --pad --little-endian --squash-uids -v
 endif

 ifeq ($(CONFIG_JFFS2_RTIME),y)
-- 
1.7.10.4


-- 
Jonh Wendell
http://www.bani.com.br
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Support for musl libc in OpenWrt

2012-11-23 Thread Florian Fainelli

Hi All,

Support for musl libc in OpenWrt has been added in revision r34314, this 
was tested against:


- X86 in VirtualBox
- X86_64 with UML
- ARM with the realview target

Note that the following issues are known:

- unable to complete libstdc++ build due to some missing declarations (WIP)
- MIPS and MIPSel ports are not functionnal (details below)
- PowerPC has not been tested at all due to lack of hardware/emulation 
target


I did not try yet to compile our entire set of packages besides the one 
pre-selected in trunk, so you will certainly encounter some breakage due 
to musl being more strict about header inclusions and declarations than 
uClibc and (e)glibc.


Have fun!
--
MIPS and MIPSel specific issues:

using qemu's binary emulation (qemu-mips[el]) against a statically 
linked binary works, a dynamic binary makes my host qemu segv. Using 
qemu-system-mips[el], the binary segfaults while being executed by the 
kernel. So far I have not had the time to debug this further.

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


Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-23 Thread Gabriel

Thank you for your answers!

I've tried with the time command, but I couldn't use it for various 
commands together as in my pc using parentheses like


time (command 1; command 2)

with date +%s I get a seconds count:

root@E10:~# while true; do date; date +%s; sleep 1; done
Fri Nov 23 17:10:11 ART 2012
1353701411
Fri Nov 23 17:10:12 ART 2012
1353701412
Fri Nov 23 17:10:13 ART 2012
1353701413

Regarding /proc/uptime, I didn't know about it, I think will be enough 
for what I wanted!


Best regards

Gabriel


El 23/11/12 13:56, Bastian Bittorf escribió:

/proc/uptime is much simplier :-)

and it's even monotonic...and...fast.
(date +%s can jump into future and past)


read t1 trash /proc/uptime
do_something()
read t2 trash /proc/uptime

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



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


Re: [OpenWrt-Devel] milliseconds time measurements

2012-11-23 Thread John Lauro
If you want to do multiple commands with time, either put them in a script and 
time the script, or do something like:

echo command 1 ; command 2 | time sh



- Original Message -
From: Gabriel gto...@inti.gob.ar
To: openwrt-devel@lists.openwrt.org
Sent: Friday, November 23, 2012 3:14:09 PM
Subject: Re: [OpenWrt-Devel] milliseconds time measurements

Thank you for your answers!

I've tried with the time command, but I couldn't use it for various 
commands together as in my pc using parentheses like

time (command 1; command 2)

with date +%s I get a seconds count:

root@E10:~# while true; do date; date +%s; sleep 1; done
Fri Nov 23 17:10:11 ART 2012
1353701411
Fri Nov 23 17:10:12 ART 2012
1353701412
Fri Nov 23 17:10:13 ART 2012
1353701413

Regarding /proc/uptime, I didn't know about it, I think will be enough 
for what I wanted!

Best regards

Gabriel


El 23/11/12 13:56, Bastian Bittorf escribió:
 /proc/uptime is much simplier :-)
 and it's even monotonic...and...fast.
 (date +%s can jump into future and past)

 read t1 trash /proc/uptime
 do_something()
 read t2 trash /proc/uptime
 ___
 openwrt-devel mailing list
 openwrt-devel@lists.openwrt.org
 https://lists.openwrt.org/mailman/listinfo/openwrt-devel


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