Re: [LEDE-DEV] [PATCH 5/5] ar71xx: add support for D-Link DAP-2695 rev. A1

2016-10-12 Thread Stijn Tintel
On 12-09-16 06:10, Yousong Zhou wrote:
> On 12 September 2016 at 00:12, Stijn Tintel  wrote:
>> Signed-off-by: Stijn Tintel 
>> ---
>>  package/boot/uboot-envtools/files/ar71xx   |   1 +
>>  target/linux/ar71xx/base-files/etc/board.d/01_leds |   5 +
>>  .../linux/ar71xx/base-files/etc/board.d/02_network |   5 +
>>  .../etc/hotplug.d/firmware/11-ath10k-caldata   |   4 +
>>  .../base-files/etc/uci-defaults/09_fix-checksum|   9 +
>>  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
>>  .../ar71xx/base-files/lib/upgrade/platform.sh  |  13 ++
>>  target/linux/ar71xx/config-4.4 |   1 +
>>  .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |   9 +
>>  target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
>>  .../files/arch/mips/ath79/mach-dap-2695-a1.c   | 191 
>> +
>>  .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
>>  target/linux/ar71xx/image/generic.mk   |  38 
>>  13 files changed, 281 insertions(+)
>>  create mode 100644 
>> target/linux/ar71xx/files/arch/mips/ath79/mach-dap-2695-a1.c
> We have just got rid of the 09_fix-seama-header by excluding jffs2
> marker from the calculation of checksum.  The result image flashes
> just fine because it looks like the device will flash the whole
> uploaded file instead of just the size in the image header.  If that
> is also the case with fixwrgg then we can save a few flash block
> erases.
This works fine for sysupgrade images, and when flashing via the
bootloader. Unfortunately such image doesn't flash via the web interface
of the stock firmware.

Stijn

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2 2/5] mac80211: use uci to generate wireless config file

2016-10-12 Thread Christian Lamparter
On Wednesday, October 12, 2016 2:05:15 PM CEST Matthias Schiffer wrote:
> On 10/12/2016 01:42 PM, Jonas Gorski wrote:
> > On 11 October 2016 at 13:37, Christian Lamparter
> >  wrote:
> >> Previously, wifi detect simply dumped its generated wireless
> >> configuration out to STDOUT. A second step was needed to
> >> append the configuration to /etc/config/wireless (or create
> >> it, if it didn't exist).
> >>
> >> With this patch, The wifi detection script will now use uci
> >> to update the wireless configuration directly.
> >>
> >> Note: uci writes a "cfg123456" printout to stdout when it
> >> generates a name for the unnamed section ("add wireless wifi-iface").
> > 
> > This rather sounds like a bug in uci, at least I would expect it to
> > generate no output if it is invoked with "-q", neither on stdout nor
> > stderr.
There's a description in uci's list.c [0] that states the purpose of the
printout.

"[...] This is used as reference when locating or updating the section
from apps/scripts. To make multiple concurrent versions somewhat safe
for updating, the name is generated from a hash of its type and name/value
pairs of its option, and it is prefixed by a counter value. If the order
of the unnamed sections changes for some reason, updates to them will be
rejected."

The cfg123456 string produced by the fprintf(stdout, ...) in uci_do_add [1].

> >> Since we currently pipe wifi detect into /etc/config/wireless, we
> >> have to redirected this output, so it doesn't end up in the wireless
> >> configuration file.
> > 
> > I wonder if it wouldn't be better to keep "detect" output to stdout,
> > and add a new command that modifies the uci config (e.g. "update" or
> > "refresh"). People might rely/expect the current behavior, and get
> > confused when it stops working.
> >
> Maybe we could just rename wifi-detect to something different, so nobody
> would expect the old behaviour? Keeping two separate code paths doesn't
> seem like a good idea to me.
I renamed it to "wifi config" for now. I've played around with making a
"compat" 'wifi detect' that simply prints the current config to stdout. 

i.e.:
wifi_detect() {
   wifi_config &> /dev/null

   tmp=$(mktemp -u); cp /etc/config/wireless "$tmp"; cat "$tmp"; rm -f 
"$tmp"
}

this will work for wifi detect > /etc/config/wireless. But it also will cause
to spawn duplicates if ">>" is used.

Any clever ideas? Otherwise, I can drop the uci changes. They are certainly nice
to have, but we can manage without them.

Regards,
Christian
---

[0] 


[1] 


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] OpenWrt Summit Live Streaming

2016-10-12 Thread Eric Schultz
For those of you who are attending OpenWrt Summit, I'm looking forward
to seeing you!

For those who aren't able to make it, I wanted to let you know that
OpenWrt Summit will be live streamed on Youtube. We have links for
almost all the sessions at OpenWrtSummit.org and the last few will be
added before tomorrow. We also have an IRC channel to participate. You
can get all the information at OpenWrtSummit.org.

Eric

NOTE: if you're in Germany, you may need a VPN to watch it live due to
local law. We have a suggestion from an attendee for a free VPN provider
on OpenWrtSummit.org.



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2 4/5] base-files, mac80211, broadcom-wl: plug-and-play wifi detection

2016-10-12 Thread Christian Lamparter
Hello,

On Wednesday, October 12, 2016 1:32:38 PM CEST Jonas Gorski wrote:
> On 11 October 2016 at 13:37, Christian Lamparter
>  wrote:
> > Currently, the wifi detection script is executed as part of
> > the (early) boot process. Pluggable wifi USB devices, which
> > are inserted at a later time are not automatically
> > detected and therefore they don't show up in LuCI.
> >
> > A user has to deal with wifi detection manually, or restart
> > the router.
> >
> > However, the current "sleep 1" window - which the boot
> > process waits for wifi devices to "settle down" - is too
> > short to detect wifi devices for some routers anyway.
> >
> > For example, this can happen with USB WLAN devices on the
> > WNDR4700. This is because the usb controller needs to load
> > its firmware from UBI and initialize, before it can operate.
> >
> > The issue can be seen on a BT HomeHub 5A as well as soon as
> > the caldata are on an ubi volume. This is because the ath9k
> > card has to be initialized by owl-loader first. Which has to
> > wait for the firmware extraction script to retrieve the pci
> > initialization values inside the caldata.
> >
> > This patch moves the wifi detection to hotplug scripts.
> > For mac80211, the wifi detection will now automatically
> > run any time a "ieee80211" device is added. Likewise
> > broadcom-wl's script checks for new "net" devices which
> > have the "wl$NUMBERS" moniker.
> >
> > File locking has been added to the detection scripts in
> > order to prevent races during discovery. The locking code
> > will protect against adding more open wireless network
> > configurations. In case "wifi detect" is run manually
> > by the user at a bad time.
> >
> > All changes to base-files, mac80211 and broadcom-wl packages
> > have been integrated into a single patch to play nice with
> > git bisect.
> >
> > Thanks to Martin Blumenstingl for helping with the implementation
> > and testing of the patch.
> 
> Funny enough I did something similar recently, but didn't submit it
> here yet because there is some ugliness. A few comments ...

Actually, I know that more people have tried this before and posted
different versions and patches to the MLs. So chances are there will
be more attempts after this one.

[...]
> > diff --git a/package/kernel/mac80211/Makefile 
> > b/package/kernel/mac80211/Makefile
> > index 91c9362..f320326 100644
> > --- a/package/kernel/mac80211/Makefile
> > +++ b/package/kernel/mac80211/Makefile
> > @@ -1732,6 +1732,8 @@ define KernelPackage/cfg80211/install
> > $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
> > $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
> > $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh 
> > $(1)/lib/netifd/wireless
> > +   $(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211
> 
> Don't you also need to update /etc/hotplug.json to pass through
> ieee80211 events?
No need for that. It's already handled there by [0].

  64 [ "if",
  65 [ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
  66 [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
  67 ]

If the /etc/hotplug.d/ieee80211 directory exits, hotplug-call will
look for scripts in the directory and execute them.
 
> > +   $(INSTALL_DATA) ./files/mac80211.hotplug 
> > $(1)/etc/hotplug.d/ieee80211/00-wifi-detect
> >  endef
> >
> >  define KernelPackage/ipw2100/install
> > diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh 
> > b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
> > index 253de40..44ba511 100644
> > --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
> > +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
> > @@ -58,7 +58,14 @@ check_mac80211_device() {
> > [ "$phy" = "$dev" ] && found=1
> >  }
> >
> > +detect_mac80211_unlock_trap() {
> > +   lock -u /var/lock/wifi-detect-mac80211.lock
> > +}
> > +
> >  detect_mac80211() {
> > +   trap detect_mac80211_unlock_trap EXIT
> > +   lock /var/lock/wifi-detect-mac80211.lock
> > +
> > devidx=0
> > config_load wireless
> > while :; do
> > diff --git a/package/kernel/mac80211/files/mac80211.hotplug 
> > b/package/kernel/mac80211/files/mac80211.hotplug
> > new file mode 100644
> > index 000..581be3d
> > --- /dev/null
> > +++ b/package/kernel/mac80211/files/mac80211.hotplug
> > @@ -0,0 +1,5 @@
> > +#!/bin/sh
> > +
> > +[ "${ACTION}" = "add" ] && {
> > +   /sbin/wifi detect
> 
> You need to fork here, else you will get a deadlock with wifi drivers
> that request firmware on interface up instead of probe time, e.g.
> rt2x00-usb.
Are you sure that the detect_mac80211 and friends actually do bring up
the interfaces? From what I can tell, it's just iw phy info and a bit
of readlink [1].

Still, I can add a "/sbin/wifi config &" there.

Regards,
Christian

[0] 

Re: [LEDE-DEV] [PATCH v2 4/5] base-files, mac80211, broadcom-wl: plug-and-play wifi detection

2016-10-12 Thread Mathias Kresin
2016-10-12 13:32 GMT+02:00 Jonas Gorski :
>> diff --git a/package/kernel/mac80211/Makefile 
>> b/package/kernel/mac80211/Makefile
>> index 91c9362..f320326 100644
>> --- a/package/kernel/mac80211/Makefile
>> +++ b/package/kernel/mac80211/Makefile
>> @@ -1732,6 +1732,8 @@ define KernelPackage/cfg80211/install
>> $(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
>> $(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
>> $(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh 
>> $(1)/lib/netifd/wireless
>> +   $(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211
>
> Don't you also need to update /etc/hotplug.json to pass through
> ieee80211 events?

Since https://git.lede-project.org/4f3c1e779364394a7e8f9f45ee824e0dff556cec
events from all subsystems are passed through.

>> --- /dev/null
>> +++ b/package/kernel/mac80211/files/mac80211.hotplug
>> @@ -0,0 +1,5 @@
>> +#!/bin/sh
>> +
>> +[ "${ACTION}" = "add" ] && {
>> +   /sbin/wifi detect
>
> You need to fork here, else you will get a deadlock with wifi drivers
> that request firmware on interface up instead of probe time, e.g.
> rt2x00-usb.

I've to admit, I fail to see where or how a deadlock could happen
here. Using a Lantiq board with a RT3062F (PCI, firmware request on up
as well), I've moved the firmware file rt2860.bin out of
/lib/firmware/ and added a hotplug script to copy it back. I wasn't
able to trigger any deadlocks.

Well, it might be possible that my test setup isn't close enough to
the example with the rt2x00-usb to trigger a deadlock.

Anyway, would you please give an example where/how exactly the
deadlock could happen!

Mathias

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] Fwd: WPJ344 libphy not finding AR8337 for eth0.

2016-10-12 Thread Nick Dennis

Hi,
I have been using openWRT CC 1505, but want to start using LEDE. I built 
for the WPJ344, but didn't get pings to or from my PC.
I have a serial connection to the wpj344, so i can look at demsg without 
an eth connection.

For CC, the relevent lines are (some spacing added):
...
[0.85] 0x00ff-0x0100 : "art"
[0.87] libphy: ag71xx_mdio: probed
[0.87] switch0: Atheros AR8337 rev. 2 switch registered on 
ag71xx-mdio.0

[0.94] libphy: ag71xx_mdio: probed
[1.54] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 
[uid=004dd036, driver=Atheros AR8216/AR8236/AR8316]


[1.55] eth0: Atheros AG71xx at 0xb900, irq 4, mode:RGMII
[2.14] ag71xx-mdio.1: Found an AR934X built-in switch
[2.18] eth1: Atheros AG71xx at 0xba00, irq 5, mode:GMII
[2.19] TCP: cubic registered
...
For LEDE:
...
[0.904631] 0x00ff-0x0100 : "art"
[0.925684] libphy: ag71xx_mdio: probed

[0.933207] libphy: ag71xx_mdio: probed
[1.522084] ag71xx ag71xx.0: no PHY found with phy_mask=0001


[2.112580] ag71xx-mdio.1: Found an AR934X built-in switch
[2.154948] eth0: Atheros AG71xx at 0xba00, irq 5, mode:GMII
[2.163279] NET: Registered protocol family 10
...

I'll continue investigating, but has anyone else run across this? Maybe 
fixed it?


Thanks

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] WPJ344 libphy not finding AR8337 for eth0.

2016-10-12 Thread Nick Dennis

Hi,

Found the bug.
In going from CC linux 3.16.36 to LEDE 4.4.24, I guess a lot of changes 
had to be made. But, also, the sense and name of


 \target\linux\generic\files\include\linux\ar8216_platform.h struct 
ar8327_pad_cfg bool mac06_exchange_dis


was changed from mac06_exchange_en, without changing the value  in

target\linux\ar71xx\files\arch\mips\ath79\mach-wpj344.c 
wpj344_ar8327_pad0_cfg


This possibly went unnoticed because the value is not explicitly set in 
the structure.


Thanks, Nick

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] scripts: fix build warning when overriding packages

2016-10-12 Thread Zefir Kurtisi
If core packages are overridden, CONFIG_OVERRIDE_PKGS is set
based on the scan order of packages, which eventually causes
that config value to be modified on each build and with
that causes the build process to warn for configuration
being out of sync.

This commit changes the CONFIG_OVERRIDE_PKGS to be sorted
and prevents that false warning.

Signed-off-by: Zefir Kurtisi 
---
 scripts/package-metadata.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl
index 44494ef..0b8f983 100755
--- a/scripts/package-metadata.pl
+++ b/scripts/package-metadata.pl
@@ -348,7 +348,7 @@ sub print_package_overrides() {
keys %overrides > 0 or return;
print "\tconfig OVERRIDE_PKGS\n";
print "\t\tstring\n";
-   print "\t\tdefault \"".join(" ", keys %overrides)."\"\n\n";
+print "\t\tdefault \"".join(" ", sort keys %overrides)."\"\n\n";
 }
 
 sub gen_package_config() {
-- 
2.7.4


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 3/3] gettext-full: update to 0.19.8.1

2016-10-12 Thread Dirk Neukirchen
- unify configs of host/target
- disable stuff to decrease build time
- disable interactive gettextize: see
http://lists.busybox.net/pipermail/buildroot/2014-April/093394.html

Signed-off-by: Dirk Neukirchen 
---
 package/libs/gettext-full/Makefile | 18 ++
 package/libs/gettext-full/patches/001-autotools.patch  |  2 +-
 .../patches/001-no_examples_and_tests.patch|  4 ++--
 .../gettext-full/patches/120-uclibc-nolocale.patch |  2 +-
 .../patches/150-disable_libxml_iconv.patch |  4 ++--
 5 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/package/libs/gettext-full/Makefile 
b/package/libs/gettext-full/Makefile
index abe311f..eb4236b 100644
--- a/package/libs/gettext-full/Makefile
+++ b/package/libs/gettext-full/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gettext-full
-PKG_VERSION:=0.19.6
-PKG_RELEASE:=3
+PKG_VERSION:=0.19.8.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=gettext-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/gettext
-PKG_MD5SUM:=69d79254ee3b41df23f41c2f4fd720d9
+PKG_MD5SUM:=df3f5690eaa30fd228537b00cb7b7590
 PKG_BUILD_DIR:=$(BUILD_DIR)/gettext-$(PKG_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/gettext-$(PKG_VERSION)
 
@@ -46,6 +46,7 @@ endif
 CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
+   --disable-libasprintf \
--disable-rpath \
--enable-nls \
--disable-java \
@@ -58,7 +59,14 @@ CONFIGURE_ARGS += \
--without-emacs
 
 HOST_CONFIGURE_ARGS += \
-   --with-included-libxml --without-libxml2-prefix --with-included-libcroco
+   --disable-libasprintf \
+   --disable-rpath \
+   --disable-java \
+   --disable-native-java \
+   --disable-openmp \
+   --without-emacs \
+   --without-libxml2-prefix
+
 
 HOST_CONFIGURE_VARS += \
EMACS="no"
@@ -72,6 +80,8 @@ define Build/InstallDev
 
$(INSTALL_DIR) $(1)/usr/share/aclocal
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/* 
$(1)/usr/share/aclocal/
+
+   $(SED) '/read dummy/d' $(STAGING_DIR)/host/bin/gettextize
 endef
 
 define Package/libintl-full/install
diff --git a/package/libs/gettext-full/patches/001-autotools.patch 
b/package/libs/gettext-full/patches/001-autotools.patch
index 2f23c8e..4b1799f 100644
--- a/package/libs/gettext-full/patches/001-autotools.patch
+++ b/package/libs/gettext-full/patches/001-autotools.patch
@@ -12,7 +12,7 @@
  $(INSTALL_DATA) $$dir/$$file $(DESTDIR)$(htmldir)/$$file; \
 --- a/gettext-tools/man/Makefile.am
 +++ b/gettext-tools/man/Makefile.am
-@@ -154,8 +154,7 @@ recode-sr-latin.1.html: recode-sr-latin.
+@@ -153,8 +153,7 @@ recode-sr-latin.1.html: recode-sr-latin.
  gettextize.1.html: gettextize.1
  autopoint.1.html: autopoint.1
  
diff --git a/package/libs/gettext-full/patches/001-no_examples_and_tests.patch 
b/package/libs/gettext-full/patches/001-no_examples_and_tests.patch
index 97353b1..abb1b24 100644
--- a/package/libs/gettext-full/patches/001-no_examples_and_tests.patch
+++ b/package/libs/gettext-full/patches/001-no_examples_and_tests.patch
@@ -15,8 +15,8 @@
  AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies
  ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I 
libgrep/gnulib-m4 -I libgettextpo/gnulib-m4
  
--SUBDIRS = doc intl gnulib-lib libgrep src libgettextpo po projects styles 
misc man m4 tests gnulib-tests examples
-+SUBDIRS = intl gnulib-lib libgrep src libgettextpo po projects styles misc m4
+-SUBDIRS = doc intl gnulib-lib libgrep src libgettextpo po projects styles 
misc man m4 tests gnulib-tests examples its
++SUBDIRS = intl gnulib-lib libgrep src libgettextpo po projects styles misc m4 
its
  
  EXTRA_DIST = misc/DISCLAIM
  MOSTLYCLEANFILES = core *.stackdump
diff --git a/package/libs/gettext-full/patches/120-uclibc-nolocale.patch 
b/package/libs/gettext-full/patches/120-uclibc-nolocale.patch
index 4c6a73e..40ca10e 100644
--- a/package/libs/gettext-full/patches/120-uclibc-nolocale.patch
+++ b/package/libs/gettext-full/patches/120-uclibc-nolocale.patch
@@ -1,6 +1,6 @@
 --- a/gettext-runtime/intl/localename.c
 +++ b/gettext-runtime/intl/localename.c
-@@ -2788,7 +2788,7 @@ gl_locale_name_posix (int category, cons
+@@ -2790,7 +2790,7 @@ gl_locale_name_posix (int category, cons
  {
/* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
   On some systems this can be done by the 'setlocale' function itself.  */
diff --git a/package/libs/gettext-full/patches/150-disable_libxml_iconv.patch 
b/package/libs/gettext-full/patches/150-disable_libxml_iconv.patch
index a8f5a5c..da037fe 100644
--- a/package/libs/gettext-full/patches/150-disable_libxml_iconv.patch
+++ b/package/libs/gettext-full/patches/150-disable_libxml_iconv.patch
@@ -1,6 +1,6 @@
 --- a/gettext-tools/gnulib-lib/libxml/xmlversion.in.h
 +++ b/gettext-tools/gnulib-lib/libxml/xmlversion.in.h
-@@ -263,7 +263,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(i
+@@ -273,7 +273,7 @@ 

[LEDE-DEV] gettext-full: update to 0.19.8.1

2016-10-12 Thread Dirk Neukirchen
Daniel Engberg asked for updates and I have this series in my local tree
since some time but hesitated to commit

I did several builds with all packages/kmods for ar71xx and
probably other targets I cannot remember and have seen no issues
from this patch on my build system



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 2/3] autotools: use correct version for gettext FIXUP

2016-10-12 Thread Dirk Neukirchen
0.19.8.1 gettext-full uses "archive-version" of 0.19.8
to replace makros, leading to breakage of PKG_FIXUP:=gettext-version

Signed-off-by: Dirk Neukirchen 
---
 include/autotools.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/autotools.mk b/include/autotools.mk
index 259569b..63edd5b 100644
--- a/include/autotools.mk
+++ b/include/autotools.mk
@@ -85,7 +85,7 @@ endef
 
 define gettext_version_target
(cd $(PKG_BUILD_DIR) && \
-   GETTEXT_VERSION=$(shell $(STAGING_DIR)/host/bin/gettext -V | 
$(STAGING_DIR_HOST)/bin/sed -ne '1s/.* //p') && \
+   GETTEXT_VERSION=$(shell $(STAGING_DIR)/host/bin/gettext -V | 
$(STAGING_DIR_HOST)/bin/sed -ne '1s/.*\([0-9]\.[0-9]\{2\}\.[0-9]\).*/\1/p' ) && 
\
$(STAGING_DIR_HOST)/bin/sed \
-i $(PKG_BUILD_DIR)/configure.ac \
-e 
"s/AM_GNU_GETTEXT_VERSION(.*)/AM_GNU_GETTEXT_VERSION(\[GETTEXT_VERSION\])/g"
 && \
-- 
2.10.0


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH 1/3] gettext: fix whitespace

2016-10-12 Thread Dirk Neukirchen
Signed-off-by: Dirk Neukirchen 
---
 package/libs/gettext/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/libs/gettext/Makefile b/package/libs/gettext/Makefile
index cb4ee12..1672b47 100644
--- a/package/libs/gettext/Makefile
+++ b/package/libs/gettext/Makefile
@@ -27,7 +27,7 @@ endef
 define Build/Prepare
$(INSTALL_DIR) $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
-endef  
+endef
 
 define Build/Configure
 endef
-- 
2.10.0


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] per device rootfs vs multiple devices

2016-10-12 Thread Karl Palsson

Matthias Schiffer  wrote:
> Hi,
> {*} means that the package can't be disabled completely, but it can be set
> to M. This should give you the desired behaviour.

Right, ok. This is one of those things that's not in the Kconfig
legend. (Not in kernel upstream either, just magic knowledge) I
presume it comes from reusing modules as targets or something.

> 
> Creating a new config and setting
> CONFIG_TARGET_PER_DEVICE_ROOTFS from the beginning also works
> and sets all used DEVICE_PACKAGES to M. As your workflow
> created a config with these packages set to * first, you ended
> up with these packages still being selected after switching to
> CONFIG_TARGET_PER_DEVICE_ROOTFS.

Right, yes. After manually making some config stubs and applying
"make defconfig" I get the expected behaviour of device packages
only in the device. Pretty high surprise factor for the way
menuconfig works, but ok, that's what I'm adding the
documentation for :)

It would be _nice_ if the help in kconfig could say where it had
been pulled in from too, but I live with that. currently it just
says...

"Selected by: MODULE_DEFAULT_avrdude [=y] &&
TARGET_PER_DEVICE_ROOTFS [=y] && m && MODULES [=y]"

but not what "module" it was that pulled it in.
 
> The additional rootfs aren't ever copied to the bin directory,
> so finding only a single lede-ar71xx-generic-root.squashfs is
> expected.

The other things I can document, but this seems just wrong. If
you have a per device rootfs, what would even be _in_ the
"generic" one? Surely if you have chosen per device rootfs, you
expect to get per device rootfs?

In any case, this per device rootfs setting makes a complete mess
of scripts/diffconfig.sh. I get duplicate lines for each target,
and now _al_ of the base core packages that were untouched
are now marked as explicitly selected.
CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_dragino2=""
<< duplicated

Sincerely,
Karl Palsson

signature.asc
Description: OpenPGP Digital Signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] scripts: case insensitive sort device names

2016-10-12 Thread Karl Palsson
When selecting devices from the Target Devices menu, the brand choices
of naming makes it confusing to find particular devices by name, as the
sorting is case sensitve.  AirTight came after ALFA, and devolo and
jjPlus both came after Zyxel.

This does _not_ apply to the Target Profile list, as that includes
"Default - all profiles" inside the profile list.

Signed-off-by: Karl Palsson 
---
 scripts/target-metadata.pl | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl
index 3422572d1639..7f7dc6d4ee77 100755
--- a/scripts/target-metadata.pl
+++ b/scripts/target-metadata.pl
@@ -276,8 +276,12 @@ menu "Target Devices"
 
 EOF
foreach my $target (@target) {
-   my $profiles = $target->{profiles};
-   foreach my $profile (@{$target->{profiles}}) {
+   my @profiles = sort {
+   my $x = $a->{name};
+   my $y = $b->{name};
+   "\L$x" cmp "\L$y";
+   } @{$target->{profiles}};
+   foreach my $profile (@profiles) {
next unless $profile->{id} =~ /^DEVICE_/;
print <{conf}_$profile->{id}
-- 
2.4.11


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2 2/5] mac80211: use uci to generate wireless config file

2016-10-12 Thread Matthias Schiffer
On 10/12/2016 01:42 PM, Jonas Gorski wrote:
> On 11 October 2016 at 13:37, Christian Lamparter
>  wrote:
>> Previously, wifi detect simply dumped its generated wireless
>> configuration out to STDOUT. A second step was needed to
>> append the configuration to /etc/config/wireless (or create
>> it, if it didn't exist).
>>
>> With this patch, The wifi detection script will now use uci
>> to update the wireless configuration directly.
>>
>> Note: uci writes a "cfg123456" printout to stdout when it
>> generates a name for the unnamed section ("add wireless wifi-iface").
> 
> This rather sounds like a bug in uci, at least I would expect it to
> generate no output if it is invoked with "-q", neither on stdout nor
> stderr.
> 
>> Since we currently pipe wifi detect into /etc/config/wireless, we
>> have to redirected this output, so it doesn't end up in the wireless
>> configuration file.
> 
> I wonder if it wouldn't be better to keep "detect" output to stdout,
> and add a new command that modifies the uci config (e.g. "update" or
> "refresh"). People might rely/expect the current behavior, and get
> confused when it stops working.
> 
> 
> Jonas
> 

Maybe we could just rename wifi-detect to something different, so nobody
would expect the old behaviour? Keeping two separate code paths doesn't
seem like a good idea to me.

Regards,
Matthias



signature.asc
Description: OpenPGP digital signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ramips: add support for Planex VR500.

2016-10-12 Thread Rafał Miłecki
On 10 October 2016 at 03:24, YuheiOKAWA  wrote:
> SOC:MT7621A
> RAM:256MiB
> NOR:MX25L51245G
>
> Non Wireless Router.
>
> Issue: soft reboot problem. SPI Flash donot exit 4byte address mode.
>
> Signed-off-by: YuheiOKAWA 

There is some problem with patchwork and name assigned to Yuhei:
https://patchwork.ozlabs.org/patch/680158/
(it shows up as @SRCHACK.ORG)

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Support for KEY_BRIGHTNESS_ZERO

2016-10-12 Thread Rafał Miłecki
On 12 October 2016 at 13:16, Karl Palsson  wrote:
> Rafał Miłecki   wrote:
>> There are some (rare) devices with a button for disabling LEDs
>> (e.g. ASUS RT-AC68U). I'm looking for a way to support such a
>> feature. Maybe at some point we could also support it as an
>> extra feature triggerable from UI.
>>
>> So basically I probably need to add some smart /etc/rc.button/
>> handler. Unfortunately I don't have a good idea for that.
>>
>> I can't relay on /etc/config/system and LEDs there as not all
>> of them are specified there. Many LEDs don't require changing
>> and they are set to default state based on platform/DT data.
>>
>> So I guess I should somehow store state of all LEDs from
>> /sys/class/leds/ and set their triggers to "none". When
>> receiving KEY_BRIGHTNESS_ZERO I should restore the state.
>>
>> Any tips for implementing this? There are various triggers with
>> various extra settings in /sys/class/leds/*/
>>
>
> Related, even with leds set in /etc/config/system, their triggers
> aren't setup until S96. How can they get setup earlier?

Well, replace 96 with a lower value? Sounds trivial to try.

> I've got
> a daemon that wants a led trigger file to be passed in for it to
> write to on activity, but the triggers aren't set. Is
> /etc/config/system ever actually useful for leds?

It is as long as you don't use some specific deamon I guess. Works for
me just fine.

-- 
Rafał

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2 4/5] base-files, mac80211, broadcom-wl: plug-and-play wifi detection

2016-10-12 Thread Jonas Gorski
Hi,

On 11 October 2016 at 13:37, Christian Lamparter
 wrote:
> Currently, the wifi detection script is executed as part of
> the (early) boot process. Pluggable wifi USB devices, which
> are inserted at a later time are not automatically
> detected and therefore they don't show up in LuCI.
>
> A user has to deal with wifi detection manually, or restart
> the router.
>
> However, the current "sleep 1" window - which the boot
> process waits for wifi devices to "settle down" - is too
> short to detect wifi devices for some routers anyway.
>
> For example, this can happen with USB WLAN devices on the
> WNDR4700. This is because the usb controller needs to load
> its firmware from UBI and initialize, before it can operate.
>
> The issue can be seen on a BT HomeHub 5A as well as soon as
> the caldata are on an ubi volume. This is because the ath9k
> card has to be initialized by owl-loader first. Which has to
> wait for the firmware extraction script to retrieve the pci
> initialization values inside the caldata.
>
> This patch moves the wifi detection to hotplug scripts.
> For mac80211, the wifi detection will now automatically
> run any time a "ieee80211" device is added. Likewise
> broadcom-wl's script checks for new "net" devices which
> have the "wl$NUMBERS" moniker.
>
> File locking has been added to the detection scripts in
> order to prevent races during discovery. The locking code
> will protect against adding more open wireless network
> configurations. In case "wifi detect" is run manually
> by the user at a bad time.
>
> All changes to base-files, mac80211 and broadcom-wl packages
> have been integrated into a single patch to play nice with
> git bisect.
>
> Thanks to Martin Blumenstingl for helping with the implementation
> and testing of the patch.

Funny enough I did something similar recently, but didn't submit it
here yet because there is some ugliness. A few comments ...

>
> Acked-by: Jo-Philipp Wich 
> Signed-off-by: Mathias Kresin 
> Signed-off-by: Christian Lamparter 
>
> ---
> v1 -> v2:
> - filter for broadcom devices (Mathias)
> - integrate uci changes (no more /tmp/wireless.tmp)
> - move locking to detect_mac80211 and detect_broadcom
> ---
> ---
>  package/base-files/files/etc/init.d/boot | 9 
> -
>  .../broadcom-wl/files/etc/hotplug.d/net/00-broadcom-wifi-detect  | 5 +
>  package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh| 6 ++
>  package/kernel/mac80211/Makefile | 2 ++
>  package/kernel/mac80211/files/lib/wifi/mac80211.sh   | 7 +++
>  package/kernel/mac80211/files/mac80211.hotplug   | 5 +
>  6 files changed, 25 insertions(+), 9 deletions(-)
>  create mode 100644 
> package/kernel/broadcom-wl/files/etc/hotplug.d/net/00-broadcom-wifi-detect
>  create mode 100644 package/kernel/mac80211/files/mac80211.hotplug
>
> diff --git a/package/base-files/files/etc/init.d/boot 
> b/package/base-files/files/etc/init.d/boot
> index 904f7db..1d61f2f 100755
> --- a/package/base-files/files/etc/init.d/boot
> +++ b/package/base-files/files/etc/init.d/boot
> @@ -38,15 +38,6 @@ boot() {
>
> /sbin/kmodloader
>
> -   # allow wifi modules time to settle
> -   sleep 1
> -
> -   /sbin/wifi detect > /tmp/wireless.tmp
> -   [ -s /tmp/wireless.tmp ] && {
> -   cat /tmp/wireless.tmp >> /etc/config/wireless
> -   }
> -   rm -f /tmp/wireless.tmp
> -
> /bin/config_generate
> uci_apply_defaults
>
> diff --git 
> a/package/kernel/broadcom-wl/files/etc/hotplug.d/net/00-broadcom-wifi-detect 
> b/package/kernel/broadcom-wl/files/etc/hotplug.d/net/00-broadcom-wifi-detect
> new file mode 100644
> index 000..6ced270
> --- /dev/null
> +++ 
> b/package/kernel/broadcom-wl/files/etc/hotplug.d/net/00-broadcom-wifi-detect
> @@ -0,0 +1,5 @@
> +#!/bin/sh
> +
> +[ "${ACTION}" = "add" ] && [ "${INTERFACE%%[0-9]*}" = "wl" ] {
> +   /sbin/wifi detect
> +}
> diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh 
> b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
> index 1881b46..264e01b 100644
> --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
> +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh
> @@ -446,10 +446,16 @@ EOF
> eval "$nas_cmd"
>  }
>
> +detect_unlock_broadcom_trap() {
> +   lock -u /var/lock/wifi-detect-broadcom.lock
> +}
>
>  detect_broadcom() {
> local i=-1
>
> +   trap detect_unlock_broadcom_trap EXIT
> +   lock /var/lock/wifi-detect-broadcom.lock
> +
> while grep -qs "^ *wl$((++i)):" /proc/net/dev; do
> local channel type
>
> diff --git a/package/kernel/mac80211/Makefile 
> b/package/kernel/mac80211/Makefile
> index 91c9362..f320326 100644
> --- a/package/kernel/mac80211/Makefile
> +++ b/package/kernel/mac80211/Makefile
> @@ -1732,6 +1732,8 @@ 

Re: [LEDE-DEV] per device rootfs vs multiple devices

2016-10-12 Thread Matthias Schiffer
On 10/12/2016 12:59 PM, Karl Palsson wrote:
> 
> Hi,
> 
> I was trying to add help text to the generated Kconfig for the
> CONFIG_TARGET_MULTI_PROFILE and CONFIG_TARGET_PER_DEVICE_ROOTFS
> settings based on some irc conversations with nbd, and was trying
> out the behaviour to verify my help text.
> 
> The text I've got for per device rootfs is:
> 
> "When disabled, all device packages from all selected devices
> will be included in all images. When enabled, this is split,
> however you can no longer disable individual device packages."
> 
> I locally modified two targets to have extra "DEVICE_PACKAGES"
> (Added avrdude to one target and sqlite3-cli to another)
> 
> Doing a full "make clean; rm .config, menuconfig; select multi
> profile, select two devices; make" _without_ per device rotofs,
> gives me an image with both device packages in both device
> images, as expected. In menuconfig, the two packages are marked
> as * by default, but can be deselected, or changed to M without
> problem.
> 
> However, enabling CONFIG_TARGET_PER_DEVICE_ROOTFS seems to only
> be affecting the select/deselect behaviour. The two packages are
> now shown in menuconfig as {*} and can't be disabled anymore.
> That is as per nbd's description. But with the full make clean,
> rm .config builds, _both_ target images are still including both
> packages. Further, there's only a single rootfs file built in the
> bin directory. "lede-ar71xx-generic-root.squashfs"
> 
> I presume this is a bug in the PER_DEVICE_ROOTFS support, but it
> could also just be that the documentation isn't clear and I
> misunderstood nbd's description.
> 
> Directions?
> 
> Sincerely,
> Karl Palsson

Hi,
{*} means that the package can't be disabled completely, but it can be set
to M. This should give you the desired behaviour.

Creating a new config and setting CONFIG_TARGET_PER_DEVICE_ROOTFS from the
beginning also works and sets all used DEVICE_PACKAGES to M. As your
workflow created a config with these packages set to * first, you ended up
with these packages still being selected after switching to
CONFIG_TARGET_PER_DEVICE_ROOTFS.

The additional rootfs aren't ever copied to the bin directory, so finding
only a single lede-ar71xx-generic-root.squashfs is expected.

Regards,
Matthias



signature.asc
Description: OpenPGP digital signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Support for KEY_BRIGHTNESS_ZERO

2016-10-12 Thread Karl Palsson

Rafał Miłecki   wrote:
> There are some (rare) devices with a button for disabling LEDs
> (e.g. ASUS RT-AC68U). I'm looking for a way to support such a
> feature. Maybe at some point we could also support it as an
> extra feature triggerable from UI.
> 
> So basically I probably need to add some smart /etc/rc.button/
> handler. Unfortunately I don't have a good idea for that.
> 
> I can't relay on /etc/config/system and LEDs there as not all
> of them are specified there. Many LEDs don't require changing
> and they are set to default state based on platform/DT data.
> 
> So I guess I should somehow store state of all LEDs from
> /sys/class/leds/ and set their triggers to "none". When
> receiving KEY_BRIGHTNESS_ZERO I should restore the state.
> 
> Any tips for implementing this? There are various triggers with
> various extra settings in /sys/class/leds/*/
> 

Related, even with leds set in /etc/config/system, their triggers
aren't setup until S96. How can they get setup earlier? I've got
a daemon that wants a led trigger file to be passed in for it to
write to on activity, but the triggers aren't set. Is
/etc/config/system ever actually useful for leds?

Sincerely,
Karl Palsson

signature.asc
Description: OpenPGP Digital Signature
___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ubus cli: wait_for: fix race causing false timeouts

2016-10-12 Thread Zefir Kurtisi
On 10/07/2016 03:19 PM, Zefir Kurtisi wrote:
> On 10/07/2016 02:15 PM, Alexandru Ardelean wrote:
>> On Fri, Oct 7, 2016 at 3:09 PM, Felix Fietkau  wrote:
>>> Instead of introducing yet another timer, wouldn't it also be possible
>>> to close this race window by registering the event handler before
>>> attempting the lookup?
>>>
>>> - Felix
>>
>> I've also seen this race.
>> I tried something like this:
>> https://github.com/commodo/ubus/commit/8c3986caaa7cd2c12f2b8907ceea54c5bdce3bd2
>>
>> But never got around to doing much testing to see if the race goes
>> away completely.
>> So, I never pushed it upstream.
>>
>> @Zefir, maybe you could try it ?
>>
>> Thanks
>> Alex
>>
> Hi Alex,
> 
> your assumption is right, that's the root cause for the random timeouts.
> 
> Unfortunately, it is hard to provide a positive proof, since for me the effect
> went away when I added some logging in between.
> 
> My patch made it disappear, but of course what Felix suggests and you already
> implemented is the better approach. I'll take your commit instead and test it.
> From looking at the changes it should do, but to get some confidence it will 
> take
> some time.
> 
> 
After some days of testing, it seems like the patch fixes the race.

Alex, feel free to add me to the 'Tested-by' list if you are going to make a 
pull
request for that commit.


Cheers,
Zefir


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev