[OpenWrt-Devel] Hang on setting $PROMPT in master

2019-10-21 Thread Martin Tippmann
We are using a shell-function to set the prompt based on return code -
it works fine in 17.01 / 18.06 / 19.07, however in current master when
the function is run the terminal/ssh session hangs.

how to reproduce:



<--- hang.sh:
#!/bin/sh

prompt_set() {
   face() {
local rc=$?
case "$rc" in
   0) printf '%s' "$1" ;;
   *) printf '%s' "$2" ; return $rc ;;
  esac
   }

   local e='\[\e' # start escape-sequence
   local c='\]' # close escape-sequence

   local user='\u'
   local wdir='\w' # workdir
   local host='\h' # short form

local reset="${e}[0m${c}" # all attributes
local white="${e}[37m${c}"
local cyan="${e}[36m${c}"
local yellow="${e}[33;1m${c}" # bold
local green="${e}[32m${c}"
local red="${e}[31m${c}"

local ok="${green}:)"
local bad="${red}8("

   # e.g. user@hostname:~ :)
   export PS1="${cyan}${user}$white@${green}$host:${yellow}$wdir \$(
face '$ok' '$bad' ) $reset"
}

prompt_set
-->

now source the file:

. ./hang.sh

shellcheck does not complain - I'm writing because I'm not sure wether
this invalid sh that happened to work anyway or is this a
bug/regression in ash?

regards
Martin

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


Re: [OpenWrt-Devel] netifd: DEVICE= always empty for ACTION=ifdown for scripts in /etc/hotplug.d/iface

2019-02-22 Thread Martin Tippmann
On Fri, Feb 22, 2019 at 9:17 AM Martin Tippmann  wrote:
>
> Hi,
>
> I'm calling some iptables rules from a scripts in /etc/hotplug.d/iface
> and these failed because there seems to be no $DEVICE variable for
> ACTION=ifdown events.
>
> It's not really obvious that the device is not populated for ifdown
> events, is there a reason for this? I guess the data about the device
> must be there and existing.
>
> I'm confused wether this behavoir is intented or a bug, it looks like
> this was never working/implemented:
> https://git.openwrt.org/?p=project/netifd.git;a=blob;f=interface.c;h=b21d2345bfc9577884e76aaf006dcdb39e330d5b;hb=HEAD#l227

Sorry, wrong link to the source - I guess it's this code here:
https://git.openwrt.org/?p=project/netifd.git;a=blob;f=interface-event.c;h=a40f6dc883d3a3654d73d0592cd7eb65c2a8de85;hb=HEAD#l95

if ((current_ev == IFEV_UP || current_ev == IFEV_UPDATE) && current->l3_dev.dev)
 device = current->l3_dev.dev->ifname;

so for ifdown events device is always NULL in run_cmd:

run_cmd(current->name, device, current_ev, current->updated);

and the variable is not populated.

regards
Martin

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


[OpenWrt-Devel] netifd: DEVICE= always empty for ACTION=ifdown for scripts in /etc/hotplug.d/iface

2019-02-22 Thread Martin Tippmann
Hi,

I'm calling some iptables rules from a scripts in /etc/hotplug.d/iface
and these failed because there seems to be no $DEVICE variable for
ACTION=ifdown events.

It's not really obvious that the device is not populated for ifdown
events, is there a reason for this? I guess the data about the device
must be there and existing.

I'm confused wether this behavoir is intented or a bug, it looks like
this was never working/implemented:
https://git.openwrt.org/?p=project/netifd.git;a=blob;f=interface.c;h=b21d2345bfc9577884e76aaf006dcdb39e330d5b;hb=HEAD#l227

There is also a related bug:
https://bugs.openwrt.org/index.php?do=details_id=1741

Thanks,
Martin

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


Re: [OpenWrt-Devel] openwrt-imagebuilder-18.06.0-rc1-ar71xx-generic.Linux-x86_64

2018-06-25 Thread Martin Tippmann
On Mon, Jun 25, 2018 at 3:56 PM, Mikael Bak  wrote:
> Build dependency: Please install GNU 'time' or BusyBox 'time'
>
> Prerequisite check failed. Use FORCE=1 to override.
> make[1]: *** [Makefile:76: staging_dir/host/.prereq-build] Error 1
> make: *** [Makefile:175: image] Error 2
> [mikael@mikael-pc
> openwrt-imagebuilder-18.06.0-rc1-ar71xx-generic.Linux-x86_64]$
>
>
> But I have 'time':
> $ time

This might be internal time command from your shell. This somehow does
not work.

>
> real0m0,000s
> user0m0,000s
> sys 0m0,000s
> $
>
> What am I doing wrong?

You could attempt to install gtime from the repositories:
$ sudo apt install gtime

regards
Martin

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


Re: [OpenWrt-Devel] [PATCH] config: extend small_flash feature

2018-06-03 Thread Martin Tippmann
On Fri, Jun 1, 2018 at 8:05 PM, Alex Maclean  wrote:
> On 01/06/18 12:34, Lucian Cristian wrote:
>
>> On 30.05.2018 20:22, Martin Tippmann wrote:
>>> find /usr |
>>> xargs md5sum
>>
>> I made the test on tl-wr841n-v9 with luci selected
>>
>> these are the changes to squashfs
>>
>> --- a/config/Config-images.in
>> +++ b/config/Config-images.in
>> @@ -149,8 +149,15 @@ menu "Target Images"
>> int "Block size (in KiB)"
>> depends on TARGET_ROOTFS_SQUASHFS
>> default 64 if LOW_MEMORY_FOOTPRINT
>> +   default 1024 if (SMALL_FLASH &&
>> !LOW_MEMORY_FOOTPRINT)
>> default 256
>>
>> +   config SQUASHFS_FRAGMENT_CACHE_SIZE
>> +   int "Number of fragments cached"
>> +   depends on TARGET_ROOTFS_SQUASHFS
>> +   default 1 if (SMALL_FLASH &&
>> !LOW_MEMORY_FOOTPRINT)
>> +   default 3
>> +
>> menuconfig TARGET_ROOTFS_UBIFS
>> bool "ubifs"
>> default y if USES_UBIFS
>
> This won't have actually changed the option - you should use
> KERNEL_SQUASHFS_FRAGMENT_CACHE_SIZE,
> and CONFIG_SQUASHFS_EMBEDDED=y is also needed in the kernel config.
> I think this also therefore belongs either in Config-kernel.in or simply
> in the subtarget kernel config.
>
> I did a few tests myself:
>
> 256K and 3 fragments:
> 10608K used after boot, 11408K free after reading /usr
> 24.5 seconds from kernel start to wifi link up
>
> 1024K and 3 fragments:
> 14520K after boot, 15204K after reading
> 30 seconds to link up
>
> 1024K and 2 fragments:
> 13460K after boot, 14128K after reading
> 34.7 seconds to link up
>
> 1024K and 1 fragment:
> 11620K after boot, 12364K after reading
> 46.8 seconds to link up
>
> Certainly quite a lot of memory impact with the larger block size, but
> also a quite significant performance impact with the larger reads.
>
> I'm leaning towards compromising on 2 fragments but I'd like input on that.

Thanks for testing! Did not expect the impact on boot-time. I'm not a
dev, 2 looks reasonable for me - maybe add the flag to make menuconfig
/ .config so that downstream can set it up - for some applications
(i.e. freifunk) boot-time does not matter but memory is always scarse.

regards
Martin

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


Re: [OpenWrt-Devel] [PATCH] config: extend small_flash feature

2018-05-30 Thread Martin Tippmann
On Wed, May 30, 2018 at 3:21 PM, Alex Maclean  wrote:
> change the squashfs block size to 1024KiB.

This might cause a problem with memory. You might also want to change

CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE from 3 to 1

in the kernel config.
https://cateee.net/lkddb/web-lkddb/SQUASHFS_FRAGMENT_CACHE_SIZE.html

This defines the blocks that are stored decompressed in memory, as far
as I know this memory is not easily reclaimable and you might run into
issues with a cache size of 3 and 1024kb blocks.
If someone might want to some tests on ar71xx - cat /proc/meminfo -
MemAvailable should be higher after doing something like find /usr |
xargs md5sum

Maybe I'll find the time to do some tests, but this has quite an
impact on free memory for 32mb devices.

regards
Martin

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


Re: [OpenWrt-Devel] LEDE 17.01.5 release planning

2018-05-24 Thread Martin Tippmann
On Thu, May 24, 2018 at 9:06 PM, Hauke Mehrtens  wrote:
> Please do not hesitate to re report some request that something should
> be backported from master or some regression compared to lede-17.01, if
> it looks like they got ignored and didn't got a response.

Hi, would be great if the recent wireguard version bump with MIPS
assembly could be included:
https://git.openwrt.org/aa30eb5b073c93ad00742a5a4046ac42e15b4b7a

thanks,
Martin

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


Re: [OpenWrt-Devel] [LEDE-DEV] Remerge logo ideas

2017-05-29 Thread Martin Tippmann
On Mon, May 29, 2017 at 12:11 PM, Jamie Stuart  wrote:
> Hi,
> First of all, I’m glad to hear the process of remerging LEDE with OpenWrt is 
> moving forward.
> For what it’s worth, if prefer the LEDE name (it’s friendlier - ‘leddy’ - and 
> not tied to the name of an old router!)
>
> However, it seems the consensus is that the OpenWrt name should remain. I 
> thought that maybe we should take this opportunity to at least give the 
> project an updated look?
> Maybe a new logo? I’m personally not one for mascots, so I had a quick go at 
> a few simple text-based designs:
>
> http://i.imgur.com/9zyXSYR.png
>
> What are you thoughts?

+1

The logo looks great. Is the used font free to use? There could be a
problems if it's a commercial font, depending on the licence?

Maybe LEDE/OpenWRT could create some minimal "corporate identity" like
some base colors and fonts that are used on all websites. I guess it
shouldn't more be than a few CSS rules but having a somewhat unified
look across all websites / pages is a nice thing to have. Arch Linux
is a good example, they also use Flyspray and a Wiki and gitweb but
have a similiar look and feel everywhere.

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


Re: [OpenWrt-Devel] Using kdump... persistent logs, etc. (Syrone Wong)

2017-02-23 Thread Martin Tippmann
On Thu, Feb 23, 2017 at 12:13 PM, Bernie McIntosh
 wrote:
>> Hi,
>>
>> Has anyone managed to use kdump with OpenWRT/LEDE?
>>
>> I have a box which periodically panics, and since /var is a link to /tmp/ 
>> there are no persistent logs.  Which reminds me: is it safe to configure a 
>> third partition on my CF card, format it as ext3, and mount that as /var/log 
>> in /etc/fstab?
>>
>> And how would I modify the build process if I wanted to add additional 
>> partitions?
>>
>> Thanks,
>>
>> -Philip
>>
>
> An alternative might be helpful.

Another alternative is Kernel crashlogging - I think it's on by
default and you can get the backtrace from the last panic in
/sys/kernel/debug/crashlog after reboot.

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


Re: [OpenWrt-Devel] [LEDE-DEV] Any interest in adding runit to OpenWRT?

2016-12-27 Thread Martin Tippmann
On Tue, Dec 27, 2016 at 9:43 AM, John Crispin  wrote:
> Hi,
>
> currently procd service restart/reload can be triggered by config
> changes and network interface changes. from what i understand you are
> missing the following features
>
> * an option to simply run a script to check if the service should be
> started/stopped at a given interval.

yes, something that runs a script periodically and if that check
script fails (exit != 0) the service is restarted. this would be
pretty cool! But I'm not sure if our specific usecase warrants
inclusion in procd - would be nice to have!

> * allow hotplug events to trigger service restart/reload

At the moment shellscripts in /etc/hotplug.d are okay for this. I'm
not too familiar with what is possible with netifd and procd already..
something I'd thought about is:

wan goes up (someone plugs in a cable), vpn is started due to hotplug
event, all good. now cable has link loss or a different cable is put
on the wan port - this should trigger a restart - but this is already
possible with netifd? I just have to write a vtun netifd proto wrapper
I guess.

> anything else that you are missing inside procd ? those features should
> be trivial to implement.

I can't think of anything that is missing in procd at the moment. I'm
offline for the next week(s), so I can't test/work sorry!

There is this subjective thing through: I think runit/daemontools are
great and if procd could have something like runsvdir that would be a
good thing. It enables all kinds of cool stuff e.g. something better
than cron would be nice and runit and runwhen are a pretty cool
solution to this problem (https://wiki.uberspace.de/system:runwhen -
german) - but that's not the job of procd - but if such functionality
would be possible with procd I'm all for it. I can also see why it's
probably not going to happen because the design is quite different and
these usecases are rather exotic and not straight forward.

so far,
regards
Martin
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Any interest in adding runit to OpenWRT?

2016-12-26 Thread Martin Tippmann
On Mon, Dec 26, 2016 at 5:32 PM, Rob Landley <r...@landley.net> wrote:
> On 12/26/2016 08:05 AM, Martin Tippmann wrote:
>> On Sun, Dec 25, 2016 at 9:01 PM, Denys Vlasenko
>> So TL;DR: procd is fine for init but having runit/runsvdir easily
>> usable would be a nice feature to have!
>
> This implies that systemd should also be an option. As long as there's
> no standard init in the distro, might as well do them all? (Seems
> counterproductive to me.)

Hi, I'm not a dev and I just shared my personal 'would be nice to
have' opinion. I appreciate the work on procd and netifd and ubus and
a lot of thought went into it and it serves almost all usecases pretty
well.

afaik (please correct me if I'm wrong) systemd has some properties
that make it a bad fit for something like a 32mb/4mb flash router:

- glibc only (i.e. you are on your own with musl, good luck, patches
not welcome)
- hard dbus dependency (maybe bus1 in the future might make this
obsolete). dbus depends on glibc, glib? all 'huge' deps for a small
router.
- udev is mandatory?
- cgroups are mandatory? (+some other kernel stuff that is off by
default on LEDE/OpenWRT)
- <lot's of other stuff>

I don't see any benefits and we have almost everything systemd does
with procd,netifd,ubus

Adding runit+runsvdir to a squashfs image are a few kb at best - last
time I checked the image size didn't even change.

Some practical example where runit might be useful (if you know how to
do this with procd, please tell me :)

- we have on our mesh network a VPN client (vtun) that starts when wan
is up (via hotplug) but connectivity to the mesh network depends on
olsr working.
- at the moment there is some cumbersome cron logic shellscript hell
that tries to check that a) vtun is working, b) olsr is working
- writing a runit sv check script for vtun that checks for the correct
olsr neighbours and that restarts vtun if no neighbours are found is
pretty simple with runit. symlink the check for runwhen in the
/etc/hotplug.d/vtun-wan script and then unlink on ifdown event. runit
picks up the symlink and does the right thing. So there is the vtun
connection and the 'sv ./etc/services/vtun check' script that checks
olsr neighbors
- This gives you seperation of concerns, it's unixy, it's only shell
and it's something you can reason about.

So what I'd like to have is something like adding events to runit - if
netifd realizes there is a link loss on the wan interface I want to
trigger somewhere sv stop /etc/services/vtun

I don't need systemd. This might be useful for bigger machines like
some NAS devices where the users are familiar with systemd but IMHO
procd+netifd+ubus are superior in every aspect to systemd for these
low end router use cases.

But marrying runit+ubus+netifd+procd would _really_ solve some real
world usecases we have in a unixy, reasonable way. I'm open for debate
and discussion but this would provide a lot of flexibility for a
rather low cost/overhead - be it memory/flash.

Unfortunatly this mail is all talk and no walk and figuring out a sane
procd/netifd <-> runit interface is some rather hard problem if you
want a good solution.

But it's IMHO a path worth going because it provides a unixy, sane,
ressource-efficient, powerful interface without politics.


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


Re: [OpenWrt-Devel] Any interest in adding runit to OpenWRT?

2016-12-26 Thread Martin Tippmann
On Sun, Dec 25, 2016 at 9:01 PM, Denys Vlasenko
 wrote:
> I decided to try to do what I can, and put together a draft
> of the proposal how daemontools-like supervision
> should be used by a distro in a way which makes
> developers/packagers life easier - they will not need
> to target a specific distro, all distros will have common API
> for installing and controlling services. It is here:
>
> https://git.busybox.net/busybox/tree/examples/var_service/README_distro_proposal.txt
>
> If you have comments about this text, please share them.

Hi, that's great and I would love to see this on OpenWRT/LEDE - maybe
as optional dependency - runit / runsvdir is afaik already in busybox.

Personally I'd would love to have some ability to use procd facilities
with runsvdir/runit. ubus access, uci triggers... but I'm not sure
what would be a good way to implement that - I guess something like a
ubus<->runit shim could do the trick. Maybe there could be some
support for runsvdir in procd - but at the moment these tools can
coexist fine.

Personally what I'm missing in procd and what runit provides is the following:

- runsvdir like funktionality. e.g. on Freifunk firmwares you have to
run do some maintaince or check tasks occasionally and cron is not
really great - beeing able to use something like
http://code.dogmap.org/runwhen/ would be great. runwhen = cron+at but
better ;)

- more flexibility for checks. busybox runit has sv check -
http://smarden.org/runit/sv.8.html - where a script can be triggered
regulary and the exit code decides wether to restart the service or
not - this allows for better checks than just pid exists - sometimes
software get's stuck but appears to be working fine from the
procd/system perspective.

- more flexibility for logging

I don't think it should be the default but it would be great to marry
procd and runit on LEDE. I'm also aware that this is not trivial but
making ubus/procd/netifd and runit talk to each other i.e. restart a
service running with runit on a netifd change would be great!

So TL;DR: procd is fine for init but having runit/runsvdir easily
usable would be a nice feature to have!

..just my 0.02c
greetings from Weimar,
Martin
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] uclient-fetch & SSL WAS:Re: DD: CONFIG_BUSYBOX_DEFAULT_WGET is not set

2016-01-23 Thread Martin Tippmann
>> Not entirely. It (r48456) segfaults on receiving a 301 redirect for
>> http->https:
>>
>> # /bin/uclient-fetch -O- 'http://de-korte.org/robots.txt'
>> Downloading 'http://de-korte.org/robots.txt'
>> Connecting to 2001:470:7ad2::10:80
>> Segmentation fault
> That's an error handling bug - the hostname of the URL it redirects to
> is invalid. I've pushed a fix to uclient.git
>
>> It also behaves differently with the http://dyn.dns.he.net servers
>> (returning a Connection failure, despite also returning a result). See
>> below:
>>
>> # /bin/uclient-fetch -O-
>> 'https://dyn.dns.he.net/nic/update?hostname=example.com=munged=1.2.3.4'
>> Downloading
>> 'https://dyn.dns.he.net/nic/update?hostname=example.com=munged=1.2.3.4'
>> Connecting to 2001:470:0:193::3000:443
>> Writing to stdout
>> nochg 1.2.3.4Connection error: Connection failed
>>
>> I'm not too concerned about the first, but the latter is a bit
>> inconvenient. I suspect the HE servers close the connection
>> immediately after sending the result and that this is not expected.
> I'll make an account and look into that soon.

There is another problem - if you use it to get olsr data from
httpinfo plugin uclient-fetch stalls and times out:

# uclient-fetch -O- http://127.0.0.1:2006
Downloading 'http://127.0.0.1:2006'
Connecting to 127.0.0.1:2006
Connection error: Connection timed out

The daemon should work fine, at least curl and wget on Ubuntu handle it fine.

# echo GET /all | nc 127.0.0.1 2006 | head
HTTP/1.0 200 OK
Content-type: text/plain

Table: Links
Local IPRemote IP   Hyst.   LQ  NLQ Cost
10.63.231.1 10.63.33.1290.001.000   1.000   1.000
...


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


Re: [OpenWrt-Devel] uclient-fetch & SSL WAS:Re: DD: CONFIG_BUSYBOX_DEFAULT_WGET is not set

2016-01-23 Thread Martin Tippmann
2016-01-23 14:36 GMT+01:00 Bastian Bittorf <bitt...@bluebottle.com>:
> * Martin Tippmann <martin.tippm...@gmail.com> [23.01.2016 14:23]:
>> The daemon should work fine, at least curl and wget on Ubuntu handle it fine.
>
> i cannot reproduce this here:

Sorry if I was not clear - I meant uclient-fetch not wget.

# opkg list | grep uclient
libuclient - 2016-01-21-b9808a8c3a8922ed8df4e6fe45848ac2e52f13be
uclient-fetch - 2016-01-21-b9808a8c3a8922ed8df4e6fe45848ac2e52f13be

# uclient-fetch -O- http://127.0.0.1:2006
Downloading 'http://127.0.0.1:2006'
Connecting to 127.0.0.1:2006
Connection error: Connection timed out

it works fine with the busybox wget or regulary curl/wget but
uclient-fetch fails.

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


[OpenWrt-Devel] Bug Report: zram corrupts memory / misbehaves on ar71xx

2016-01-23 Thread Martin Tippmann
Hi, are here any other users of zram? We see some serious issues:

- application segfaults on memory pressure, without zram the OOM
killer is invoked but with zram random SIGSEVs starting to happen.
This happens also with light memory pressure e.g. when using luci.

Unfortunately I'm at loss how to debug this - I've switched on
CONFIG_DEBUG_VM and other memory related knobs unter make
kernel_menuconfig -> Kernel Hacking and changed the cmdline to add
debug but there are no messages that indicate any error.

I'm on trunk as of today on ar71xx (TP-LINK 841Nv8)

To reproduce:

- enable zram
- put a lot of memory pressure on the machine in a short time

While testing around I've discovered that lz4 for zram is broken -
this patch never got upstream and fixes the problem:
https://lkml.org/lkml/2014/7/21/736

Any ideas how to pinpoint this?

Here is a typical result with lots of segfaults (with
kernel.print-fatal-signals=1):

[  223.902219] do_page_fault(): sending SIGSEGV to netifd for invalid
write access to 
[  223.910852] epc = 77398a6c in libc.so[7731c000+92000]
[  223.916159] ra  = 77398a6c in libc.so[7731c000+92000]
[  223.921440]
[  224.281923] potentially unexpected fatal signal 11.
[  224.286990] CPU: 0 PID: 1110 Comm: netifd Not tainted 4.1.15 #2
[  224.293176] task: 81932ef8 ti: 816f6000 task.ti: 816f6000
[  224.298750] $ 0   :   0003 
[  224.304450] $ 4   : 773a88ed ff456461 80808080 fefefeff
[  224.309887] $ 8   : f73abb54  4000 8eac4000
[  224.315370] $12   : 000a  000e 00023ab1
[  224.320808] $16   : 773a88ed 773abb55 7fbe7048 7fbe6f50
[  224.326257] $20   :  773abb55 0062 00400019
[  224.331687] $24   :  7738d8d0
[  224.337143] $28   : 773c6320 7fbe6ec8 7fbe7048 77398a6c
[  224.342821] Hi: 003a
[  224.345799] Lo: 0012
[  224.348782] epc   : 77398a6c 0x77398a6c
[  224.352815] ra: 77398a6c 0x77398a6c
[  224.356776] Status: 0100f413 USER EXL IE
[  224.360951] Cause : 008c
[  224.363953] BadVA : 
[  224.366928] PrId  : 0001974c (MIPS 74Kc)
[  230.081537]
[  230.081537] do_page_fault(): sending SIGSEGV to sh for invalid read
access from 
[  230.090122] epc =  in busybox[40+46000]
[  230.095227] ra  =  in busybox[40+46000]
[  230.100289]
[  230.791874] potentially unexpected fatal signal 11.
[  230.796942] CPU: 0 PID: 3982 Comm: sh Not tainted 4.1.15 #2
[  230.802763] task: 8071da18 ti: 81cc task.ti: 81cc
[  230.808342] $ 0   :  0001 0f8f 
[  230.814067] $ 4   :  7fad75fc  
[  230.819506] $ 8   :  80064f20 803c9154 803244d8
[  230.824962] $12   : 001a 0013 000e 0007
[  230.830626] $16   :    
[  230.836100] $20   :  77fba000 7fad84f4 77fbd490
[  230.841529] $24   : 0001 77f936c0
[  230.847122] $28   :  7fad75a8  
[  230.852606] Hi: 
[  230.855580] Lo: 0007
[  230.858556] epc   :    (null)
[  230.862363] ra:    (null)
[  230.866143] Status: 0100f413 USER EXL IE
[  230.870318] Cause : 0088
[  230.873317] BadVA : 
[  230.876449] PrId  : 0001974c (MIPS 74Kc)
[  244.728483] potentially unexpected fatal signal 11.
[  244.733635] CPU: 0 PID: 3976 Comm: ubusd Not tainted 4.1.15 #2
[  244.739663] task: 8071f430 ti: 81496000 task.ti: 81496000
[  244.745275] $ 0   :   2462 779ba020
[  244.750739] $ 4   : 779ba000 0001 779ba020 
[  244.756405] $ 8   :  f400 0011 8514
[  244.761891] $12   : 00077469   6d656f75
[  244.767322] $16   : 779b29b0 779ba000 77a590b0 77a57538
[  244.772961] $20   : 77a54000 77a54000 7fdfaaf4 77a57490
[  244.778398] $24   :  779d0560
[  244.783873] $28   : 779ba020 7fdfaa30  7799dbf9
[  244.789312] Hi: 00399e63
[  244.792307] Lo: 49be433d
[  244.795285] epc   : 7799dce9 0x7799dce9
[  244.799322] ra: 7799dbf9 0x7799dbf9
[  244.803335] Status: 0100f413 USER EXL IE
[  244.807510] Cause : 00800010
[  244.810485] BadVA : 24630003
[  244.813650] PrId  : 0001974c (MIPS 74Kc)
[  248.265148]
[  248.265148] do_page_fault(): sending SIGSEGV to mac80211.sh for
invalid write access to 2020202c
[  248.274339] epc = 77590968 in libc.so[7756a000+92000]
[  248.279598] ra  = 77591880 in libc.so[7756a000+92000]
[  248.284873]
[  248.301767] potentially unexpected fatal signal 11.
[  248.306897] CPU: 0 PID: 3977 Comm: mac80211.sh Not tainted 4.1.15 #2
[  248.313515] task: 8071e9c0 ti: 804f2000 task.ti: 804f2000
[  248.319086] $ 0   :   7760d9c8 20202020
[  248.324578] $ 4   : 7760b008 0020 0020 
[  248.330016] $ 8   : fefefeff 80808080 0008 65726661
[  248.335464] $12   : 65737469   6e617469
[  248.341107] $16   : 7760b008 7760b008 7760d9c8 0020
[  248.346593] $20   : 7760f0b0 7760a000 7760d7c0 7760d7c0
[  248.352068] 

Re: [OpenWrt-Devel] UML not working in master

2015-09-26 Thread Martin Tippmann
2015-09-26 20:48 GMT+02:00 Javier Domingo Cansino :
> Hi Bastian,
>
> I have patched, compiled correctly, and working alright! =)
>
> You should really send that patch upstream!

Hi,

it's already fixed in the Kernel since June:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=30b11ee9ae23d78de66b9ae315880af17a64ba83
- But it's not in Kernel 3.18

Maybe it's better to just raise the Kernel version? Or should I submit
the patch to the list?

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


Re: [OpenWrt-Devel] alternatives to TDMA

2015-07-14 Thread Martin Tippmann
2015-07-14 17:50 GMT+02:00 Bill Moffitt bmoff...@ayrstone.com:
 My understanding is that UBNT has an ASIC in their devices to help with the
 timing of the TDMA mode. My suspicion is that, without that ASIC, software
 only TDMA would probably not be precise enough to bring benefit.

 Does anyone have a better understanding of this?

I have no clue about this but there is a FreeBSD implementation that
is adverstised to work on Atheros chipsets:
https://wiki.freebsd.org/WifiTDMA +
https://people.freebsd.org/~sam/FreeBSD_TDMA-20090921.pdf

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


Re: [OpenWrt-Devel] Alternatives do TDMA

2015-07-14 Thread Martin Tippmann
2015-07-14 18:45 GMT+02:00 Martin Tippmann martin.tippm...@gmail.com:
 2015-07-14 11:34 GMT+02:00 John Crispin blo...@openwrt.org:


 On 14/07/2015 11:18, valent.turko...@gmail.com wrote:
 I have your found out that NETSHe offers some of their firmwares for
 free download and testing with TDMA enbled driver:
 http://netshe.ru/files/NETSHe-3.0/

 looks like it is based on owrt, did you manage to find the GPL source ?
 is the tdma linked directly into the kernel or provided as a module ?

Here is some information from them: http://www.netshe.ru/wirelessstack
- Sorry did not found this before. However there seems to be no
download for the GPL patchsets...

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


Re: [OpenWrt-Devel] Alternatives do TDMA

2015-07-14 Thread Martin Tippmann
2015-07-14 11:34 GMT+02:00 John Crispin blo...@openwrt.org:


 On 14/07/2015 11:18, valent.turko...@gmail.com wrote:
 I have your found out that NETSHe offers some of their firmwares for
 free download and testing with TDMA enbled driver:
 http://netshe.ru/files/NETSHe-3.0/

 looks like it is based on owrt, did you manage to find the GPL source ?
 is the tdma linked directly into the kernel or provided as a module ?

I just took an image and did a grep -ri tdma and got the following results:

Übereinstimmungen in Binärdatei ./usr/lib/libpcore.so.4.0.0.
Übereinstimmungen in Binärdatei ./usr/sbin/iw.
Übereinstimmungen in Binärdatei ./lib/modules/3.8.6/mac80211.ko.
Übereinstimmungen in Binärdatei ./lib/modules/3.8.6/pdwext.ko.
Übereinstimmungen in Binärdatei ./lib/modules/3.8.6/cfg80211.ko.
Übereinstimmungen in Binärdatei ./lib/modules/3.8.6/ath.ko.
Übereinstimmungen in Binärdatei ./lib/modules/3.8.6/pnwext.ko.

Looks like they at least modify GPLd iw, ath9k and mac80211 code or am
I wrong here?

regards
Martin

some strings output:

[~/tdma/squashfs-root]$ strings ./usr/sbin/iw | grep -i tdma
tdma
TDMA
join_tdma
leave_tdma
Join the TDMA network with the given frequency, version, slots, bitrate and keys
Leave the current TDMA network.


[~/tdma/squashfs-root]$ strings ./lib/modules/3.8.6/cfg80211.ko | grep -i tdma
/home/stanislav/stasoft/NETSHe-SDK-4/barrier_breaker/openwrt/build_dir/target-mips_r2_uClibc-0.9.33.2/linux-ar71xx_generic/compat-wireless-2014-05-22/net/wireless/cfg80211_tdma.c
[~/tdma/squashfs-root]$ strings ./lib/modules/3.8.6/mac80211.ko | grep
-i tdma
TDMA: It is the first node. Start with node_id (%d)
TDMA: Try to associate with node_id (%d) and node_bitmap (%04X)
TDMA: No neighbours or beacons in ASSOCIATING state. Reset state to UNKNOW
TDMA: All neighbours accept this node settings. Change state to ASSOCIATED
TDMA: Not all neighbours voted for this node.
TDMA: (%lu) All neighbours do'nt see node / or beaconing troubles.
Reset node. (LV %lu / LB %lu / TC %lu / NB %d)
TDMA: Could not allocate memory for beacon!
TDMA: Could not put beacon header into skb!
TDMA: Could not put ESSID into skb!
TDMA: Could not put basic rates into skb!
TDMA: Could not put ext rates into skb!
TDMA: Could not put HT capabilities into skb!
TDMA: Could not allocate beacon
TDMA: Could not put TDMA info into skb!
TDMA: Could not put peer info into skb!
6%s: Failed to join TDMA network, DFS for specified channel is required
TDMA: Something wrong
TDMA: Start network join with %d nodes and %d version
TDMA: Setuped bitrate - %d. Calced - %d. Supported Rates - %x
TDMA: Round duration - %lu, TX slot duration - %lu, Second TX slot
duration - %lu
TDMA: Beacon interval in TU - %d.
TDMA: stop is called
TDMA: leave is called
TDMA: Enable frame transmission
TDMA: Wrong beacon len - %d
TDMA: Different SSID
TDMA: Wrong ie len - %d
TDMA: Wrong IE - %d
TDMA: Wrong version - %d %d
TDMA: Wrong node_id
TDMA: Rate mismatch
TDMA: Uh-Oh! Beacon with the same ID received.
TDMA: Desynchronize this node
TDMA: Just ignore it.
6%s: No room for a new TDMA STA entry %pM
TDMA: Could not link the key
TDMA: Could not allocate key
TDMA: Round duration - %lu, TX slot duration - %lu, Second TX slot
duration - %lu
TDMA: Neighbour with node_id (%d) is voted for this node.
TDMA: Disable frame transmission after beacon precessing
TDMA: USC - %u
TDMA: Reset starts Intf Queue %d
TDMA: Reset starts IEEE80211 Queue %d
tdma_originator_expire
tdma_max_clock_drift
tdma_get_skb_from_queue
tdma_sta_init
tdma_get_avail_slot
tdma_get_tx_window
tdma_originator_update
tdma_calc_ideal_interval
tdma_process_pending_frames
tdma_store_pending_frame
ieee80211_tdma_tx_notify
tdma_process_hdr
tdma_plan_next_tx
tdma_update_skb_hdr
tdma_tx_slot_duration
tdma_sched_tx
tdma_originator_get
tdma_amsdu_to_8023s
tdma_tu_adjust
tdma_update_hdr_counter
tdma_tx_slot_calc
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] uml: fix mac80211 hwim for uml

2015-06-23 Thread Martin Tippmann
A duplicate include guard prevents inclusion of barrier.h in UML build and
this prevents mac80211 from building.

This patch re-enables mac80211 hwsim and renames the include guard.

See https://lists.openwrt.org/pipermail/openwrt-devel/2015-June/033614.html
for details.

Signed-off-by: Martin Tippmann martin.tippm...@gmail.com
From 16cbe45c30f6d812fbeb910e61f141de1fac7fca Mon Sep 17 00:00:00 2001
From: mt m...@i3o.de
Date: Sat, 13 Jun 2015 14:16:07 +0200
Subject: [PATCH] fix mac80211 build for uml

---
 package/kernel/mac80211/Makefile|  1 -
 package/kernel/mac80211/patches/010-fix-uml-build.patch | 15 +++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 package/kernel/mac80211/patches/010-fix-uml-build.patch

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 2af5d39..068ea67 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -60,7 +60,6 @@ define KernelPackage/mac80211/Default
   SUBMENU:=$(WMENU)
   URL:=https://wireless.wiki.kernel.org/
   MAINTAINER:=Felix Fietkau n...@openwrt.org
-  DEPENDS:=@!TARGET_uml
 endef
 
 define KernelPackage/cfg80211
diff --git a/package/kernel/mac80211/patches/010-fix-uml-build.patch b/package/kernel/mac80211/patches/010-fix-uml-build.patch
new file mode 100644
index 000..0d53e08
--- /dev/null
+++ b/package/kernel/mac80211/patches/010-fix-uml-build.patch
@@ -0,0 +1,15 @@
+--- a/backport-include/asm/barrier.h
 b/backport-include/asm/barrier.h
+@@ -1,9 +1,9 @@
+-#ifndef __BACKPORT_ASM_GENERIC_BARRIER_H
+-#define __BACKPORT_ASM_GENERIC_BARRIER_H
++#ifndef __BACKPORT_ASM_BARRIER_H
++#define __BACKPORT_ASM_BARRIER_H
+ #include_next asm/barrier.h
+ 
+ #ifndef dma_rmb
+ #define dma_rmb()	rmb()
+ #endif
+ 
+-#endif /* __BACKPORT_ASM_GENERIC_BARRIER_H */
++#endif /* __BACKPORT_ASM_BARRIER_H */
-- 
1.9.1

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


[OpenWrt-Devel] Possible Fix for broken hwsim on UML target

2015-06-12 Thread Martin Tippmann
Hi,

there is also a ticket about the problem here[1].

The problem is a missing include for barrier.h that is caused by a
duplicate header guard - I guess it might be this commit that introduced
the problem: [2]

The problem seems to be that both barrier.h header  files are included when
compiling mac80211 for UML, however the identical header guard prevents the
inclusion of the original asm-generic/barrier.h hat therefore barrier.h
is never included[3]. Missing definitions are the cause for the failing
build.

The fix is simple:

Changing the header guard for backports-generic/asm/barrier.h to something
different like __BACKPORT_ASM_BARRIER_H fixes the problem for me.


Unfortunately I'm not sure how to create a patch for this or where to send
it.

This fixes the build issue and mac80211 hwsim could be activated again for
the UML targets.



thanksregards
Martin

1: https://dev.openwrt.org/ticket/19146
2:
https://git.kernel.org/cgit/linux/kernel/git/backports/backports.git/commit/?id=2d7d4083a7a418c1682d289920683f8b159d16c7
3:
https://gist.githubusercontent.com/anonymous/32f08ca5b5c12e46b8d7/raw/347509635de4f30034eb79dc9860fb90f61ab479/gistfile1.txt
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel