[OpenWrt-Devel] [PATCH] {, gpio}-button-hotplug: remove check on CONFIG_HOTPLUG for Kernel = 3.11

2014-05-15 Thread Stefan Hellermann
CONFIG_HOTPLUG was removed in Linux kernel 3.11, so remove
the #ifdef in button-hotplug and gpio-button-hotplug kernel modules.

Reported in Trac ticket #16413.

The Patch is untested on kernel version  3.11

Signed-off-by: Stefan Hellermann ste...@the2masters.de
---
 package/kernel/button-hotplug/src/button-hotplug.c   | 4 ++--
 package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/kernel/button-hotplug/src/button-hotplug.c 
b/package/kernel/button-hotplug/src/button-hotplug.c
index 8f84eb1..a11fd46 100644
--- a/package/kernel/button-hotplug/src/button-hotplug.c
+++ b/package/kernel/button-hotplug/src/button-hotplug.c
@@ -208,7 +208,7 @@ static int button_hotplug_create_event(const char *name, 
unsigned long seen,
 
 /* -*/
 
-#ifdef CONFIG_HOTPLUG
+#if ( LINUX_VERSION_CODE = KERNEL_VERSION(3,11,0) ) || defined ( 
CONFIG_HOTPLUG )
 static int button_get_index(unsigned int code)
 {
int i;
@@ -244,7 +244,7 @@ static void button_hotplug_event(struct input_handle 
*handle,
   unsigned int type, unsigned int code, int value)
 {
 }
-#endif /* CONFIG_HOTPLUG */
+#endif /* LINUX_VERSION_CODE = KERNEL_VERSION(3,11,0) || 
defined(CONFIG_HOTPLUG) */
 
 static int button_hotplug_connect(struct input_handler *handler,
struct input_dev *dev, const struct input_device_id *id)
diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c 
b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
index 6b69d27..4f0ee03 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -224,7 +224,7 @@ static int button_hotplug_create_event(const char *name, 
unsigned int type,
 
 /* -*/
 
-#ifdef CONFIG_HOTPLUG
+#if ( LINUX_VERSION_CODE = KERNEL_VERSION(3,11,0) ) || defined ( 
CONFIG_HOTPLUG )
 static int button_get_index(unsigned int code)
 {
int i;
@@ -261,7 +261,7 @@ static void button_hotplug_event(struct 
gpio_keys_button_data *data,
   unsigned int type, int value)
 {
 }
-#endif /* CONFIG_HOTPLUG */
+#endif /* LINUX_VERSION_CODE = KERNEL_VERSION(3,11,0) || 
defined(CONFIG_HOTPLUG) */
 
 struct gpio_keys_button_dev {
int polled;
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] base-files: add simple shutdown script

2014-05-15 Thread Stefan Hellermann
Since svn rev [38557] we support power buttons, for example
the ACPI power button on x86 machines.
Add a simple shutdown script to /etc/rc.button, to gracefully shutdown
the machine after the power button is pressed.

Tested on x86 and x86_64 in a kvm virtual machine.

Signed-off-by: Stefan Hellermann ste...@the2masters.de
---
 package/base-files/files/etc/rc.button/power | 5 +
 1 file changed, 5 insertions(+)
 create mode 100644 package/base-files/files/etc/rc.button/power

diff --git a/package/base-files/files/etc/rc.button/power 
b/package/base-files/files/etc/rc.button/power
new file mode 100644
index 000..0cb74b9
--- /dev/null
+++ b/package/base-files/files/etc/rc.button/power
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ ${ACTION} = released ] || exit 0
+
+exec /sbin/poweroff
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] base-files: add simple shutdown script

2014-05-15 Thread Stefan Hellermann
2014-05-15 12:27 GMT+02:00 Stefan Hellermann ste...@the2masters.de:

 Since svn rev [38557] we support power buttons, for example
 the ACPI power button on x86 machines.
 Add a simple shutdown script to /etc/rc.button, to gracefully shutdown
 the machine after the power button is pressed.

 Tested on x86 and x86_64 in a kvm virtual machine.

 Signed-off-by: Stefan Hellermann ste...@the2masters.de
 ---
  package/base-files/files/etc/rc.button/power | 5 +
  1 file changed, 5 insertions(+)
  create mode 100644 package/base-files/files/etc/rc.button/power

 diff --git a/package/base-files/files/etc/rc.button/power
 b/package/base-files/files/etc/rc.button/power
 new file mode 100644


This should be mode 100755


 index 000..0cb74b9
 --- /dev/null
 +++ b/package/base-files/files/etc/rc.button/power
 @@ -0,0 +1,5 @@
 +#!/bin/sh
 +
 +[ ${ACTION} = released ] || exit 0
 +
 +exec /sbin/poweroff
 --
 1.9.1


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


[OpenWrt-Devel] [PATCH] [ramips] Add support for samsung cy-swr1100 wireless router

2014-05-15 Thread michael lee
It is base on rt3662 soc with dual band 802.11n
wireless router. Use rtl8367R switch chip.
This patch adds a profile for this board.
It use seama image header. so i also enable it
on kernel config.

Signed-off-by: michael lee igv...@gmail.com
---
 target/linux/ramips/base-files/etc/diag.sh |   3 +
 .../etc/hotplug.d/firmware/10-rt2x00-eeprom|   4 +
 .../ramips/base-files/etc/uci-defaults/01_leds |   4 +
 .../ramips/base-files/etc/uci-defaults/02_network  |   8 ++
 .../etc/uci-defaults/09_fix-seama-header   |   1 +
 .../ramips/base-files/lib/preinit/06_set_iface_mac |   1 +
 target/linux/ramips/base-files/lib/ramips.sh   |   3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ramips/dts/CY-SWR1100.dts | 135 +
 target/linux/ramips/image/Makefile |   3 +
 target/linux/ramips/rt3883/config-3.10 |   1 +
 target/linux/ramips/rt3883/profiles/samsung.mk |  16 +++
 12 files changed, 180 insertions(+)
 create mode 100644 target/linux/ramips/dts/CY-SWR1100.dts
 create mode 100644 target/linux/ramips/rt3883/profiles/samsung.mk

diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 075562a..d4d484c 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -27,6 +27,9 @@ get_status_led() {
br6425 | br-6475nd)
status_led=edimax:green:power
;;
+   cy-swr1100)
+   status_led=samsung:blue:wps
+   ;;
d105)
status_led=d105:red:power
;;
diff --git 
a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 
b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index 341fd5f..f9db677 100644
--- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -70,6 +70,7 @@ case $FIRMWARE in
broadway | \
br6524n | \
carambola | \
+   cy-swr1100 | \
d105 | \
dcs-930 | \
dir-300-b7 | \
@@ -135,6 +136,9 @@ case $FIRMWARE in
 
 rt2x00pci_1_0.eeprom)
case $board in
+   cy-swr1100)
+   rt2x00_eeprom_extract factory 8192 512
+   ;;
rt-n56u | whr-600d)
rt2x00_eeprom_extract factory 32768 512
;;
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds 
b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
index 74ba0ba..23c2451 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
@@ -60,6 +60,10 @@ case $board in
br6524n)
set_wifi_led edimax:blue:wlan
;;
+   cy-swr1100)
+   ucidef_set_led_default wps WPS samsung:blue:wps 0
+   set_usb_led samsung:blue:usb
+   ;;
d105)
ucidef_set_led_default power POWER d105:red:power 1
set_usb_led d105:green:usb
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network 
b/target/linux/ramips/base-files/etc/uci-defaults/02_network
index b66d176..b9524f6 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network
@@ -78,6 +78,13 @@ ramips_setup_interfaces()
ucidef_add_switch_vlan switch0 1 1 2 3 4 6t
;;
 
+   cy-swr1100)
+   ucidef_set_interfaces_lan_wan eth0.1 eth0.2
+   ucidef_add_switch switch0 1 1
+   ucidef_add_switch_vlan switch0 1 0 1 2 3 9t
+   ucidef_add_switch_vlan switch0 2 4 9t
+   ;;
+
dir-610-a1 | \
dir-300-b7 | \
dir-320-b1 | \
@@ -205,6 +212,7 @@ ramips_setup_macs()
wan_mac=$(macaddr_add $lan_mac 1)
;;
 
+   cy-swr1100 | \
dir-645)
lan_mac=$(mtd_get_mac_ascii nvram lanmac)
wan_mac=$(mtd_get_mac_ascii nvram wanmac)
diff --git 
a/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header 
b/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header
index d8bed79..a6c392c 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header
+++ b/target/linux/ramips/base-files/etc/uci-defaults/09_fix-seama-header
@@ -14,6 +14,7 @@ fix_seama_header() {
 board=$(ramips_board_name)
 
 case $board in
+cy-swr1100 | \
 dir-645)
fix_seama_header kernel
;;
diff --git a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac 
b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
index 7ff6e3d..8538c13 100644
--- a/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
+++ b/target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
@@ -51,6 +51,7 @@ preinit_set_mac_address() {

[OpenWrt-Devel] mpd breaks openwrt compilation

2014-05-15 Thread Ernesto

Hi all,

I'm compiling trunk r40755. I can add some feeds:

./scripts/feeds update
./scripts/feeds install luci-light alsa-utils bluez-utils

and with menuconfig I can select those packages and compile all right. 
But when I add mpd:


./scripts/feeds install mpd

and select it with menuconfig, the compilation breaks with the following 
error:


make[3]: Entering directory 
'/hulk/bwf/mnt_trunk/trunk/feeds/packages/libs/glib2'
(cd /hulk/bwf/mnt_trunk/trunk/build_dir/host/glib-2.37.7/; if [ -x 
configure ]; then cp -fpR 
/hulk/bwf/mnt_trunk/trunk/scripts/config.{guess,sub} 
/hulk/bwf/mnt_trunk/trunk/build_dir/host/glib-2.37.7//   /bin/bash 
./configure CC=gcc CFLAGS=-O2 
-I/hulk/bwf/mnt_trunk/trunk/staging_dir/host/include 
CPPFLAGS=-I/hulk/bwf/mnt_trunk/trunk/staging_dir/host/include 
LDFLAGS=-L/hulk/bwf/mnt_trunk/trunk/staging_dir/host/lib 
SHELL=/bin/bash --target=x86_64-linux-gnu --host=x86_64-linux-gnu 
--build=x86_64-linux-gnu --program-prefix= --program-suffix= 
--prefix=/hulk/bwf/mnt_trunk/trunk/staging_dir/host 
--exec-prefix=/hulk/bwf/mnt_trunk/trunk/staging_dir/host 
--sysconfdir=/hulk/bwf/mnt_trunk/trunk/staging_dir/host/etc 
--localstatedir=/hulk/bwf/mnt_trunk/trunk/staging_dir/host/var 
--sbindir=/hulk/bwf/mnt_trunk/trunk/staging_dir/host/bin ; fi )

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes

... some lines removed ...

checking for dgettext in libc... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... no
configure: error:
*** You must have either have gettext support in your C library, or use 
the
*** GNU gettext library. 
(http://www.gnu.org/software/gettext/gettext.html


Makefile:99: recipe for target 
'/hulk/bwf/mnt_trunk/trunk/build_dir/host/glib-2.37.7/.configured' 
failed
make[3]: *** 
[/hulk/bwf/mnt_trunk/trunk/build_dir/host/glib-2.37.7/.configured] Error 
1
make[3]: Leaving directory 
'/hulk/bwf/mnt_trunk/trunk/feeds/packages/libs/glib2'
package/Makefile:159: recipe for target 
'package/feeds/packages/glib2/host/compile' failed

make[2]: *** [package/feeds/packages/glib2/host/compile] Error 2
make[2]: Leaving directory '/hulk/bwf/mnt_trunk/trunk'
package/Makefile:156: recipe for target 
'/hulk/bwf/mnt_trunk/trunk/staging_dir/target-mips_mips32_uClibc-0.9.33.2/stamp/.package_compile' 
failed
make[1]: *** 
[/hulk/bwf/mnt_trunk/trunk/staging_dir/target-mips_mips32_uClibc-0.9.33.2/stamp/.package_compile] 
Error 2

make[1]: Leaving directory '/hulk/bwf/mnt_trunk/trunk'
/hulk/bwf/mnt_trunk/trunk/include/toplevel.mk:169: recipe for target 
'world' failed

make: *** [world] Error 2


I compiled mpd successfully in trunk r39441, but I can't recreate the 
feed state at that time.


Any suggestion?

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


[OpenWrt-Devel] [PATCH] [packages] gnutls: fix build error

2014-05-15 Thread Dirk Neukirchen
build complained about cp: cannot stat ... no such file

according to Makefile.am there is
- gnutls-cli-debug
- gnutls-serv depends on OCSP

Signed-off-by: Dirk Neukirchen dirkneukirc...@web.de
---
 libs/gnutls/Makefile | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libs/gnutls/Makefile b/libs/gnutls/Makefile
index 12e12b7..fe183c3 100644
--- a/libs/gnutls/Makefile
+++ b/libs/gnutls/Makefile
@@ -195,12 +195,15 @@ endef
 define Package/gnutls-utils/install
$(INSTALL_DIR) $(1)/usr/bin
$(CP) \
-   $(PKG_INSTALL_DIR)/usr/bin/gnutls-{cli,serv} \
+   $(PKG_INSTALL_DIR)/usr/bin/gnutls-cli-debug \
$(1)/usr/bin/
 ifeq ($(CONFIG_GNUTLS_OCSP),y)
$(CP) \
$(PKG_INSTALL_DIR)/usr/bin/ocsptool \
$(1)/usr/bin/
+   $(CP) \
+   $(PKG_INSTALL_DIR)/usr/bin/gnutls-serv \
+   $(1)/usr/bin/
 endif
 ifeq ($(CONFIG_GNUTLS_SRP),y)
$(CP) \
-- 
2.0.0.rc2




smime.p7s
Description: S/MIME Cryptographic Signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ramips: Support for Teltonika RUT5XX

2014-05-15 Thread Steve Weinreich
Added support for Teltonika RUT5XX hardware.

Signed-off-by: Steffen Weinreich st...@weinreich.org
---
 target/linux/ramips/base-files/etc/diag.sh |  3 +
 .../etc/hotplug.d/firmware/10-rt2x00-eeprom|  1 +
 target/linux/ramips/base-files/lib/ramips.sh   |  3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |  1 +
 target/linux/ramips/dts/RUT5XX.dts | 86 ++
 target/linux/ramips/image/Makefile |  3 +
 6 files changed, 97 insertions(+)
 create mode 100644 target/linux/ramips/dts/RUT5XX.dts

diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 075562a..ad9bbd7 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -170,6 +170,9 @@ get_status_led() {
na930)
status_led=na930:blue:power
;;
+   rut5xx)
+   status_led=rut5xx:green:status
+   ;;
esac
 }
 
diff --git 
a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 
b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index 341fd5f..dd8c0f7 100644
--- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -119,6 +119,7 @@ case $FIRMWARE in
ur-326n4g | \
ur-336un | \
xdxrn502j | \
+   rut5xx | \
hg255d)
rt2x00_eeprom_extract factory 0 512
;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 7f221f8..4619bef 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -211,6 +211,9 @@ ramips_board_detect() {
*RT-N56U)
name=rt-n56u
;;
+   *RUT5XX)
+   name=rut5xx
+   ;;
*Skyline SL-R7205*)
name=sl-r7205
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index d8098b2..c85ee0f 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -69,6 +69,7 @@ platform_check_image() {
rt-n14u | \
rt-n15 | \
rt-n56u | \
+   rut5xx | \
sl-r7205 | \
tew-691gr | \
tew-692gr | \
diff --git a/target/linux/ramips/dts/RUT5XX.dts 
b/target/linux/ramips/dts/RUT5XX.dts
new file mode 100644
index 000..530b8b1
--- /dev/null
+++ b/target/linux/ramips/dts/RUT5XX.dts
@@ -0,0 +1,86 @@
+/dts-v1/;
+
+/include/ rt3050.dtsi
+
+/ {
+   compatible = RUT5XX, ralink,rt3050-soc;
+   model = Teltonika RUT5XX;
+
+   palmbus@1000 {
+   spi@b00 {
+   status = okay;
+   m25p80@0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = n25q128a13;
+   reg = 0 0;
+   linux,modalias = m25p80, n25q128a13;
+   spi-max-frequency = 1000;
+
+   partition@0 {
+   label = u-boot;
+   reg = 0x0 0x3;
+   read-only;
+   };
+
+   partition@3 {
+   label = u-boot-env;
+   reg = 0x3 0x1;
+   read-only;
+   };
+
+   factory: partition@4 {
+   label = factory;
+   reg = 0x4 0x1;
+   read-only;
+   };
+
+   partition@5 {
+   label = firmware;
+   reg = 0x5 0xfb;
+   };
+   };
+   };
+   };
+
+   pinctrl {
+   state_default: pinctrl0 {
+   gpio {
+   ralink,group = i2c, jtag, rgmii, mdio, 
uartf;
+   ralink,function = gpio;
+   };
+   };
+   };
+
+ethernet@1010 {
+mtd-mac-address = factory 0x28;
+};
+
+   esw@1011 {
+   ralink,portmap = 0x3e;
+   };
+
+   gpio-leds {
+   compatible = gpio-leds;
+   status {
+   label = rut5xx:green:status;
+   gpios = gpio0 14 1;
+  

Re: [OpenWrt-Devel] [PATCH] ramips: Support for Teltonika RUT5XX

2014-05-15 Thread Hartmut Knaack
Steve Weinreich schrieb:
 Added support for Teltonika RUT5XX hardware.

 Signed-off-by: Steffen Weinreich st...@weinreich.org
Please don't mess up alphabetic order more than it already is. Pointed out 
below:
 ---
  target/linux/ramips/base-files/etc/diag.sh |  3 +
  .../etc/hotplug.d/firmware/10-rt2x00-eeprom|  1 +
  target/linux/ramips/base-files/lib/ramips.sh   |  3 +
  .../ramips/base-files/lib/upgrade/platform.sh  |  1 +
  target/linux/ramips/dts/RUT5XX.dts | 86 
 ++
  target/linux/ramips/image/Makefile |  3 +
  6 files changed, 97 insertions(+)
  create mode 100644 target/linux/ramips/dts/RUT5XX.dts

 diff --git a/target/linux/ramips/base-files/etc/diag.sh 
 b/target/linux/ramips/base-files/etc/diag.sh
 index 075562a..ad9bbd7 100755
 --- a/target/linux/ramips/base-files/etc/diag.sh
 +++ b/target/linux/ramips/base-files/etc/diag.sh
 @@ -170,6 +170,9 @@ get_status_led() {
   na930)
   status_led=na930:blue:power
   ;;
 + rut5xx)
 + status_led=rut5xx:green:status
 + ;;
   esac
  }
  
 diff --git 
 a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 
 b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
 index 341fd5f..dd8c0f7 100644
 --- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
 +++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
 @@ -119,6 +119,7 @@ case $FIRMWARE in
   ur-326n4g | \
   ur-336un | \
   xdxrn502j | \
 + rut5xx | \
Here.
   hg255d)
   rt2x00_eeprom_extract factory 0 512
   ;;
 diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
 b/target/linux/ramips/base-files/lib/ramips.sh
 index 7f221f8..4619bef 100755
 --- a/target/linux/ramips/base-files/lib/ramips.sh
 +++ b/target/linux/ramips/base-files/lib/ramips.sh
 @@ -211,6 +211,9 @@ ramips_board_detect() {
   *RT-N56U)
   name=rt-n56u
   ;;
 + *RUT5XX)
 + name=rut5xx
 + ;;
   *Skyline SL-R7205*)
   name=sl-r7205
   ;;
 diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
 b/target/linux/ramips/base-files/lib/upgrade/platform.sh
 index d8098b2..c85ee0f 100755
 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
 @@ -69,6 +69,7 @@ platform_check_image() {
   rt-n14u | \
   rt-n15 | \
   rt-n56u | \
 + rut5xx | \
   sl-r7205 | \
   tew-691gr | \
   tew-692gr | \
 diff --git a/target/linux/ramips/dts/RUT5XX.dts 
 b/target/linux/ramips/dts/RUT5XX.dts
 new file mode 100644
 index 000..530b8b1
 --- /dev/null
 +++ b/target/linux/ramips/dts/RUT5XX.dts
 @@ -0,0 +1,86 @@
 +/dts-v1/;
 +
 +/include/ rt3050.dtsi
 +
 +/ {
 + compatible = RUT5XX, ralink,rt3050-soc;
 + model = Teltonika RUT5XX;
 +
 + palmbus@1000 {
 + spi@b00 {
 + status = okay;
 + m25p80@0 {
 + #address-cells = 1;
 + #size-cells = 1;
 + compatible = n25q128a13;
 + reg = 0 0;
 + linux,modalias = m25p80, n25q128a13;
 + spi-max-frequency = 1000;
 +
 + partition@0 {
 + label = u-boot;
 + reg = 0x0 0x3;
 + read-only;
 + };
 +
 + partition@3 {
 + label = u-boot-env;
 + reg = 0x3 0x1;
 + read-only;
 + };
 +
 + factory: partition@4 {
 + label = factory;
 + reg = 0x4 0x1;
 + read-only;
 + };
 +
 + partition@5 {
 + label = firmware;
 + reg = 0x5 0xfb;
 + };
 + };
 + };
 + };
 +
 + pinctrl {
 + state_default: pinctrl0 {
 + gpio {
 + ralink,group = i2c, jtag, rgmii, mdio, 
 uartf;
 + ralink,function = gpio;
 + };
 + };
 + };
 +
 +ethernet@1010 {
 +mtd-mac-address = factory 0x28;
 +};
 +
 + esw@1011 {
 + ralink,portmap = 0x3e;
 + };
 +
 + gpio-leds {
 + compatible = gpio-leds;
 + status {
 + 

[OpenWrt-Devel] [PATCH 1/4] kernel: backport ubiblock support and add OpenWrt patches

2014-05-15 Thread Daniel
49[0-8]* patches have already been merged to Linus' tree, two more
OpenWrt-specific comfort hacks have been added on-top:

498-UBIBLOCK-set-ROOT_DEV-if-unset.patch
kernel: ubi: auto-set ROOT_DEV to rootfs ubiblock if unset

499-UBIBLOCK-autocreate-rootfs.patch
kernel: automatically attach ubi and rootfs ubiblock device

Signed-off-by: Daniel Golle dan...@makrotopia.org
---
 ...BI-R-O-block-driver-on-top-of-UBI-volumes.patch | 847 +
 .../491-UBI-block-do-not-use-term-attach.patch | 194 +
 ...block-Mark-init-only-symbol-as-__initdata.patch |  42 +
 ...UBI-block-Use-u64-for-the-64-bit-dividend.patch |  33 +
 .../494-UBI-rename-block-device-ioctls.patch   |  92 +++
 ...Remove-__initdata-from-ubiblock_param_ops.patch |  35 +
 ...96-UBI-avoid-workqueue-format-string-leak.patch |  30 +
 ...I_IOCVOLCRBLK-take-a-parameter-for-future.patch |  63 ++
 .../498-UBIBLOCK-set-ROOT_DEV-if-unset.patch   |  41 +
 .../499-UBIBLOCK-autocreate-rootfs.patch   | 121 +++
 10 files changed, 1498 insertions(+)
 create mode 100644 
target/linux/generic/patches-3.14/490-UBI-R-O-block-driver-on-top-of-UBI-volumes.patch
 create mode 100644 
target/linux/generic/patches-3.14/491-UBI-block-do-not-use-term-attach.patch
 create mode 100644 
target/linux/generic/patches-3.14/492-UBI-block-Mark-init-only-symbol-as-__initdata.patch
 create mode 100644 
target/linux/generic/patches-3.14/493-UBI-block-Use-u64-for-the-64-bit-dividend.patch
 create mode 100644 
target/linux/generic/patches-3.14/494-UBI-rename-block-device-ioctls.patch
 create mode 100644 
target/linux/generic/patches-3.14/495-UBI-block-Remove-__initdata-from-ubiblock_param_ops.patch
 create mode 100644 
target/linux/generic/patches-3.14/496-UBI-avoid-workqueue-format-string-leak.patch
 create mode 100644 
target/linux/generic/patches-3.14/497-UBI-make-UBI_IOCVOLCRBLK-take-a-parameter-for-future.patch
 create mode 100644 
target/linux/generic/patches-3.14/498-UBIBLOCK-set-ROOT_DEV-if-unset.patch
 create mode 100644 
target/linux/generic/patches-3.14/499-UBIBLOCK-autocreate-rootfs.patch

diff --git 
a/target/linux/generic/patches-3.14/490-UBI-R-O-block-driver-on-top-of-UBI-volumes.patch
 
b/target/linux/generic/patches-3.14/490-UBI-R-O-block-driver-on-top-of-UBI-volumes.patch
new file mode 100644
index 000..50e9e2f
--- /dev/null
+++ 
b/target/linux/generic/patches-3.14/490-UBI-R-O-block-driver-on-top-of-UBI-volumes.patch
@@ -0,0 +1,847 @@
+From 9d54c8a33eec78289b1b3f6e10874719c27ce0a7 Mon Sep 17 00:00:00 2001
+From: Ezequiel Garcia ezequiel.gar...@free-electrons.com
+Date: Tue, 25 Feb 2014 13:25:22 -0300
+Subject: [PATCH] UBI: R/O block driver on top of UBI volumes
+
+This commit introduces read-only block device emulation on top of UBI volumes.
+
+Given UBI takes care of wear leveling and bad block management it's possible
+to add a thin layer to enable block device access to UBI volumes.
+This allows to use a block-oriented filesystem on a flash device.
+
+The UBI block devices are meant to be used in conjunction with any
+regular, block-oriented file system (e.g. ext4), although it's primarily
+targeted at read-only file systems, such as squashfs.
+
+Block devices are created upon user request through new ioctls:
+UBI_IOCVOLATTBLK to attach and UBI_IOCVOLDETBLK to detach.
+Also, a new UBI module parameter is added 'ubi.block'. This parameter is
+needed in order to attach a block device on boot-up time, allowing to
+mount the rootfs on a ubiblock device.
+For instance, you could have these kernel parameters:
+
+  ubi.mtd=5 ubi.block=0,0 root=/dev/ubiblock0_0
+
+Or, if you compile ubi as a module:
+
+  $ modprobe ubi mtd=/dev/mtd5 block=/dev/ubi0_0
+
+Artem: amend commentaries and massage the patch a little bit.
+
+Signed-off-by: Ezequiel Garcia ezequiel.gar...@free-electrons.com
+Signed-off-by: Artem Bityutskiy artem.bityuts...@linux.intel.com
+---
+ drivers/mtd/ubi/Kconfig |  15 +
+ drivers/mtd/ubi/Makefile|   1 +
+ drivers/mtd/ubi/block.c | 646 
+ drivers/mtd/ubi/build.c |  11 +
+ drivers/mtd/ubi/cdev.c  |  20 ++
+ drivers/mtd/ubi/ubi.h   |  14 +
+ include/uapi/mtd/ubi-user.h |  11 +
+ 7 files changed, 718 insertions(+)
+ create mode 100644 drivers/mtd/ubi/block.c
+
+diff --git a/drivers/mtd/ubi/Kconfig b/drivers/mtd/ubi/Kconfig
+index 36663af..783fb18 100644
+--- a/drivers/mtd/ubi/Kconfig
 b/drivers/mtd/ubi/Kconfig
+@@ -87,4 +87,19 @@ config MTD_UBI_GLUEBI
+  work on top of UBI. Do not enable this unless you use legacy
+  software.
+ 
++config MTD_UBI_BLOCK
++  bool Read-only block devices on top of UBI volumes
++  default n
++  help
++ This option enables read-only UBI block devices support. UBI block
++ devices will be layered on top of UBI volumes, which means that the
++ UBI driver will transparently handle things like bad eraseblocks and
++ bit-flips. You can put any block-oriented file system 

[OpenWrt-Devel] [PATCH 4/4] base-files: include ubiblock tool in sysupgrade ramdisk

2014-05-15 Thread Daniel Golle
(I just noticed that I already sent 2/4 and 3/4 to the mailinglist before)

Also add some more busybox symlinks which are useful for sysupgrade
on UBI-enabled devices.

Signed-off-by: Daniel Golle dan...@makrotopia.org
---
 package/base-files/files/lib/upgrade/common.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh 
b/package/base-files/files/lib/upgrade/common.sh
index c98a381..4ff71e6 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -55,7 +55,8 @@ run_ramfs() { # command [...]
/bin/grep /bin/cp /bin/mv /bin/tar /usr/bin/md5sum /usr/bin/[ 
\
/bin/dd /bin/vi /bin/ls /bin/cat /usr/bin/awk /usr/bin/hexdump  
\
/bin/sleep /bin/zcat /usr/bin/bzcat /usr/bin/printf /usr/bin/wc 
\
-   /bin/cut /usr/bin/printf /bin/sync
+   /bin/cut /usr/bin/printf /bin/sync /bin/mkdir /bin/rmdir
\
+   /bin/rm /usr/bin/basename /bin/kill /bin/chmod /usr/bin/hexdump
 
install_bin /sbin/mtd
install_bin /sbin/ubi
@@ -64,6 +65,7 @@ run_ramfs() { # command [...]
install_bin /sbin/snapshot_tool
install_bin /usr/sbin/ubiupdatevol
install_bin /usr/sbin/ubiattach
+   install_bin /usr/sbin/ubiblock
install_bin /usr/sbin/ubidetach
install_bin /usr/sbin/ubiformat
install_bin /usr/sbin/ubirsvol
-- 
1.9.2



pgpNyrHhSNjT_.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] OOM issue (kernel not reclaiming memory?)

2014-05-15 Thread Rafał Miłecki
Over last few days I was playing a bit with RAM, forcing my devices to
use only 16MiB of it, observing mem usage, cpu usage, etc. All the
fun.

At some point while using 32MiB RAM bcm47xx device I got OOM:
perf invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0

I was Googling a bit and it appears that perf requested:
2^order = 2^0 = 1 page of memory (4096 B)

However something went wrong, because kernel couldn't provide this memory:
Normal free:4096kB min:4096kB low:5120kB high:6144kB

As you can see, my kernel was configured to reserve 4096kB of memory
(min). As soon as amount of free RAM went below the low (5120kB)
kernel was supposed to reclaim some memory until reaching at least
high (6144kB) of free RAM.
It seems for some reason kernel didn't do that. AFAIU the log, there
was some memory that could be reclaimed:
slab_reclaimable:788kB

Could someone give me a hint, what went wrong, please? Why my kernel
didn't reclaim some memory after reaching waning level (below
low)?

I can't reproduce this issue right now, but I'd love to understand
what has happened.

-- 
Rafał
[  214.79] perf invoked oom-killer: gfp_mask=0x201da, order=0, 
oom_score_adj=0
[  214.79] CPU: 0 PID: 887 Comm: perf Tainted: P 3.10.28 #2
[  214.80] Stack : 0006      
8033d1de 003c
  81aa06d8 80277d98 8031d150 802c6f1b 0377 000201da  

  802c6ff0 8001dfd8 04800800 8001b890   8027a240 
81675ad4
  81675a00       

         
81675a60
  ...
[  214.84] Call Trace:
[  214.84] [80010fb8] show_stack+0x48/0x70
[  214.85] [80068208] dump_header.isra.16+0x4c/0x138
[  214.85] [80068558] oom_kill_process+0xd4/0x3b0
[  214.86] [80068c98] out_of_memory+0x298/0x2f4
[  214.86] [8006bd68] __alloc_pages_nodemask+0x56c/0x650
[  214.87] [8006786c] filemap_fault+0x2ac/0x408
[  214.87] [8007e380] __do_fault+0xcc/0x4ac
[  214.88] [800813cc] handle_pte_fault+0x330/0x6f4
[  214.88] [80081840] handle_mm_fault+0xb0/0xdc
[  214.89] [80016580] do_page_fault+0x114/0x42c
[  214.89] [80001420] ret_from_exception+0x0/0x24
[  214.90] 
[  214.90] Mem-Info:
[  214.90] Normal per-cpu:
[  214.90] CPU0: hi:0, btch:   1 usd:   0
[  214.91] active_anon:717 inactive_anon:4 isolated_anon:0
[  214.91]  active_file:3 inactive_file:47 isolated_file:0
[  214.91]  unevictable:0 dirty:0 writeback:0 unstable:0
[  214.91]  free:1024 slab_reclaimable:197 slab_unreclaimable:866
[  214.91]  mapped:131 shmem:12 pagetables:45 bounce:0
[  214.91]  free_cma:0
[  214.94] Normal free:4096kB min:4096kB low:5120kB high:6144kB 
active_anon:2868kB inactive_anon:16kB active_file:12kB inactive_file:188kB 
unevictable:0kB isolated(anon):0kB isolated(file):0kB present:32768kB 
managed:29048kB mlocked:0kB dirty:0kB writeback:0kB mapped:524kB shmem:48kB 
slab_reclaimable:788kB slab_unreclaimable:3464kB kernel_stack:224kB 
pagetables:180kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB 
pages_scanned:0 all_unreclaimable? no
[  214.98] lowmem_reserve[]: 0 0
[  214.99] Normal: 102*4kB (UE) 119*8kB (UEMR) 73*16kB (UEM) 24*32kB (UM) 
0*64kB 0*128kB 1*256kB (R) 1*512kB (R) 0*1024kB 0*2048kB 0*4096kB = 4064kB
[  215.00] 72 total pagecache pages
[  215.01] 0 pages in swap cache
[  215.01] Swap cache stats: add 0, delete 0, find 0/0
[  215.01] Free swap  = 0kB
[  215.02] Total swap = 0kB
[  215.02] 8192 pages RAM
[  215.03] 878 pages reserved
[  215.03] 263886 pages shared
[  215.03] 5296 pages non-shared
[  215.04] [ pid ]   uid  tgid total_vm  rss nr_ptes swapents 
oom_score_adj name
[  215.04] [  258] 0   258  222   16   30   
  0 ubusd
[  215.05] [  259] 0   259  376   19   40   
  0 ash
[  215.06] [  461] 0   461  328   25   40   
  0 logd
[  215.07] [  476] 0   476  374   44   40   
  0 netifd
[  215.08] [  543] 0   543  287   19   30   
  0 dropbear
[  215.09] [  635] 0   635  375   17   50   
  0 httpd
[  215.09] [  648] 65534   648  240   22   40   
  0 dnsmasq
[  215.10] [  862] 0   862 4945  614  100   
  0 perf
[  215.11] [  884] 0   884  376   18   40   
  0 ntpd
[  215.12] Out of memory: Kill process 862 (perf) score 56 or sacrifice 
child
[  215.13] Killed process 862 (perf) total-vm:19780kB, anon-rss:1932kB, 
file-rss:524kB
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org

[OpenWrt-Devel] [PATCH v2] ramips: Support for Teltonika RUT5XX

2014-05-15 Thread Steve Weinreich
Hi Hartmut,

Thanks for your feedback, I have reformated the patch accordingly.  


Added support for Teltonika RUT5XX hardware.

Signed-off-by: Steffen Weinreich st...@weinreich.org
---
 target/linux/ramips/base-files/etc/diag.sh |  3 +
 .../etc/hotplug.d/firmware/10-rt2x00-eeprom|  1 +
 target/linux/ramips/base-files/lib/ramips.sh   |  3 +
 .../ramips/base-files/lib/upgrade/platform.sh  |  1 +
 target/linux/ramips/dts/RUT5XX.dts | 86 ++
 target/linux/ramips/image/Makefile |  3 +
 6 files changed, 97 insertions(+)
 create mode 100644 target/linux/ramips/dts/RUT5XX.dts

diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 075562a..66a0aaa 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -104,6 +104,9 @@ get_status_led() {
rt-n56u | wl-330n | wl-330n3g)
status_led=asus:blue:power
;;
+   rut5xx)
+   status_led=rut5xx:green:status
+   ;;
sl-r7205)
status_led=sl-r7205:green:status
;;
diff --git 
a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom 
b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
index 341fd5f..1a39bb6 100644
--- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
+++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
@@ -97,6 +97,7 @@ case $FIRMWARE in
px4885 | \
rt-n15 | \
rt-n56u | \
+   rut5xx | \
sl-r7205 | \
v11st-fe | \
v22rw-2x2 | \
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 7f221f8..4619bef 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -211,6 +211,9 @@ ramips_board_detect() {
*RT-N56U)
name=rt-n56u
;;
+   *RUT5XX)
+   name=rut5xx
+   ;;
*Skyline SL-R7205*)
name=sl-r7205
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index d8098b2..c85ee0f 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -69,6 +69,7 @@ platform_check_image() {
rt-n14u | \
rt-n15 | \
rt-n56u | \
+   rut5xx | \
sl-r7205 | \
tew-691gr | \
tew-692gr | \
diff --git a/target/linux/ramips/dts/RUT5XX.dts 
b/target/linux/ramips/dts/RUT5XX.dts
new file mode 100644
index 000..530b8b1
--- /dev/null
+++ b/target/linux/ramips/dts/RUT5XX.dts
@@ -0,0 +1,86 @@
+/dts-v1/;
+
+/include/ rt3050.dtsi
+
+/ {
+   compatible = RUT5XX, ralink,rt3050-soc;
+   model = Teltonika RUT5XX;
+
+   palmbus@1000 {
+   spi@b00 {
+   status = okay;
+   m25p80@0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = n25q128a13;
+   reg = 0 0;
+   linux,modalias = m25p80, n25q128a13;
+   spi-max-frequency = 1000;
+
+   partition@0 {
+   label = u-boot;
+   reg = 0x0 0x3;
+   read-only;
+   };
+
+   partition@3 {
+   label = u-boot-env;
+   reg = 0x3 0x1;
+   read-only;
+   };
+
+   factory: partition@4 {
+   label = factory;
+   reg = 0x4 0x1;
+   read-only;
+   };
+
+   partition@5 {
+   label = firmware;
+   reg = 0x5 0xfb;
+   };
+   };
+   };
+   };
+
+   pinctrl {
+   state_default: pinctrl0 {
+   gpio {
+   ralink,group = i2c, jtag, rgmii, mdio, 
uartf;
+   ralink,function = gpio;
+   };
+   };
+   };
+
+ethernet@1010 {
+mtd-mac-address = factory 0x28;
+};
+
+   esw@1011 {
+   ralink,portmap = 0x3e;
+   };
+
+   gpio-leds {
+   compatible = 

Re: [OpenWrt-Devel] WD MyNet N750 not showing 802.11n mode in luci

2014-05-15 Thread Steven Haigh
The N600 allows you to select 802.11n as well as 40MHz channels.

On 16/05/14 03:28, Luis E. Garcia wrote:
 Steve, was this present on the N600?
 
 
 On Thu, May 15, 2014 at 12:09 AM, Steven Haigh net...@crc.id.au
 mailto:net...@crc.id.au wrote:
 
 Hi guys,
 
 I grabbed a couple of N750s after having the N600 for a while (dem gige
 ports!) and I noticed when setting up the N750 via luci, you can't
 select 40MHz channels or 802.11n operating mode.
 
 If you set it manually in /etc/config/wifi, it works perfectly - but
 luci seems to think its not available.
 
 Any ideas?

-- 
Steven Haigh

Email: net...@crc.id.au
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299



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


Re: [OpenWrt-Devel] WD MyNet N750 not showing 802.11n mode in luci

2014-05-15 Thread Steven Haigh
That's what I get on the N600. On the N750 I see:

Mode: auto, 802.11a

As such, I don't get the selection box for doing 20/40MHz channels.

This is using:
OpenWrt Barrier Breaker r40767 / LuCI Trunk (svn-r10180)

On 16/05/14 08:57, Luis E. Garcia wrote:
 Steve,
 You can select 40MHz channels on the advanced tab in the radio
 configuration.
 The 802.11n - I can only select 802.11gn and 802.11an on the radio options.
 
 
 
 On Thu, May 15, 2014 at 5:53 PM, Steven Haigh net...@crc.id.au
 mailto:net...@crc.id.au wrote:
 
 The N600 allows you to select 802.11n as well as 40MHz channels.
 
 On 16/05/14 03:28, Luis E. Garcia wrote:
  Steve, was this present on the N600?
 
 
  On Thu, May 15, 2014 at 12:09 AM, Steven Haigh net...@crc.id.au
 mailto:net...@crc.id.au
  mailto:net...@crc.id.au mailto:net...@crc.id.au wrote:
 
  Hi guys,
 
  I grabbed a couple of N750s after having the N600 for a while
 (dem gige
  ports!) and I noticed when setting up the N750 via luci, you can't
  select 40MHz channels or 802.11n operating mode.
 
  If you set it manually in /etc/config/wifi, it works perfectly
 - but
  luci seems to think its not available.
 
  Any ideas?
 
 --
 Steven Haigh
 
 Email: net...@crc.id.au mailto:net...@crc.id.au
 Web: http://www.crc.id.au
 Phone: (03) 9001 6090 - 0412 935 897
 Fax: (03) 8338 0299
 
 


-- 
Steven Haigh

Email: net...@crc.id.au
Web: http://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897
Fax: (03) 8338 0299



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


[OpenWrt-Devel] [PATCH] [luci] Autologin if root password is empty, to improve UX flow on first access.

2014-05-15 Thread Gui Iribarren
Current experience is at the very least confusing,
first there's a (otherwise useful) warning dialog, with a link
that (unless you login beforehand) only rewrites the url
but shows the same login page; 
where you're supposed to just push enter, but
with no instructions whatsoever.

Get rid of this intermediate step,
with a conditional javascript form.submit()

Signed-off-by: nicoechaniz nicoecha...@altermundi.net
Tested-by: Gui Iribarren g...@altermundi.net
---
 modules/admin-core/luasrc/view/sysauth.htm | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/admin-core/luasrc/view/sysauth.htm 
b/modules/admin-core/luasrc/view/sysauth.htm
index 7c39f0d..a3c7e69 100644
--- a/modules/admin-core/luasrc/view/sysauth.htm
+++ b/modules/admin-core/luasrc/view/sysauth.htm
@@ -13,7 +13,7 @@ You may obtain a copy of the License at
 
 %+header%
 
-form method=post action=%=pcdata(luci.http.getenv(REQUEST_URI))%
+form name=login method=post 
action=%=pcdata(luci.http.getenv(REQUEST_URI))%
div class=cbi-map
h2a id=content name=content%:Authorization 
Required%/a/h2
div class=cbi-map-descr
@@ -50,6 +50,12 @@ You may obtain a copy of the License at
input.focus();
 //]]/script
 
+%- if luci.sys.process.info(uid) == 0 and luci.sys.user.getuser(root) and 
not luci.sys.user.getpasswd(root) then -%
+script type=text/javascript//![CDATA[
+   document.login.submit()
+//]]/script
+%- end -%
+
 %
 local uci  = require luci.model.uci.cursor()
 local fs  = require nixio.fs
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [luci] Autologin if root password is empty, to improve UX flow on first access.

2014-05-15 Thread Rafał Miłecki
On 16 May 2014 04:23, Gui Iribarren g...@altermundi.net wrote:
 +script type=text/javascript//![CDATA[
 +   document.login.submit()
 +//]]/script

I've no idea if this idea is going to be accepted, but *do not* use
document.all in your scripts. Seriously. It was an *ugly* hack
commonly used years ago (more than 10). Be specific when looking for
elements in DOM.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel