Re: [OpenWrt-Devel] [PATCH] [v4] ar71xx: Support for Ubiquiti UniFi AP AC LITE

2016-02-11 Thread p . wassi
From: P.Wassi 

Add support for the Ubiquiti UniFi AP AC LITE
Signed-off-by: P.Wassi 
---
RESUBMISSION since the last patch sent had problems with
missing whitespaces at the beginning of the lines.
https://patchwork.ozlabs.org/patch/570588/ can then be closed.

This patch adds:
* New machine type
* Code for device setup
* Proper image configuration
* New target for the build system
* Network setup as LAN-only
* Diagnostic LED
* Sysupgrade Support
* ath10k firmware extraction
* Board detection

base-files/etc/board.d/02_network | 1
base-files/etc/diag.sh | 3
base-files/etc/hotplug.d/firmware/11-ath10k-caldata | 3
base-files/lib/ar71xx.sh | 3
base-files/lib/upgrade/platform.sh | 1
config-4.1 | 1
files/arch/mips/ath79/Kconfig.openwrt | 10 +
files/arch/mips/ath79/Makefile | 1
files/arch/mips/ath79/mach-ubnt-unifiac.c | 109 
files/arch/mips/ath79/machtypes.h | 1
generic/profiles/ubnt.mk | 11 ++
image/Makefile | 11 +-
mikrotik/config-default | 1
nand/config-default | 1
14 files changed, 155 insertions(+), 2 deletions(-)

diff -rupN a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -359,6 +359,7 @@ tl-wa901nd-v2 |\
 tl-wa901nd-v3 |\
 tl-wr703n |\
 tube2h |\
+unifiac |\
 wndap360 |\
 mynet-rext |\
 wp543)
diff -rupN a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -339,7 +339,8 @@ get_status_led() {
unifi)
status_led="ubnt:green:dome"
;;
-   uap-pro)
+   uap-pro | \
+   unifiac)
status_led="ubnt:white:dome"
;;
unifi-outdoor-plus)
diff -rupN 
a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata 
b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
--- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -75,6 +75,9 @@ case "$FIRMWARE" in
ath10kcal_extract "ART" 20480 2116
ath10kcal_patch_mac $(macaddr_add $(cat 
/sys/class/net/eth0/address) +16)
;;
+   unifiac)
+   ath10kcal_extract "EEPROM" 20480 2116
+   ;;
esac
;;
 "ath10k/cal-pci-:01:00.0.bin")
diff -rupN a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -905,6 +905,9 @@ ar71xx_board_detect() {
*UniFi)
name="unifi"
;;
+   *"UniFi-AC")
+   name="unifiac"
+   ;;
*"UniFi AP Pro")
name="uap-pro"
;;
diff -rupN a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -262,6 +262,7 @@ platform_check_image() {
wlae-ag300n | \
nbg460n_550n_550nh | \
unifi | \
+   unifiac | \
unifi-outdoor | \
carambola2 | \
weio )
diff -rupN a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
 CONFIG_ATH79_MACH_TUBE2H=y
 CONFIG_ATH79_MACH_UBNT=y
 CONFIG_ATH79_MACH_UBNT_XM=y
+CONFIG_ATH79_MACH_UBNT_UNIFIAC=y
 CONFIG_ATH79_MACH_WEIO=y
 CONFIG_ATH79_MACH_WHR_HP_G300N=y
 CONFIG_ATH79_MACH_WLAE_AG300N=y
diff -rupN a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 
b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -1349,6 +1349,16 @@ config ATH79_MACH_UBNT
select ATH79_DEV_M25P80
select ATH79_DEV_USB
 
+config ATH79_MACH_UBNT_UNIFIAC
+   bool "Ubiquiti UniFi AC (LITE) support"
+   select SOC_QCA956X
+   select ATH79_DEV_AP9X_PCI if PCI
+   select ATH79_DEV_ETH
+   select ATH79_DEV_GPIO_BUTTONS
+   select ATH79_DEV_LEDS_GPIO
+   select ATH79_DEV_M25P80
+   select ATH79_DEV_WMAC
+
 config ATH79_MACH_WEIO
bool "WeIO board"
select SOC_AR933X
diff -rupN a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h 
b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -209,6 +209,7 @@ enum ath79_mach_type {
ATH79_MACH_UBNT_RS, /* Ubiquiti RouterStation */
ATH79_MACH_UBNT_UAP_PRO,/* Ubiquiti UniFi 

Re: [OpenWrt-Devel] [PATCH] ramips: Support LEDs on D-Link DIR-860L B1

2016-02-11 Thread John Crispin


On 11/02/2016 14:46, Johannes Wienke wrote:
> Adds the required gpio definitions.
> 
> Signed-off-by: Johannes Wienke 


Hi Johannes,

patch fails to apply. please fix and resend.

John

> ---
>  target/linux/ramips/dts/DIR-860L-B1.dts | 20 
>  1 file changed, 20 insertions(+)
> 
> diff --git a/target/linux/ramips/dts/DIR-860L-B1.dts
> b/target/linux/ramips/dts/DIR-860L-B1.dts
> index da3f59c..a6add70 100644
> --- a/target/linux/ramips/dts/DIR-860L-B1.dts
> +++ b/target/linux/ramips/dts/DIR-860L-B1.dts
> @@ -98,6 +98,26 @@
>   gpio-leds {
>   compatible = "gpio-leds";
> +
> + power {
> + label = "dir-860l-b1:orange:power";
> + gpios = <&gpio0 13 1>;
> + };
> +
> + power2 {
> + label = "dir-860l-b1:green:power";
> + gpios = <&gpio0 15 1>;
> + };
> +
> + net {
> + label = "dir-860l-b1:orange:net";
> + gpios = <&gpio0 14 1>;
> + };
> +
> + net2 {
> + label = "dir-860l-b1:green:net";
> + gpios = <&gpio0 16 1>;
> + };
>   };
>   gpio-keys-polled {
> 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] libubus.h: marking unused variables

2016-02-11 Thread John Crispin


On 10/02/2016 14:04, Emanuel Taube wrote:
> 
> diff --git a/libubus.h b/libubus.h
> index 08dac49..d419205 100644
> --- a/libubus.h
> +++ b/libubus.h
> @@ -285,7 +285,7 @@ int ubus_invoke_async(struct ubus_context *ctx, uint32_t 
> obj, const char *method
>  int ubus_send_reply(struct ubus_context *ctx, struct ubus_request_data *req,
>   struct blob_attr *msg);
>  
> -static inline void ubus_defer_request(struct ubus_context *ctx,
> +static inline void ubus_defer_request(struct ubus_context *ctx 
> __attribute__((__unused__)),
> struct ubus_request_data *req,
> struct ubus_request_data *new_req)
>  {
> @@ -293,7 +293,7 @@ static inline void ubus_defer_request(struct ubus_context 
> *ctx,
>  req->deferred = true;
>  }
>  
> -static inline void ubus_request_set_fd(struct ubus_context *ctx,
> +static inline void ubus_request_set_fd(struct ubus_context *ctx 
> __attribute__((__unused__)),
>  struct ubus_request_data *req, int fd)
>  {
>  req->fd = fd;
> 

Hi,

i am not sure what issue it solves. i have the suspicion that you are
using a 3rd party app that links this lib and uses awesome gcc compile
flags that blow up without this patch. could you explain the purpose of
this patch ?

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


Re: [OpenWrt-Devel] [PATCH 0/2 v2] linux: add support of ARC HS38-based boards

2016-02-11 Thread Alexey Brodkin
Hi Felix, Jonas,

On Mon, 2016-02-01 at 19:21 +0300, Alexey Brodkin wrote:
> Hello,
> 
> On Fri, 2016-01-22 at 23:44 +0300, Alexey Brodkin wrote:
> > Hi Felix,
> > 
> > On Mon, 2016-01-18 at 20:51 +0300, Alexey Brodkin wrote:
> > > This patch introduces support of new boards with ARC HS38 cores.
> > > 
> > > ARC HS38 is a new generation of ARC cores which utilize ARCv2 ISA.
> > > Because of new ISA ARC HS38 are binary incompatible with ARC 700
> > > cores which requires both separate toolchain and target applications
> > > including Linux kernel for that new cores.
> > > 
> > > As with ARC770 we're addind support for 2 boards for now:
> > > 
> > >  [1] Synopsys SDP board (AXS103)
> > >  This is the same base-board as in AXS101 but with
> > >  FPGA-based CPU-tile where ARCHs38 core is implemented.
> > > 
> > >  [2] nSIM
> > >  Again this is the same simulation engine but configured for
> > >  new instruction set and features of new CPU.
> > 
> > Any chance that tiny series gets reviewed sometime soon?
> 
> Ping!

I'm wondering if there's a problem with this series?
It's been a while since I sent that last respin and it would be nice
to get it either reviewed or accepted if there're no complaints.

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


Re: [OpenWrt-Devel] [PATCH] [v3] ar71xx: Support for Ubiquiti UniFi AP AC LITE

2016-02-11 Thread Vittorio G (VittGam)

Hi P.Wassi,

The code itself does not seem to be broken.
But the whitespace on the beginning of every line is missing.
It is possible that your email client has mangled it.
So the patch cannot be applied with the "patch" tool, since that
whitespace is essential in diff files.

Also, on your site you don't escape the < and > (less than and
greater than) signs in the patch inside the "pre" tags, so the
code inbetween is parsed as HTML tags (at least here with Firefox).
Try using a combination of "pre" and "code" tags to avoid that.

Cheers,
Vittorio

On 11/02/2016 10:44:33 CET, p.wa...@gmx.at wrote:

Hi Vittorio,

sorry, what is broken with the patch?
Which things should be changed?

P.Wassi


Hello,

It seems that whitespace is broken in this patch.

Can you resend it, please?

Thank you,
Vittorio G


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


[OpenWrt-Devel] [PATCH 1/4] switch: make LED port_mask file write handler use kstrtoul() function

2016-02-11 Thread Michal
From: Michal Cieslakiewicz 
Subject: [PATCH 1/4] switch: make LED port_mask file write handler use 
kstrtoul() function

This patch changes swconfig_trig_port_mask_store() handler to utilize
kstrtoul() function instead of call to obsolete simple_strtoul(). Thanks
to this change, new handler takes less memory and makes port_mask special
file accept not only hexadecimal, but also decimal and octal numbers.

Signed-off-by: Michal Cieslakiewicz 
---
 .../generic/files/drivers/net/phy/swconfig_leds.c  | 41 +-
 1 file changed, 16 insertions(+), 25 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c 
b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
index abd7bed..7d122d2 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
@@ -94,37 +94,28 @@ swconfig_trig_port_mask_store(struct device *dev, struct 
device_attribute *attr,
struct led_classdev *led_cdev = dev_get_drvdata(dev);
struct swconfig_trig_data *trig_data = led_cdev->trigger_data;
unsigned long port_mask;
-   ssize_t ret = -EINVAL;
-   char *after;
-   size_t count;
+   int ret;
+   bool changed;
 
-   port_mask = simple_strtoul(buf, &after, 16);
-   count = after - buf;
+   ret = kstrtoul(buf, 0, &port_mask);
+   if (ret)
+   return ret;
 
-   if (*after && isspace(*after))
-   count++;
+   write_lock(&trig_data->lock);
 
-   if (count == size) {
-   bool changed;
-
-   write_lock(&trig_data->lock);
-
-   changed = (trig_data->port_mask != port_mask);
-   if (changed) {
-   trig_data->port_mask = port_mask;
-   if (port_mask == 0)
-   swconfig_trig_set_brightness(trig_data, 
LED_OFF);
-   }
-
-   write_unlock(&trig_data->lock);
+   changed = (trig_data->port_mask != port_mask);
+   if (changed) {
+   trig_data->port_mask = port_mask;
+   if (port_mask == 0)
+   swconfig_trig_set_brightness(trig_data, LED_OFF);
+   }
 
-   if (changed)
-   swconfig_trig_update_port_mask(led_cdev->trigger);
+   write_unlock(&trig_data->lock);
 
-   ret = count;
-   }
+   if (changed)
+   swconfig_trig_update_port_mask(led_cdev->trigger);
 
-   return ret;
+   return size;
 }
 
 static ssize_t
-- 
2.6.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/4] ar71xx: WNR2000v3: add speed_mask to Ethernet port LED initialization

2016-02-11 Thread Michal
From: Michal Cieslakiewicz 
Subject: [PATCH 4/4] ar71xx: WNR2000v3: add speed_mask to Ethernet port LED 
initialization

This patch add speed_mask parameter to Ethernet port LED initialization
during system startup. LEDs are configured to show amber light for 10 Mbps
link and green for 100 Mbps as described on device label.

Signed-off-by: Michal Cieslakiewicz 
---
 This patch is further development of WNR2000v3 support patches to OpenWrt.
 Therefore it requires to be applied on top of another patch described
 "[PATCH 8/8] ar71xx: WNR2000v3: enable control of all LEDs and buttons"

 target/linux/ar71xx/base-files/etc/board.d/01_leds | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds 
b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 7374422..37ee3d3 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -680,14 +680,14 @@ wnr2000-v3)
ucidef_set_led_netdev "wan-amber" "WAN (amber)" "netgear:amber:wan" 
"eth0"
ucidef_set_led_default "wan-green" "WAN (green)" "netgear:green:wan" "0"
ucidef_set_led_netdev "wlan" "WLAN" "netgear:blue:wlan" "wlan0"
-   ucidef_set_led_switch "lan1green" "LAN1 (green)" "netgear:green:lan1" 
"switch0" "0x02"
-   ucidef_set_led_switch "lan2green" "LAN2 (green)" "netgear:green:lan2" 
"switch0" "0x04"
-   ucidef_set_led_switch "lan3green" "LAN3 (green)" "netgear:green:lan3" 
"switch0" "0x08"
-   ucidef_set_led_switch "lan4green" "LAN4 (green)" "netgear:green:lan4" 
"switch0" "0x10"
-   ucidef_set_led_default "lan1amber" "LAN1 (amber)" "netgear:amber:lan1" 
"0"
-   ucidef_set_led_default "lan2amber" "LAN2 (amber)" "netgear:amber:lan2" 
"0"
-   ucidef_set_led_default "lan3amber" "LAN3 (amber)" "netgear:amber:lan3" 
"0"
-   ucidef_set_led_default "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" 
"0"
+   ucidef_set_led_switch "lan1green" "LAN1 (green)" "netgear:green:lan1" 
"switch0" "0x02" "0x04"
+   ucidef_set_led_switch "lan2green" "LAN2 (green)" "netgear:green:lan2" 
"switch0" "0x04" "0x04"
+   ucidef_set_led_switch "lan3green" "LAN3 (green)" "netgear:green:lan3" 
"switch0" "0x08" "0x04"
+   ucidef_set_led_switch "lan4green" "LAN4 (green)" "netgear:green:lan4" 
"switch0" "0x10" "0x04"
+   ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "netgear:amber:lan1" 
"switch0" "0x02" "0x02"
+   ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "netgear:amber:lan2" 
"switch0" "0x04" "0x02"
+   ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "netgear:amber:lan3" 
"switch0" "0x08" "0x02"
+   ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "netgear:amber:lan4" 
"switch0" "0x10" "0x02"
;;
 
 wnr2000-v4)
-- 
2.6.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/4] switch: allow Ethernet port LEDs to show specific link speeds only

2016-02-11 Thread Michal
From: Michal Cieslakiewicz 
Subject: [PATCH 2/4] switch: allow Ethernet port LEDs to show specific link 
speeds only

This patch adds speed_mask special file to LEDs connected to switch ports
via 'switch' trigger. It allows to choose which speeds to signal when link
is up. If router has more than one LED per port, they may light up differently
depending on how fast connection is. Default setting is 'all speeds' so
backward compatibilty with system scripts (for example uci) is maintained.

Signed-off-by: Michal Cieslakiewicz 
---
 Link speed to speed_mask bit mapping:
 bit 0 (0x01) - unknown port speed, may indicate cabling problem
 bit 1 (0x02) - 10 Mbps
 bit 2 (0x04) - 100 Mbps
 bit 3 (0x08) - 1000 Mbps aka 1 Gbps
 bits 4-7 - reserved for future use, always 0, ignored for now

 .../generic/files/drivers/net/phy/swconfig_leds.c  | 106 -
 1 file changed, 102 insertions(+), 4 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c 
b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
index 7d122d2..433a472 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
@@ -20,6 +20,15 @@
 #define SWCONFIG_LED_TIMER_INTERVAL(HZ / 10)
 #define SWCONFIG_LED_NUM_PORTS 32
 
+#define SWCONFIG_LED_PORT_SPEED_NA 0x01/* unknown speed */
+#define SWCONFIG_LED_PORT_SPEED_10 0x02/* 10 Mbps */
+#define SWCONFIG_LED_PORT_SPEED_1000x04/* 100 Mbps */
+#define SWCONFIG_LED_PORT_SPEED_1000   0x08/* 1000 Mbps */
+#define SWCONFIG_LED_PORT_SPEED_ALL( SWCONFIG_LED_PORT_SPEED_NA | \
+ SWCONFIG_LED_PORT_SPEED_10 | \
+ SWCONFIG_LED_PORT_SPEED_100 | \
+ SWCONFIG_LED_PORT_SPEED_1000 )
+
 struct switch_led_trigger {
struct led_trigger trig;
struct switch_dev *swdev;
@@ -28,6 +37,7 @@ struct switch_led_trigger {
u32 port_mask;
u32 port_link;
unsigned long port_traffic[SWCONFIG_LED_NUM_PORTS];
+   u8 link_speed[SWCONFIG_LED_NUM_PORTS];
 };
 
 struct swconfig_trig_data {
@@ -40,6 +50,7 @@ struct swconfig_trig_data {
bool prev_link;
unsigned long prev_traffic;
enum led_brightness prev_brightness;
+   u8 speed_mask;
 };
 
 static void
@@ -135,6 +146,46 @@ swconfig_trig_port_mask_show(struct device *dev, struct 
device_attribute *attr,
 static DEVICE_ATTR(port_mask, 0644, swconfig_trig_port_mask_show,
   swconfig_trig_port_mask_store);
 
+/* speed_mask file handler - display value */
+static ssize_t swconfig_trig_speed_mask_show(struct device *dev,
+struct device_attribute *attr,
+char *buf)
+{
+   struct led_classdev *led_cdev = dev_get_drvdata(dev);
+   struct swconfig_trig_data *trig_data = led_cdev->trigger_data;
+
+   read_lock(&trig_data->lock);
+   sprintf(buf, "%#x\n", trig_data->speed_mask);
+   read_unlock(&trig_data->lock);
+
+   return strlen(buf) + 1;
+}
+
+/* speed_mask file handler - store value */
+static ssize_t swconfig_trig_speed_mask_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t size)
+{
+   struct led_classdev *led_cdev = dev_get_drvdata(dev);
+   struct swconfig_trig_data *trig_data = led_cdev->trigger_data;
+   u8 speed_mask;
+   int ret;
+
+   ret = kstrtou8(buf, 0, &speed_mask);
+   if (ret)
+   return ret;
+
+   write_lock(&trig_data->lock);
+   trig_data->speed_mask = speed_mask & SWCONFIG_LED_PORT_SPEED_ALL;
+   write_unlock(&trig_data->lock);
+
+   return size;
+}
+
+/* speed_mask special file */
+static DEVICE_ATTR(speed_mask, 0644, swconfig_trig_speed_mask_show,
+  swconfig_trig_speed_mask_store);
+
 static void
 swconfig_trig_activate(struct led_classdev *led_cdev)
 {
@@ -154,14 +205,22 @@ swconfig_trig_activate(struct led_classdev *led_cdev)
rwlock_init(&trig_data->lock);
trig_data->led_cdev = led_cdev;
trig_data->swdev = sw_trig->swdev;
+   trig_data->speed_mask = SWCONFIG_LED_PORT_SPEED_ALL;
led_cdev->trigger_data = trig_data;
 
err = device_create_file(led_cdev->dev, &dev_attr_port_mask);
if (err)
goto err_free;
 
+   err = device_create_file(led_cdev->dev, &dev_attr_speed_mask);
+   if (err)
+   goto err_dev_free;
+
return;
 
+err_dev_free:
+   device_remove_file(led_cdev->dev, &dev_attr_port_mask);
+
 err_free:
led_cdev->trigger_data = NULL;
kfree(trig_data);
@@ -177,6 +236,7 @@ swconfig_trig_deactivate(struct led_classdev *led_cdev)
trig_data = (void *) led_cdev->trigger_data;
if (trig_data) {
  

[OpenWrt-Devel] [PATCH 3/4] uci: add support for speed_mask to switch LED init scripts

2016-02-11 Thread Michal
From: Michal Cieslakiewicz 
Subject: [PATCH 3/4] uci: add support for speed_mask to switch LED init scripts

This patch adds extra parameter to switch LED trigger initialization functions.
New functionality maintains backward compatibility, so calling functions
without setting new speed_mask parameter works as expected.

Signed-off-by: Michal Cieslakiewicz 
---
 package/base-files/files/bin/config_generate   | 9 +++--
 package/base-files/files/etc/init.d/led| 5 -
 package/base-files/files/lib/functions/uci-defaults.sh | 2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/package/base-files/files/bin/config_generate 
b/package/base-files/files/bin/config_generate
index 92eb14b..f6e7b63 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -296,11 +296,16 @@ generate_led() {
;;
 
switch)
-   local port_mask
-   json_get_vars port_mask
+   local port_mask speed_mask
+   json_get_vars port_mask speed_mask
uci -q batch <<-EOF
set system.$cfg.port_mask='$port_mask'
EOF
+   if [ -n "$speed_mask" ] ; then
+   uci -q batch <<-EOF
+   set system.$cfg.speed_mask='$speed_mask'
+   EOF
+   fi
;;
 
timer)
diff --git a/package/base-files/files/etc/init.d/led 
b/package/base-files/files/etc/init.d/led
index 84cd028..d1521a9 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -88,11 +88,14 @@ load_led() {
;;
 
switch[0-9]*)
-   local port_mask
+   local port_mask speed_mask
 
config_get port_mask $1 port_mask
[ -n "$port_mask" ] && \
echo $port_mask > 
/sys/class/leds/${sysfs}/port_mask
+   config_get speed_mask $1 speed_mask
+   [ -n "$speed_mask" ] && \
+   echo $speed_mask > 
/sys/class/leds/${sysfs}/speed_mask
;;
esac
}
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh
index de3f180..a6005b1 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -410,6 +410,7 @@ ucidef_set_led_switch() {
local sysfs="$3"
local trigger="$4"
local port_mask="$5"
+   local speed_mask="$6"
 
json_select_object led
 
@@ -419,6 +420,7 @@ ucidef_set_led_switch() {
json_add_string sysfs "$sysfs"
json_add_string trigger "$trigger"
json_add_string port_mask "$port_mask"
+   [ -n "$speed_mask" ] && json_add_string speed_mask "$speed_mask"
json_select ..
 
json_select ..
-- 
2.6.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v5 6/8] ar71xx: WNR2000v3: exclude USB modules from image

2016-02-11 Thread Michal
From: Michal Cieslakiewicz 
Subject: [PATCH v5 6/8] ar71xx: WNR2000v3: exclude USB modules from image

Netgear WNR2000v3 has no USB port yet default system image
includes USB kernel modules. This patch fixes that.

Signed-off-by: Michal Cieslakiewicz 
---
 (resent with correct subject - patch 6th of 8)

 Changes:
 * empty package list replaced with specific USB packages marked to exclude

 target/linux/ar71xx/generic/profiles/netgear.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ar71xx/generic/profiles/netgear.mk 
b/target/linux/ar71xx/generic/profiles/netgear.mk
index ca22a18..2796e46 100644
--- a/target/linux/ar71xx/generic/profiles/netgear.mk
+++ b/target/linux/ar71xx/generic/profiles/netgear.mk
@@ -30,6 +30,7 @@ $(eval $(call Profile,WNDR3700))
 
 define Profile/WNR2000V3
NAME:=NETGEAR WNR2000V3
+   PACKAGES:= -kmod-usb-core -kmod-usb-ohci -kmod-usb2 -kmod-ledtrig-usbdev
 endef
 
 define Profile/WNR2000V3/Description
-- 
2.6.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v5] ar71xx: WNR2000v3: exclude USB modules from image

2016-02-11 Thread Michal
From: Michal Cieslakiewicz 
Subject: [PATCH v5] ar71xx: WNR2000v3: exclude USB modules from image

Netgear WNR2000v3 has no USB port yet default system image
includes USB kernel modules. This patch fixes that.

Signed-off-by: Michal Cieslakiewicz 
---

 Changes:
 * empty package list replaced with specific USB packages marked to exclude
 
 target/linux/ar71xx/generic/profiles/netgear.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ar71xx/generic/profiles/netgear.mk 
b/target/linux/ar71xx/generic/profiles/netgear.mk
index ca22a18..2796e46 100644
--- a/target/linux/ar71xx/generic/profiles/netgear.mk
+++ b/target/linux/ar71xx/generic/profiles/netgear.mk
@@ -30,6 +30,7 @@ $(eval $(call Profile,WNDR3700))
 
 define Profile/WNR2000V3
NAME:=NETGEAR WNR2000V3
+   PACKAGES:= -kmod-usb-core -kmod-usb-ohci -kmod-usb2 -kmod-ledtrig-usbdev
 endef
 
 define Profile/WNR2000V3/Description
-- 
2.6.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] CC: ramips: Backport support for Netgear EX2700

2016-02-11 Thread Joseph C. Lehner
This patch adds support for the Netgear EX2700 in Chaos Calmer and
builds an approriate sysupgrade image (backported from my earlier
submission).

Signed-off-by: Joseph C. Lehner 

---

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 5946f98..5327d00 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -114,6 +114,10 @@ case $board in
esr-9753)
set_wifi_led "rt2800pci-phy0::radio"
;;
+   ex2700)
+   ucidef_set_led_default "power_r" "POWER (red)" 
"ex2700:red:power" "0"
+   set_wifi_led "ex2700:green:router"
+   ;;
f5d8235-v1)
set_usb_led "f5d8235-v1:blue:storage"
;;
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index d7d016b..a78912d 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -113,7 +113,8 @@ ramips_setup_interfaces()
ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
;;
 
-   cf-wr800n)
+   cf-wr800n|\
+   ex2700)
ucidef_set_interface_lan "eth0.1"
ucidef_add_switch "switch0" "1" "1"
ucidef_add_switch_vlan "switch0" "1" "4 6t"
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index a7e2501..6474ebd 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -63,6 +63,9 @@ get_status_led() {
esr-9753)
status_led="esr-9753:orange:power"
;;
+   ex2700)
+   status_led="ex2700:red:power"
+   ;;
f5d8235-v2)
status_led="f5d8235v2:blue:router"
;;
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index 4141ddd..8dc05b0 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -223,6 +223,9 @@ ramips_board_detect() {
*"Netgear WNCE2001")
name="wnce2001"
;;
+   *"Netgear EX2700")
+   name="ex2700"
+   ;;
*"NexAira BC2")
name="bc2"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index 2f64d8c..a3d0175 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -49,6 +49,7 @@ platform_check_image() {
dir-620-d1 | \
dir-810l | \
e1700 | \
+   ex2700 |\
esr-9753 | \
f7c027 | \
fonera20n | \
diff --git a/target/linux/ramips/dts/EX2700.dts 
b/target/linux/ramips/dts/EX2700.dts
new file mode 100644
index 000..da98bd8
--- /dev/null
+++ b/target/linux/ramips/dts/EX2700.dts
@@ -0,0 +1,148 @@
+/*
+ * Device Tree file for the Netgear EX2700
+ *
+ * Copyright (C) 2016 Joseph C. Lehner 
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+   compatible = "ralink,mt7620a-soc";
+   model = "Netgear EX2700";
+
+   chosen {
+   bootargs = "console=ttyS0,57600";
+   };
+
+   palmbus@1000 {
+
+   gpio0: gpio@600 {
+   status = "okay";
+   };
+
+   gpio1: gpio@638 {
+   status = "okay";
+   };
+
+   spi@b00 {
+   status = "okay";
+
+   m25p80@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "mx25l3205d";
+   reg = <0 0>;
+   linux,modalias = "m25p80", "mx25l3205d";
+   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;
+   };
+
+   partition@4 {
+   label = "firmware";
+ 

[OpenWrt-Devel] [PATCH] brcm63xx: fix CT-536p/CT-5621T support

2016-02-11 Thread dani
Fix support for the Comtrend  CT-536p, CT-5361 and CT-5621T routers support.

Currently the firmware is broken for these routers, because there is a missing
bar in the code at the DTS file. The power led also has a typo. This causes the
router boots without ethernet connectivity.

Fixed and and also renamed the DTS file to keep coherence with names.

Signed-off-by: Daniel Gonzalez 
diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh 
b/target/linux/brcm63xx/base-files/etc/diag.sh
index b864964..8b433d8 100644
--- a/target/linux/brcm63xx/base-files/etc/diag.sh
+++ b/target/linux/brcm63xx/base-files/etc/diag.sh
@@ -58,7 +58,7 @@ set_state() {
cpva642)
status_led="CPVA642:green:power:"
;;
-   ct536_ct5621)
+   ct-536p_5621t)
status_led="CT536_CT5621:green:power"
;;
cvg834g)
diff --git a/target/linux/brcm63xx/dts/ct-536plus.dts 
b/target/linux/brcm63xx/dts/ct-536plus.dts
new file mode 100644
index 000..e0bb5e3
--- /dev/null
+++ b/target/linux/brcm63xx/dts/ct-536plus.dts
@@ -0,0 +1,38 @@
+/dts-v1/;
+
+#include "bcm6348.dtsi"
+
+#include 
+
+/ {
+   model = "Comtrend CT-536+/CT-5621T";
+   compatible = "comtrend,ct-536+", "brcm,bcm6348";
+
+   gpio-keys-polled {
+   compatible = "gpio-keys-polled";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   poll-interval = <20>;
+   debounce-interval = <60>;
+
+   reset {
+   label = "reset";
+   gpios = <&gpio1 1 1>;
+   linux,code = ;
+   };
+   };
+
+   gpio-leds {
+   compatible = "gpio-leds";
+
+   power_green {
+   label = "CT536_CT5621:green:power";
+   gpios = <&gpio0 0 1>;
+   default-state = "on";
+   };
+   adsl_fail_green {
+   label = "CT536_CT5621:green:adsl-fail";
+   gpios = <&gpio0 2 1>;
+   };
+   };
+};
diff --git a/target/linux/brcm63xx/dts/ct536plus.dts 
b/target/linux/brcm63xx/dts/ct536plus.dts
deleted file mode 100644
index c05068a..000
--- a/target/linux/brcm63xx/dts/ct536plus.dts
+++ /dev/null
@@ -1,38 +0,0 @@
-/dts-v1/;
-
-#include "bcm6348.dtsi"
-
-#include 
-
-/ {
-   model = "Comtrend CT-536+/CT-5621T";
-   compatible = "comtrend,ct536+", "brcm,bcm6348";
-
-   gpio-keys-polled {
-   compatible = "gpio-keys-polled";
-   #address-cells = <1>;
-   #size-cells = <0>;
-   poll-interval = <20>;
-   debounce-interval = <60>;
-
-   reset {
-   label = "reset";
-   gpios = <&gpio1 1 1>;
-   linux,code = ;
-   };
-   };
-
-   gpio-leds {
-   compatible = "gpio-leds";
-
-   power_green {
-   label = "CT536_CT5621:green:power";
-   gpios = <&gpio0 0 1>;
-   default-state = "on";
-   };
-   adsl_fail_green {
-   label = "CT536_CT5621:green:adsl-fail";
-   gpios = <&gpio0 2 1>;
-   };
-   };
-};
diff --git a/target/linux/brcm63xx/image/Makefile 
b/target/linux/brcm63xx/image/Makefile
index e00b6fb..e5f2670 100644
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -527,7 +527,7 @@ $(eval $(call 
bcm63xxCfe,AR5381u,AR-5381u,ar-5381u,96328A-1241N,6328,--pad 8))
 # Comtrend AR-5387un
 $(eval $(call bcm63xxCfe,AR5387un,AR-5387un,ar-5387un,96328A-1441N1,6328,--pad 
8))
 # Comtrend 536, 5621
-$(eval $(call bcm63xxCfe,CT536_CT5621,CT536_CT5621,ct536plus,96348GW-11,6348))
+$(eval $(call bcm63xxCfe,CT536_CT5621,CT536_CT5621,ct-536plus,96348GW-11,6348))
 # Comtrend CT-5365
 $(eval $(call bcm63xxCfe,CT5365,CT-5365,ct-5365,96348A-122,6348))
 # Comtrend CT-6373
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ramips: Support LEDs on D-Link DIR-860L B1

2016-02-11 Thread Johannes Wienke
Adds the required gpio definitions.

Signed-off-by: Johannes Wienke 
---
 target/linux/ramips/dts/DIR-860L-B1.dts | 20 
 1 file changed, 20 insertions(+)

diff --git a/target/linux/ramips/dts/DIR-860L-B1.dts
b/target/linux/ramips/dts/DIR-860L-B1.dts
index da3f59c..a6add70 100644
--- a/target/linux/ramips/dts/DIR-860L-B1.dts
+++ b/target/linux/ramips/dts/DIR-860L-B1.dts
@@ -98,6 +98,26 @@
gpio-leds {
compatible = "gpio-leds";
+
+   power {
+   label = "dir-860l-b1:orange:power";
+   gpios = <&gpio0 13 1>;
+   };
+
+   power2 {
+   label = "dir-860l-b1:green:power";
+   gpios = <&gpio0 15 1>;
+   };
+
+   net {
+   label = "dir-860l-b1:orange:net";
+   gpios = <&gpio0 14 1>;
+   };
+
+   net2 {
+   label = "dir-860l-b1:green:net";
+   gpios = <&gpio0 16 1>;
+   };
};
gpio-keys-polled {
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] LXC is broken on Caos Calmer

2016-02-11 Thread Antonio Aloisio
Howdy!
Thanks to Daniel's suggestions I went a little bit further in creating
containers from the available templates but they remain broken and the
kernel is indeed not supporting LXC.
The point is that I would expect that if there are some packages available
in the repo, those are supposed to work.

Said that I can help to get something fixed here and submit some patches as
soon as I get how those problems should be addressed
First of all the kernel does not seem to support LXC.
I'm new to openwrt and i have some questions in order to get started... so,
sorry if they may sounds silly for some of you.

1. What would be the best strategy to distribute a working lxc kernel? can
lxc be part of the mainstream kernel for some targets?
2. Can we make  lxc packages available only to some architectures/targets?
3 Luka is there any public container repos which would work with openwrt?
4. is there any documentation about how to get lxc working on openwrt
devices?

Cheerio,
Antonio


gnuton@Honeypot:~$ lxc-checkconfig
--- Namespaces ---
Namespaces: required
Utsname namespace: missing
Ipc namespace: required
Pid namespace: required
User namespace: missing
Network namespace: missing
Multiple /dev/pts instances: missing

--- Control groups ---
Cgroup: required
Cgroup namespace: required
Cgroup device: missing
Cgroup sched: missing
Cgroup cpu account: missing
Cgroup memory controller: missing

--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
File capabilities: enabled

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig

On Thu, Feb 11, 2016 at 2:47 PM, Luka Perkov  wrote:

> Hi Daniel & Antonio,
>
> > On Feb 11, 2016, at 11:08 AM, Daniel Golle 
> wrote:
> >
> > Hi Antonio,
> >
> > thanks for trying all that and reporting back your results!
> >
> >> On Thu, Feb 11, 2016 at 12:47:50AM +0200, Antonio Aloisio wrote:
> >> Hi there!
> >> Here is a few findings about LXC templates available on OpenWRT CC.
> >>
> >> Just for reference, here below you can see all the templates available
> on
> >> CC and what works and what does not.
> >
> > Maybe we should split-up the templates into individual packages, each
> > having its own set of dependencies.
>
> I am ok with that. Feel free to send the patch.
>
> In general I would advise to make the container rootfs outside of OpenWrt.
> Making it in OpenWrt leads to unnecessary overhead.
>
> >> /usr/share/lxc/templates/lxc-oracle <-- BAD ARCHITECTURE. NO ARM
> >> /usr/share/lxc/templates/lxc-plamo <-- depends on "flock". It may work.
> I
> >> get Failed to download
> >
> > flock is available as a package, you should be able to install it.
> >
> >> /usr/share/lxc/templates/lxc-busybox <-- creates the containers, but
> >> doesn't start (busybox no statically linked)
> >
> > Well, that's odd, but there's not much we can do. Maybe report that
> > to LXC and let them know not everybody uses glibc...
> >
> >> /usr/share/lxc/templates/lxc-fedora <-- fails to
> >> download /releases/20/Fedora/armhfp/os
> >
> > Also, please report that upstream (check that it wasn't already fixed
> > in more recent versions of LXC)
> >
> >> /usr/share/lxc/templates/lxc-sshd <--- fails requires ssh-keygen. is it
> >> available on openwrt?
> >
> > Installing openssh-keygen, openssh-client and openssh-client-utils may
> > help...
> >
> >> /usr/share/lxc/templates/lxc-ubuntu-cloud <-- no idea what's broken
> >> /usr/share/lxc/templates/lxc-openmandriva
> >> /usr/share/lxc/templates/lxc-gentoo <-- requires tar. maybe works
> >220MB.
> >> Ran out of disk on /tmp
> >
> > Probably temp directory for LXC should be configurable, so it can
> > go to /mnt/tmp or somewhere with enough space on a specific system...
> >
> >> /usr/share/lxc/templates/lxc-download <-- no idea what's wrong
> >
> >
> >> /usr/share/lxc/templates/lxc-archlinux <-- fails require pacman. not
> >> available
> >
> > I agree it'd be nice to have, I remember that pacstrap was quite
> > painful to get working, I've tried that before...
> >
> >> /usr/share/lxc/templates/lxc-cirros <-- require tar. works? some problem
> >> still with lxc cgroups
> >
> > Did you compile OpenWrt from source?
> > I'm asking because LXC depends on CONFIG_LXC_KERNEL_OPTIONS and
> > CONFIG_LXC_BUSYBOX_OPTIONS to work properly, and I believe this isn't
> > enabled in the binary release of CC.
>
> Right.
>
> >> /usr/share/lxc/templates/lxc-debian <-- requires debootstrap. itäs not a
> >> openwrt package
> >> /usr/share/lxc/templates/lxc-ubuntu <-- requires debootstrap. itäs not a
> >> openwrt package
> >
> > You can install debootstrap, it is available, I've just updated it to
> > the most recent release.
> >
> >> /usr/share/lxc/templates/lxc-centos <-- requires yum. fails container
> >> creation
> >
> > Hm, nobody ever packaged all the foreign-distribution package managers
> > for OpenWrt. It's quite a lot of work...
> >
> >> /usr/share/lxc/templates/lxc-altlinux <-- requires apt-get. fail

Re: [OpenWrt-Devel] LXC is broken on Caos Calmer

2016-02-11 Thread Luka Perkov
Hi Daniel & Antonio,

> On Feb 11, 2016, at 11:08 AM, Daniel Golle  wrote:
> 
> Hi Antonio,
> 
> thanks for trying all that and reporting back your results!
> 
>> On Thu, Feb 11, 2016 at 12:47:50AM +0200, Antonio Aloisio wrote:
>> Hi there!
>> Here is a few findings about LXC templates available on OpenWRT CC.
>> 
>> Just for reference, here below you can see all the templates available on
>> CC and what works and what does not.
> 
> Maybe we should split-up the templates into individual packages, each
> having its own set of dependencies.

I am ok with that. Feel free to send the patch.

In general I would advise to make the container rootfs outside of OpenWrt. 
Making it in OpenWrt leads to unnecessary overhead.

>> /usr/share/lxc/templates/lxc-oracle <-- BAD ARCHITECTURE. NO ARM
>> /usr/share/lxc/templates/lxc-plamo <-- depends on "flock". It may work. I
>> get Failed to download
> 
> flock is available as a package, you should be able to install it.
> 
>> /usr/share/lxc/templates/lxc-busybox <-- creates the containers, but
>> doesn't start (busybox no statically linked)
> 
> Well, that's odd, but there's not much we can do. Maybe report that
> to LXC and let them know not everybody uses glibc...
> 
>> /usr/share/lxc/templates/lxc-fedora <-- fails to
>> download /releases/20/Fedora/armhfp/os
> 
> Also, please report that upstream (check that it wasn't already fixed
> in more recent versions of LXC)
> 
>> /usr/share/lxc/templates/lxc-sshd <--- fails requires ssh-keygen. is it
>> available on openwrt?
> 
> Installing openssh-keygen, openssh-client and openssh-client-utils may
> help...
> 
>> /usr/share/lxc/templates/lxc-ubuntu-cloud <-- no idea what's broken
>> /usr/share/lxc/templates/lxc-openmandriva
>> /usr/share/lxc/templates/lxc-gentoo <-- requires tar. maybe works >220MB.
>> Ran out of disk on /tmp
> 
> Probably temp directory for LXC should be configurable, so it can
> go to /mnt/tmp or somewhere with enough space on a specific system...
> 
>> /usr/share/lxc/templates/lxc-download <-- no idea what's wrong
> 
> 
>> /usr/share/lxc/templates/lxc-archlinux <-- fails require pacman. not
>> available
> 
> I agree it'd be nice to have, I remember that pacstrap was quite
> painful to get working, I've tried that before...
> 
>> /usr/share/lxc/templates/lxc-cirros <-- require tar. works? some problem
>> still with lxc cgroups
> 
> Did you compile OpenWrt from source?
> I'm asking because LXC depends on CONFIG_LXC_KERNEL_OPTIONS and
> CONFIG_LXC_BUSYBOX_OPTIONS to work properly, and I believe this isn't
> enabled in the binary release of CC.

Right.

>> /usr/share/lxc/templates/lxc-debian <-- requires debootstrap. itäs not a
>> openwrt package
>> /usr/share/lxc/templates/lxc-ubuntu <-- requires debootstrap. itäs not a
>> openwrt package
> 
> You can install debootstrap, it is available, I've just updated it to
> the most recent release.
> 
>> /usr/share/lxc/templates/lxc-centos <-- requires yum. fails container
>> creation
> 
> Hm, nobody ever packaged all the foreign-distribution package managers
> for OpenWrt. It's quite a lot of work...
> 
>> /usr/share/lxc/templates/lxc-altlinux <-- requires apt-get. fails container
>> creation
> 
> Why doesn't the template just you debootstrap...?
> 
>> /usr/share/lxc/templates/lxc-alpine <-- requires sha256sum. is it available?
> 
> Try installing coreutils-sha256sum which provides sha256sum
> 
>> /usr/share/lxc/templates/lxc-opensuse <-- requires zipper. not available
> 
> 
> Cheers
> 
> 
> Daniel
> 
>> 
>> Cheers,
>> Antonio
>> 
>> On Wed, Feb 10, 2016 at 10:03 PM, Daniel Golle 
>> wrote:
>> 
>>> Hi Antonio,
>>> 
 On Wed, Feb 10, 2016 at 09:52:25PM +0200, Antonio Aloisio wrote:
 Hi there,
 I have tried to run lxc on openwrt but it looks to me that those packages
 are broken.
>>> 
>>> I'm actively using LXC, however, I use a custom overlayfs method to
>>> create OpenWrt containerers

Yup. We don't have out of the box containers which are widely available. I 
often make OpenWrt containers from .tar rootfs archives.


 root@Honeypot:/home/gnuton# lxc-create -t download -n xx
 Setting up the GPG keyring
 ERROR: Unable to fetch GPG key from keyserver.
 lxc_container: lxccontainer.c: create_run_template: 1102 container
>>> creation
 template for xx failed
>>> 
>>> I manually use debootstrap to setup Debian rootfs and throwing that at
>>> LXC works great. I once went through the Debian template and believe it
>>> would make sense to fix it up to work on OpenWrt, so LXC becomes more
>>> useable. Do you have gnupg installed? If not or if GPG stuff fails for
>>> some reason, you can try to to modify the Debian template to use
>>> debootstrap having the signature checks disabled (not ideal,
>>> obviously).
>>> 
 I have also installed LXC LuCi web GUI and it doesn't work too.
 The GUI would allow me to create a openwrt based conatainer, but the
>>> truth
 is that there is no such template available as you may see from the above
>>>

[OpenWrt-Devel] [PATCH] [packages] util-linux: Subpackage for blkdiscard

2016-02-11 Thread Michal Hrusecky
Adding subpackage to make it possible to enable blkdiscard utility.

Signed-off-by: Michal Hrusecky 
---
 package/utils/util-linux/Makefile | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/package/utils/util-linux/Makefile 
b/package/utils/util-linux/Makefile
index eddbc2b..73903cd 100644
--- a/package/utils/util-linux/Makefile
+++ b/package/utils/util-linux/Makefile
@@ -137,6 +137,18 @@ define Package/agetty/description
  /bin/login command
 endef
 
+define Package/blkdiscard
+$(call Package/util-linux/Default)
+  TITLE:=discard sectors on a device
+  SUBMENU=disc
+endef
+
+define Package/blkdiscard/description
+ The blkdiscard is used to discard device sectors. This is useful for
+ solid-state drivers (SSDs) and thinly-provisioned storage. Unlike fstrim,
+ this command is used directly on the block device.
+endef
+
 define Package/blkid
 $(call Package/util-linux/Default)
   TITLE:=locate/print block device attributes
@@ -462,6 +474,11 @@ define Package/agetty/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/agetty $(1)/usr/sbin/
 endef
 
+define Package/blkdiscard/install
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/blkdiscard $(1)/usr/sbin/
+endef
+
 define Package/blkid/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/blkid $(1)/usr/sbin/
@@ -613,6 +630,7 @@ $(eval $(call BuildPackage,libmount))
 $(eval $(call BuildPackage,libsmartcols))
 $(eval $(call BuildPackage,libuuid))
 $(eval $(call BuildPackage,agetty))
+$(eval $(call BuildPackage,blkdiscard))
 $(eval $(call BuildPackage,blkid))
 $(eval $(call BuildPackage,cal))
 $(eval $(call BuildPackage,cfdisk))
-- 
2.7.0
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] [v3] ar71xx: Support for Ubiquiti UniFi AP AC LITE

2016-02-11 Thread p . wassi
Hi Vittorio,

sorry, what is broken with the patch?
Which things should be changed?

P.Wassi

> Hello,
> 
> It seems that whitespace is broken in this patch.
> 
> Can you resend it, please?
> 
> Thank you,
> Vittorio G
>
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel