[LEDE-DEV] [PATCH] malta: restore "be" subtarget from being source-only

2017-03-05 Thread Yousong Zhou
The malta "be" and "le" subtargets share the arch with many devices of
ar71xx and ramips.  They can be handy for testing, debugging, trying
both snapshot and release builds.

This commit makes the "be" subtarget part of the ci and release builds

Signed-off-by: Yousong Zhou 
---
 target/linux/malta/Makefile   | 2 +-
 target/linux/malta/be64/target.mk | 1 +
 target/linux/malta/le/target.mk   | 1 +
 target/linux/malta/le64/target.mk | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile
index caa51ea..34818f1 100644
--- a/target/linux/malta/Makefile
+++ b/target/linux/malta/Makefile
@@ -12,7 +12,7 @@ CPU_TYPE:=24kc
 SUBTARGETS:=le be le64 be64
 INITRAMFS_EXTRA_FILES:=
 MAINTAINER:=Florian Fainelli 
-FEATURES:=ramdisk source-only
+FEATURES:=ramdisk
 
 KERNEL_PATCHVER:=4.4
 
diff --git a/target/linux/malta/be64/target.mk 
b/target/linux/malta/be64/target.mk
index df67230..3a5bb6a 100644
--- a/target/linux/malta/be64/target.mk
+++ b/target/linux/malta/be64/target.mk
@@ -1,6 +1,7 @@
 ARCH:=mips64
 CPU_TYPE:=mips64
 SUBTARGET:=be64
+FEATURES+=source-only
 BOARDNAME:=Big Endian (64-bits)
 
 define Target/Description
diff --git a/target/linux/malta/le/target.mk b/target/linux/malta/le/target.mk
index 2ee0ee0..e642510 100644
--- a/target/linux/malta/le/target.mk
+++ b/target/linux/malta/le/target.mk
@@ -1,5 +1,6 @@
 ARCH:=mipsel
 SUBTARGET:=le
+FEATURES+=source-only
 BOARDNAME:=Little Endian
 
 define Target/Description
diff --git a/target/linux/malta/le64/target.mk 
b/target/linux/malta/le64/target.mk
index a5ec081..a0a55af 100644
--- a/target/linux/malta/le64/target.mk
+++ b/target/linux/malta/le64/target.mk
@@ -1,6 +1,7 @@
 ARCH:=mips64el
 CPU_TYPE:=mips64
 SUBTARGET:=le64
+FEATURES+=source-only
 BOARDNAME:=Little Endian (64-bits)
 
 define Target/Description
-- 
2.6.4


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


[LEDE-DEV] [PATCH] openvpn: move list of params and bools to a separate file

2017-03-05 Thread Yousong Zhou
So that future patches for addition/removal of them can be more
readable

Signed-off-by: Yousong Zhou 
---
 package/network/services/openvpn/Makefile  |   6 +-
 .../network/services/openvpn/files/openvpn.init|  32 +---
 .../network/services/openvpn/files/openvpn.options | 197 +
 3 files changed, 205 insertions(+), 30 deletions(-)
 create mode 100644 package/network/services/openvpn/files/openvpn.options

diff --git a/package/network/services/openvpn/Makefile 
b/package/network/services/openvpn/Makefile
index 7507e20..ebfc51f 100644
--- a/package/network/services/openvpn/Makefile
+++ b/package/network/services/openvpn/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=openvpn
 
 PKG_VERSION:=2.4.0
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE_URL:=http://swupdate.openvpn.net/community/releases
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@@ -106,6 +106,7 @@ endef
 define Package/openvpn-$(BUILD_VARIANT)/install
$(INSTALL_DIR) \
$(1)/usr/sbin \
+   $(1)/usr/share/openvpn \
$(1)/etc/init.d \
$(1)/etc/config \
$(1)/etc/openvpn \
@@ -118,6 +119,9 @@ define Package/openvpn-$(BUILD_VARIANT)/install
$(INSTALL_BIN) \
files/openvpn.init \
$(1)/etc/init.d/openvpn
+   $(INSTALL_DATA) \
+   files/openvpn.options \
+   $(1)/usr/share/openvpn/openvpn.options
 
$(INSTALL_CONF) files/openvpn.config \
$(1)/etc/config/openvpn
diff --git a/package/network/services/openvpn/files/openvpn.init 
b/package/network/services/openvpn/files/openvpn.init
index d1f37d5..0d77d65 100644
--- a/package/network/services/openvpn/files/openvpn.init
+++ b/package/network/services/openvpn/files/openvpn.init
@@ -93,40 +93,14 @@ start_instance() {
[ ! -d "/var/etc" ] && mkdir -p "/var/etc"
[ -f "/var/etc/openvpn-$s.conf" ] && rm "/var/etc/openvpn-$s.conf"
 
-   # append flags
-   append_bools "$s" \
-   allow_recursive_routing auth_nocache auth_user_pass_optional 
bind ccd_exclusive client client_cert_not_required \
-   client_to_client comp_noadapt disable disable_occ down_pre 
duplicate_cn fast_io float http_proxy_retry \
-   ifconfig_noexec ifconfig_nowarn ifconfig_pool_linear 
management_forget_disconnect management_hold \
-   management_query_passwords management_signal mktun mlock 
mtu_test multihome mute_replay_warnings \
-   ncp_disable nobind no_iv no_name_remapping no_replay opt_verify 
passtos persist_key persist_local_ip \
-   persist_remote_ip persist_tun ping_timer_rem pull push_reset 
remote_random rmtun route_noexec route_nopull \
-   single_session socks_proxy_retry suppress_timestamps 
tcp_nodelay test_crypto tls_client tls_exit tls_server \
-   tun_ipv6 up_delay up_restart username_as_common_name
-
-   # append params
-   append_params "$s" \
-   cd askpass auth auth_retry auth_user_pass auth_user_pass_verify 
bcast_buffers ca cert capath \
-   chroot cipher client_config_dir client_connect 
client_disconnect comp_lzo compress connect_freq \
-   connect_retry connect_timeout connect_retry_max crl_verify dev 
dev_node dev_type dh \
-   ecdh_curve echo engine explicit_exit_notify fragment group 
hand_window hash_size http_proxy \
-   http_proxy_option http_proxy_timeout ifconfig ifconfig_pool 
ifconfig_pool_persist ifconfig_push \
-   inactive ipchange iroute keepalive key key_direction key_method 
keysize learn_address link_mtu lladdr \
-   local log log_append lport management management_log_cache 
max_clients max_routes_per_client mode \
-   mssfix mtu_disc mute ncp_ciphers nice ns_cert_type ping 
ping_exit ping_restart pkcs12 plugin \
-   port port_share prng proto pull_filter rcvbuf redirect_gateway 
remap_usr1 remote remote_cert_eku \
-   remote_cert_ku remote_cert_tls reneg_bytes reneg_pkts reneg_sec 
replay_persist replay_window \
-   resolv_retry route route_delay route_gateway route_metric 
route_pre_down route_up rport \
-   script_security secret server server_bridge setenv shaper 
sndbuf socks_proxy status status_version \
-   syslog tcp_queue_limit tls_auth tls_crypt tls_version_min 
tls_cipher tls_timeout \
-   tls_verify tmp_dir topology tran_window tun_mtu tun_mtu_extra 
txqueuelen user verb \
-   down push up verify_x509_name x509_username_field ifconfig_ipv6 
route_ipv6 server_ipv6 \
-   ifconfig_ipv6_pool ifconfig_ipv6_push iroute_ipv6
+   append_bools "$s" $OPENVPN_BOOLS
+   append_params "$s" $OPENVPN_PARAMS
 
openvpn_add_instance "$s" "/var/etc" "openvpn-$s.conf"
 }
 
 start_service() {
+   . /usr/share/openvpn/openvpn.options
config_load 'openvpn

Re: [LEDE-DEV] Luci/Statistics problem

2017-03-05 Thread e9hack
Hi,

the issue depends on the rights of luci_statistics. If read for group and 
others is not set, Luci/Statistics does fail.
If read is set for group and others, it works as expected. I did check my old 
configuration backups, read for others and
group was never set in the past.

Regards,
Hartmut

Am 03.03.2017 um 18:54 schrieb Daniel Dickinson:
> On Fri, 3 Mar 2017 09:08:02 +0100
> e9hack  wrote:
> 
>> Hi,
>>
>> Lusi/Statistics doesn't work any more. For every page, I got an
>> error, for example:
>> https://my-box.lan/cgi-bin/luci/admin/statistics/graph/uptime?
>>
>> The browser shows this:
>> /usr/lib/lua/luci/dispatcher.lua:380: Failed to execute call
>> dispatcher target for entry '/admin/statistics/graph/uptime'. The
>> called action terminated with an
>> exception: /usr/lib/lua/luci/util.lua:196: attempt to get length of
>> local 'str' (a nil value) stack traceback: [C]: in function 'assert'
>>  /usr/lib/lua/luci/dispatcher.lua:380: in function 'dispatch'
>>  /usr/lib/lua/luci/dispatcher.lua:109: in function
>> 
>>
> 
> There is an issue for that here:
> https://github.com/openwrt/luci/issues/970, however it seems to only
> trigger under particular circumstances as others have not reported this
> issue in month and a half since I noticed.  Can you give more details
> about your build in the Issue comments?  Are you using jails (I was).
> It seems to me that the lua uci plugin isn't finding the config files
> in /etc/config.
> 
> Regards,
> 
> Daniel
> 


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


Re: [LEDE-DEV] [PATCH] ramips: Add patch to reset SPI flash to 3-byte addressing

2017-03-05 Thread Daniel Golle
Hi,

we've previously discussed [1] the patch on the mailing list and I
believe that rather switching to 4-byte addressing mode we should
rather use 4-byte opcodes instead because that would prevent the whole
problem and provide a more reliable way to support large flash chips.
This is also how it's done upstream and if there is a problem with
that specific flash chip (maybe 4-byte opcodes don't work whatsoever)
we should make sure that switching to 4-byte mode is really the only
option we have. From Alex' answer I understood that backporting the
upstream commit [3] didn't work for him. Can anyone else try if
backporting commit [2] and [3] works as an alternative for them?

Cheers

Daniel


[1] http://lists.infradead.org/pipermail/lede-dev/2017-January/005620.html
[2] 
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=902cc69a0820252c84c6f7caed350882cea166ba
[3] 
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=3274ba26f27becfc4193ec6e229288140651f240

On Sat, Mar 04, 2017 at 11:14:24PM +0100, davidea wrote:
> what is the state of this patch?
> 
> i have an mqmakers witi board with mt7621 and a spi flash mx25l6406 with
> this beavior , when i reboot it , it's stop working until i power off and on
> ...
> 
> the spi flash seems do not have a reset pin
> 
> 
> Il 30/01/2017 23:53, Alexandru Gagniuc ha scritto:
> > This patch is designed to workaround an issue where an mt7620 will
> > hang after a reboot. This happens because the bootrom gets confused
> > when the SPI flash is left in 4-byte addressing mode. This change
> > makes sure that we can reboot the system under normal circumstances,
> > but does not protect against system crashes.
> > 
> > Signed-off-by: Alexandru Gagniuc 
> > ---
> >   ...Reset-chip-to-3-byte-addressing-on-system.patch | 65 
> > ++
> >   1 file changed, 65 insertions(+)
> >   create mode 100644 
> > target/linux/ramips/patches-4.4/0800-mtd-m25p80-Reset-chip-to-3-byte-addressing-on-system.patch
> > 
> > diff --git 
> > a/target/linux/ramips/patches-4.4/0800-mtd-m25p80-Reset-chip-to-3-byte-addressing-on-system.patch
> >  
> > b/target/linux/ramips/patches-4.4/0800-mtd-m25p80-Reset-chip-to-3-byte-addressing-on-system.patch
> > new file mode 100644
> > index 000..de4ee2c
> > --- /dev/null
> > +++ 
> > b/target/linux/ramips/patches-4.4/0800-mtd-m25p80-Reset-chip-to-3-byte-addressing-on-system.patch
> > @@ -0,0 +1,65 @@
> > +From 0f7fcc3dfc27a91e7672e9e589f3f558e8c41737 Mon Sep 17 00:00:00 2001
> > +From: Alexandru Gagniuc 
> > +Date: Mon, 30 Jan 2017 13:30:33 -0800
> > +Subject: [PATCH] mtd: m25p80: Reset chip to 3-byte addressing on system 
> > reboot
> > +
> > +Some SOCs can not handle 4-byte addressing in their mask ROM. On such
> > +devices if we leave the SPI flash in 4-byte mode, then reboot the
> > +system, the device will not boot.
> > +
> > +Some SoCs have a special output to reset all the on-board peripherals.
> > +This pin should be connected to the !RESET pin of the flash as well.
> > +Unfortunately, not all boards implement this. As a workaround for such
> > +hardware, reset the SPI flash to 3-byte addressing mode. This does not
> > +protect against system crashes, but it does allow the system to reboot
> > +in the case of a normal reboot.
> > +
> > +Cc: Paul Fertser 
> > +Signed-off-by: Alexandru Gagniuc 
> > +---
> > + drivers/mtd/devices/m25p80.c | 15 +++
> > + 1 file changed, 15 insertions(+)
> > +
> > +diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
> > +index fe9ceb7..2151975 100644
> > +--- a/drivers/mtd/devices/m25p80.c
> >  b/drivers/mtd/devices/m25p80.c
> > +@@ -27,6 +27,9 @@
> > + #include 
> > + #include 
> > +
> > ++#define OPCODE_RESET_ENABLE   0x66
> > ++#define OPCODE_RESET  0x99
> > ++
> > + #define   MAX_CMD_SIZE6
> > + struct m25p {
> > +   struct spi_device   *spi;
> > +@@ -168,6 +171,17 @@ static int m25p80_erase(struct spi_nor *nor, loff_t 
> > offset)
> > +   return 0;
> > + }
> > +
> > ++void m25p80_reboot(struct mtd_info *mtd)
> > ++{
> > ++  struct spi_nor *nor = container_of(mtd, struct spi_nor, mtd);
> > ++  struct m25p *flash = nor->priv;
> > ++
> > ++  flash->command[0] = OPCODE_RESET_ENABLE;
> > ++  spi_write(flash->spi, flash->command, 1);
> > ++  flash->command[0] = OPCODE_RESET;
> > ++  spi_write(flash->spi, flash->command, 1);
> > ++}
> > ++
> > + /*
> > +  * board specific setup should have ensured the SPI clock used here
> > +  * matches what the READ command supports, at least until this driver
> > +@@ -197,6 +211,7 @@ static int m25p_probe(struct spi_device *spi)
> > +   nor->erase = m25p80_erase;
> > +   nor->write_reg = m25p80_write_reg;
> > +   nor->read_reg = m25p80_read_reg;
> > ++  nor->mtd._reboot = m25p80_reboot;
> > +
> > +   nor->dev = &spi->dev;
> > +   nor->flash_node = spi->dev.of_node;
> > +--
> > +2.9.3
> > +
> 
> 
> ___
> Lede-dev

[LEDE-DEV] [PATCH 01/12] opkg: add update-alternatives support

2017-03-05 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 package/system/opkg/Makefile  |   5 +-
 package/system/opkg/files/update-alternatives | 163 ++
 2 files changed, 167 insertions(+), 1 deletion(-)
 create mode 100755 package/system/opkg/files/update-alternatives

diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index fbf87cb..56f5cce 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=opkg
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_FLAGS:=essential
 
 PKG_SOURCE_PROTO:=git
@@ -94,6 +94,9 @@ define Package/opkg/install
   endif
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/opkg-key $(1)/usr/sbin/
+   $(INSTALL_BIN) ./files/update-alternatives $(1)/usr/sbin/
+   $(INSTALL_DIR) $(1)/etc/config
+   touch $(1)/etc/config/opkg
 endef
 
 define Host/Install
diff --git a/package/system/opkg/files/update-alternatives 
b/package/system/opkg/files/update-alternatives
new file mode 100755
index 000..6a8f18b
--- /dev/null
+++ b/package/system/opkg/files/update-alternatives
@@ -0,0 +1,163 @@
+#!/bin/sh
+
+usage() {
+   cat <::
+
+EOF
+   exit 1
+}
+
+errmsg() {
+   echo "$0: $@" >&2
+}
+
+uci_() {
+   $UCI ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} "$@"
+}
+
+check_path() {
+   local path="${IPKG_INSTROOT}$1"
+
+   [ -L "$path" -o ! -e "$path" ] || {
+   errmsg "$0: $path exists and is not an symbolic file"
+   exit 1
+   }
+}
+
+update_path() {
+   local path="$1"
+   local found_section found_altpath
+   local found_prio=-1 found_prio_altpath
+   local IFS cur altpath
+
+   config_load opkg
+   config_foreach find_path alternatives "$prio" "$path"
+   if [ -n "$found_prio_altpath" ]; then
+   IFS=:; set -- $found_prio_altpath; altpath=$2; IFS="$oIFS"
+   cur="$(readlink -f "$path")"
+   if [ "$cur" != "$altpath" ]; then
+   errmsg "link $path -> $altpath"
+   ln -sf "$altpath" "${IPKG_INSTROOT}$path"
+   fi
+   elif [ -n "$found_section" ]; then
+   errmsg "remove empty alternatives section for $path"
+   uci_ delete "opkg.$found_section"
+   uci_ commit opkg
+   rm -f "${IPKG_INSTROOT}$path"
+   fi
+}
+
+find_altpath() {
+   local cfgaltpath="$1"
+   local cfg="$2"
+   local prio="$3"
+   local altpath="$4"
+   local cfgprio cfgaltpath_
+   local oIFS="$IFS"; IFS=:; set -- $cfgaltpath; cfgprio="$1"; 
cfgaltpath_="$2"; IFS="$oIFS"
+
+   if [ "$cfgaltpath_" = "$altpath" ]; then
+   found_altpath="$cfgaltpath"
+   fi
+   if [ "$cfgprio" -gt "$found_prio" ]; then
+   found_prio="$cfgprio"
+   found_prio_altpath="$cfgaltpath"
+   fi
+}
+
+find_path() {
+   local cfg="$1"
+   local prio="$2"
+   local path="$3"
+   local altpath="$4"
+   local cfgpath
+
+   config_get cfgpath "$cfg" path
+   [ "$cfgpath" = "$path" ] || return
+   found_section="$cfg"
+   config_list_foreach "$cfg" altpath find_altpath "$cfg" "$prio" 
"$altpath"
+}
+
+cmd_update() {
+   local spec="$1"
+   local prio path altpath
+   local oIFS="$IFS"
+   local found_section found_altpath
+   local found_prio=-1 found_prio_altpath
+
+   IFS=:; set -- $spec; IFS="$oIFS"
+   prio="$1"
+   path="$2"
+   altpath="$3"
+   check_path "$path"
+   if [ ! -e "${IPKG_INSTROOT}$altpath" ]; then
+   errmsg "$altpath does not exist"
+   return 1
+   fi
+
+   config_load opkg
+   config_foreach find_path alternatives "$prio" "$path" "$altpath"
+   if [ -z "$found_section" ]; then
+   found_section="$(uci_ add opkg alternatives)"
+   uci_ set opkg.$found_section.path=$path
+   fi
+   if [ -n "$found_altpath" ]; then
+   if [ "$found_altpath" != "$prio:$altpath" ]; then
+   # update priority
+   uci_ del_list opkg.$found_section.altpath=$found_altpath
+   uci_ add_list opkg.$found_section.altpath=$prio:$altpath
+   fi
+   else
+   uci_ add_list opkg.$found_section.altpath=$prio:$altpath
+   fi
+   uci_ commit opkg
+   update_path "$path"
+}
+
+cmd_remove() {
+   local spec="$1"
+   local prio path altpath
+   local oIFS="$IFS"
+   local found_section found_altpath
+   local found_prio=-1 found_prio_altpath
+
+   IFS=:; set -- $spec; IFS="$oIFS"
+   prio="$1"
+   path="$2"
+   altpath="$3"
+   check_path "$path"
+
+   config_load opkg
+   config_foreach find_path alternatives "$prio" "$path" "$altpath"
+   if [ -n "$found_section" -a -n "$found_altpath" ]; then
+  

[LEDE-DEV] [PATCH 00/12] alternatives support

2017-03-05 Thread Yousong Zhou
This patch set tries to make it possible that files serving the same purpose
and installed to different locations can be available under the same name
through a symbolic link

The idea is from alternatives of debian system [1,2].  "ip" command is a good
example of the problem it tries to solve [3].   Files provided by different
packages cannot be installed to the same location, so we have busybox ip,
ip-tiny, ip-full all installed to different locations

It works by first adding to CONTROL file of each ipkg a new field 
"Alternatives",
which is a list of specs of the following form seprated by commas to describe
alternatives provided by this package

::

The new field will be interpreted by postinst and prerm script.   will be
a symbolic link to  of the highest , and updates will be made to
UCI config "opkg"

Several patches for uci are also included here to support usage at build-time.
The whole series is available in my staging tree [4]

 [1] https://wiki.debian.org/DebianAlternatives
 [2] 
https://debian-administration.org/article/91/Using_the_Debian_alternatives_system
 [3] https://bugs.lede-project.org/index.php?do=details&task_id=428
 [4] https://git.lede-project.org/?p=lede/yousong/staging.git;a=summary

Content of UCI config file "opkg" when busybox and ip-tiny are installed

root@LEDE:/# uci export opkg
package opkg

config alternatives
option path '/sbin/ip'
list altpath '100:/bin/busybox'
list altpath '200:/sbin/ip-tiny'

Install ip-full

root@LEDE:/# opkg install /tmp/ip-full_4.4.0-9_mips_24kc.ipk
Installing ip-full (4.4.0-9) to root...
Configuring ip-full.
/usr/sbin/update-alternatives: link /sbin/ip -> /sbin/ip-full
root@LEDE:/# uci export opkg
package opkg

config alternatives
option path '/sbin/ip'
list altpath '100:/bin/busybox'
list altpath '200:/sbin/ip-tiny'
list altpath '300:/sbin/ip-full'

Remove ip-full

root@LEDE:/# opkg remove ip-full
Removing package ip-full from root...
/usr/sbin/update-alternatives: link /sbin/ip -> /sbin/ip-tiny
root@LEDE:/# uci export opkg
package opkg

config alternatives
option path '/sbin/ip'
list altpath '100:/bin/busybox'
list altpath '200:/sbin/ip-tiny'

Remove ip-tiny

root@LEDE:/# opkg remove ip-tiny
Removing package ip-tiny from root...
/usr/sbin/update-alternatives: link /sbin/ip -> /bin/busybox
root@LEDE:/# uci export opkg
package opkg

config alternatives
option path '/sbin/ip'
list altpath '100:/bin/busybox'

The "opkg" file and update-alternatives are not intended for interactive use,
but let's a demo can be useful for understanding

root@LEDE:/# update-alternatives remove --spec 100:/sbin/ip:/bin/busybox
/usr/sbin/update-alternatives: remove empty alternatives section for 
/sbin/ip
root@LEDE:/# uci export opkg
package opkg

root@LEDE:/# ip
/bin/ash: ip: not found
root@LEDE:/# update-alternatives update --spec 100:/sbin/ip:/bin/busybox
/usr/sbin/update-alternatives: link /sbin/ip -> /bin/busybox
root@LEDE:/# uci export opkg
package opkg

config alternatives
option path '/sbin/ip'
list altpath '100:/bin/busybox'

root@LEDE:/#

Yousong Zhou (12):
  opkg: add update-alternatives support
  uci: patch for static host build
  uci: add host build
  build: prepare_rootfs: preserve prerm script
  build: cleanup tmp/ dir of target rootfs
  build: opkg: enable presence of uci
  build: ipkg: new field Alternatives
  base-files: link /var to tmp instead of /tmp
  base-files: enable presence of uci when IPKG_INSTROOT is set
  base-files: add update-alternatives call to default_{postinst,prerm}
  busybox: add as an alternative of /sbin/ip
  iproute2: add ip-tiny, ip-full as alternatives of /sbin/ip

 include/package-ipkg.mk|   1 +
 include/rootfs.mk  |  20 ++-
 package/Makefile   |   3 +-
 package/base-files/Makefile|   4 +-
 package/base-files/files/lib/functions.sh  |  21 ++-
 package/network/utils/iproute2/Makefile|  28 ++--
 package/system/opkg/Makefile   |   5 +-
 package/system/opkg/files/update-alternatives  | 163 +
 package/system/uci/Makefile|  15 +-
 package/system/uci/files/lib/config/uci.sh |  31 ++--
 .../uci/patches/0001-build-fix-BUILD_STATIC.patch  |  63 
 ...-redundant-NULL-check-on-return-value-of-.patch |  29 
 ...w-settin

[LEDE-DEV] [PATCH 02/12] uci: patch for static host build

2017-03-05 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 .../uci/patches/0001-build-fix-BUILD_STATIC.patch  | 63 ++
 ...-redundant-NULL-check-on-return-value-of-.patch | 29 ++
 ...w-setting-confdir-and-savedir-with-enviro.patch | 58 
 3 files changed, 150 insertions(+)
 create mode 100644 package/system/uci/patches/0001-build-fix-BUILD_STATIC.patch
 create mode 100644 
package/system/uci/patches/0002-file-remove-redundant-NULL-check-on-return-value-of-.patch
 create mode 100644 
package/system/uci/patches/0003-libuci-allow-setting-confdir-and-savedir-with-enviro.patch

diff --git a/package/system/uci/patches/0001-build-fix-BUILD_STATIC.patch 
b/package/system/uci/patches/0001-build-fix-BUILD_STATIC.patch
new file mode 100644
index 000..4a1bfa8
--- /dev/null
+++ b/package/system/uci/patches/0001-build-fix-BUILD_STATIC.patch
@@ -0,0 +1,63 @@
+From 1c109a2247240846a853996d24305d1e3ced2581 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou 
+Date: Sat, 4 Mar 2017 21:12:46 +0800
+Subject: [PATCH 1/3] build: fix BUILD_STATIC
+
+ - Build libuci.a in addition to libuci.so
+ - Build uci cli utitlity statically if BUILD_STATIC is enabled
+
+Signed-off-by: Yousong Zhou 
+---
+ CMakeLists.txt | 24 
+ 1 file changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a900a15..2df6fa7 100644
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -8,12 +8,7 @@ ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I. 
-DUCI_PREFIX="${CMAKE_INST
+ OPTION(UCI_DEBUG "debugging support" OFF)
+ OPTION(UCI_DEBUG_TYPECAST "typecast debugging support" OFF)
+ OPTION(BUILD_LUA "build Lua binding" ON)
+-
+-IF(BUILD_STATIC)
+-  FIND_LIBRARY(ubox_library NAMES ubox.a)
+-ELSE(BUILD_STATIC)
+-  FIND_LIBRARY(ubox_library NAMES ubox)
+-ENDIF(BUILD_STATIC)
++OPTION(BUILD_STATIC "statically linking uci" OFF)
+ 
+ FIND_PATH(ubox_include_dir libubox/usock.h)
+ 
+@@ -23,13 +18,26 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} 
${ubox_include_dir})
+ 
+ SET(LIB_SOURCES libuci.c file.c util.c delta.c parse.c blob.c)
+ 
++FIND_LIBRARY(ubox NAMES ubox)
++IF(BUILD_STATIC)
++  FIND_LIBRARY(ubox-static NAMES libubox.a)
++ENDIF(BUILD_STATIC)
++
+ ADD_LIBRARY(uci SHARED ${LIB_SOURCES})
+-TARGET_LINK_LIBRARIES(uci ${ubox_library})
+ SET_TARGET_PROPERTIES(uci PROPERTIES OUTPUT_NAME uci)
++TARGET_LINK_LIBRARIES(uci ${ubox})
++
++ADD_LIBRARY(uci-static STATIC ${LIB_SOURCES})
++SET_TARGET_PROPERTIES(uci-static PROPERTIES OUTPUT_NAME uci)
++TARGET_LINK_LIBRARIES(uci-static ${ubox-static})
+ 
+ ADD_EXECUTABLE(cli cli.c)
+ SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME uci)
+-TARGET_LINK_LIBRARIES(cli uci)
++IF(BUILD_STATIC)
++  TARGET_LINK_LIBRARIES(cli uci-static ${ubox-static})
++ELSE(BUILD_STATIC)
++  TARGET_LINK_LIBRARIES(cli uci ubox)
++ENDIF(BUILD_STATIC)
+ 
+ ADD_LIBRARY(ucimap STATIC ucimap.c)
+ 
+-- 
+2.6.4
+
diff --git 
a/package/system/uci/patches/0002-file-remove-redundant-NULL-check-on-return-value-of-.patch
 
b/package/system/uci/patches/0002-file-remove-redundant-NULL-check-on-return-value-of-.patch
new file mode 100644
index 000..0f27af1
--- /dev/null
+++ 
b/package/system/uci/patches/0002-file-remove-redundant-NULL-check-on-return-value-of-.patch
@@ -0,0 +1,29 @@
+From 7e0f33c7b4747a2b48588cc3337b01c19c9b562d Mon Sep 17 00:00:00 2001
+From: Yousong Zhou 
+Date: Wed, 27 May 2015 10:30:42 +0800
+Subject: [PATCH 2/3] file: remove redundant NULL check on return value of
+ uci_realloc()
+
+Because the check will be done by uci_realloc itself.
+
+Signed-off-by: Yousong Zhou 
+---
+ file.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/file.c b/file.c
+index 7e1e4e6..151a308 100644
+--- a/file.c
 b/file.c
+@@ -70,8 +70,6 @@ __private void uci_getln(struct uci_context *ctx, int offset)
+ 
+   pctx->bufsz *= 2;
+   pctx->buf = uci_realloc(ctx, pctx->buf, pctx->bufsz);
+-  if (!pctx->buf)
+-  UCI_THROW(ctx, UCI_ERR_MEM);
+   } while (1);
+ }
+ 
+-- 
+2.6.4
+
diff --git 
a/package/system/uci/patches/0003-libuci-allow-setting-confdir-and-savedir-with-enviro.patch
 
b/package/system/uci/patches/0003-libuci-allow-setting-confdir-and-savedir-with-enviro.patch
new file mode 100644
index 000..801420d
--- /dev/null
+++ 
b/package/system/uci/patches/0003-libuci-allow-setting-confdir-and-savedir-with-enviro.patch
@@ -0,0 +1,58 @@
+From 8ae26f2c0152c6bd58b7404a400e41405b034cc9 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou 
+Date: Sun, 5 Mar 2017 13:43:05 +0800
+Subject: [PATCH 3/3] libuci: allow setting confdir and savedir with
+ environment variables
+
+-p and -P option of uci cli utitlity is not enough for 2 reasons
+
+ - Compile-time default cannot be ignored
+ - CLI_FLAG_NOCOMMIT will be in effect with -P option
+
+Signed-off-by: Yousong Zhou 
+---
+ libuci.c | 21 +++--
+ 1 file changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/libuci.c b/libuci.c
+index a9e70e8..19ea20f 100644

[LEDE-DEV] [PATCH 04/12] build: prepare_rootfs: preserve prerm script

2017-03-05 Thread Yousong Zhou
They will still be needed at the time when pre-installed packages are to
be removed on target device

Signed-off-by: Yousong Zhou 
---
 include/rootfs.mk | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/rootfs.mk b/include/rootfs.mk
index c014b1d..dc400a0 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -82,7 +82,6 @@ define prepare_rootfs
@-find $(1) -name '.#*' | $(XARGS) rm -f
rm -f $(1)/usr/lib/opkg/lists/*
rm -f $(1)/usr/lib/opkg/info/*.postinst*
-   rm -f $(1)/usr/lib/opkg/info/*.prerm*
$(call clean_ipkg,$(1))
$(call mklibs,$(1))
 endef
-- 
2.6.4


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


[LEDE-DEV] [PATCH 03/12] uci: add host build

2017-03-05 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 package/system/uci/Makefile| 15 ++-
 package/system/uci/files/lib/config/uci.sh | 31 --
 2 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile
index b4d019c..dc6b363 100644
--- a/package/system/uci/Makefile
+++ b/package/system/uci/Makefile
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uci
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL=$(LEDE_GIT)/project/uci.git
 PKG_SOURCE_PROTO:=git
@@ -24,7 +24,10 @@ PKG_MAINTAINER:=Felix Fietkau 
 
 PKG_BUILD_PARALLEL:=0
 
+HOST_BUILD_DEPENDS:=libubox/host
+
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/cmake.mk
 
 # set to 1 to enable debugging
@@ -58,6 +61,10 @@ CMAKE_OPTIONS = \
-DLUAPATH=/usr/lib/lua \
$(if $(DEBUG),-DUCI_DEBUG=ON)
 
+CMAKE_HOST_OPTIONS += \
+   -DBUILD_STATIC=ON \
+   -DBUILD_LUA=OFF \
+
 define Package/libuci/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/libuci.so* $(1)/lib/
@@ -83,6 +90,12 @@ define Build/InstallDev
$(CP) $(PKG_BUILD_DIR)/libucimap.a $(1)/usr/lib
 endef
 
+define Host/Install
+   $(INSTALL_DIR) $(STAGING_DIR_HOST)/sbin
+   $(INSTALL_BIN) $(HOST_BUILD_DIR)/uci $(STAGING_DIR_HOST)/sbin/uci
+endef
+
 $(eval $(call BuildPackage,uci))
 $(eval $(call BuildPackage,libuci))
 $(eval $(call BuildPackage,libuci-lua))
+$(eval $(call HostBuild))
diff --git a/package/system/uci/files/lib/config/uci.sh 
b/package/system/uci/files/lib/config/uci.sh
index 50891a6..d716723 100644
--- a/package/system/uci/files/lib/config/uci.sh
+++ b/package/system/uci/files/lib/config/uci.sh
@@ -19,6 +19,9 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 CONFIG_APPEND=
+UCI="${UCI:-/sbin/uci}"
+UCI_STATE_DIR="${IPKG_INSTROOT}/var/state}"
+
 uci_load() {
local PACKAGE="$1"
local DATA
@@ -37,7 +40,7 @@ uci_load() {
export ${NO_EXPORT:+-n} CONFIG_SECTION=
fi
 
-   DATA="$(/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} 
${LOAD_STATE:+-P /var/state} -S -n export "$PACKAGE" 2>/dev/null)"
+   DATA="$($UCI ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} ${LOAD_STATE:+-P 
"$UCI_STATE_DIR"} -S -n export "$PACKAGE" 2>/dev/null)"
RET="$?"
[ "$RET" != 0 -o -z "$DATA" ] || eval "$DATA"
unset DATA
@@ -48,9 +51,9 @@ uci_load() {
 
 uci_set_default() {
local PACKAGE="$1"
-   /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show "$PACKAGE" > 
/dev/null && return 0
-   /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} import "$PACKAGE"
-   /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit "$PACKAGE"
+   $UCI ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show "$PACKAGE" > 
/dev/null && return 0
+   $UCI ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} import "$PACKAGE"
+   $UCI ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit "$PACKAGE"
 }
 
 uci_revert_state() {
@@ -58,7 +61,7 @@ uci_revert_state() {
local CONFIG="$2"
local OPTION="$3"
 
-   /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -P /var/state revert 
"$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
+   $UCI ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -P "$UCI_STATE_DIR" revert 
"$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
 }
 
 uci_set_state() {
@@ -68,7 +71,7 @@ uci_set_state() {
local VALUE="$4"
 
[ "$#" = 4 ] || return 0
-   /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -P /var/state set 
"$PACKAGE.$CONFIG${OPTION:+.$OPTION}=$VALUE"
+   $UCI ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -P "$UCI_STATE_DIR" set 
"$PACKAGE.$CONFIG${OPTION:+.$OPTION}=$VALUE"
 }
 
 uci_toggle_state() {
@@ -82,11 +85,11 @@ uci_set() {
local OPTION="$3"
local VALUE="$4"
 
-   /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set 
"$PACKAGE.$CONFIG.$OPTION=$VALUE"
+   $UCI ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set 
"$PACKAGE.$CONFIG.$OPTION=$VALUE"
 }
 
 uci_get_state() {
-   uci_get "$1" "$2" "$3" "$4" "/var/state"
+   uci_get "$1" "$2" "$3" "$4" ""$UCI_STATE_DIR""
 }
 
 uci_get() {
@@ -96,7 +99,7 @@ uci_get() {
local DEFAULT="$4"
local STATE="$5"
 
-   /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} ${STATE:+-P $STATE} -q 
get "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
+   $UCI ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} ${STATE:+-P $STATE} -q get 
"$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
RET="$?"
[ "$RET" -ne 0 ] && [ -n "$DEFAULT" ] && echo "$DEFAULT"
return "$RET"
@@ -108,9 +111,9 @@ uci_add() {
local CONFIG="$3"
 
if [ -z "$CONFIG" ]; then
-   export ${NO_EXPORT:+-n} CONFIG_SECTION="$(/sbin/uci add 
"$PACKAGE" "$TYPE")"
+   export ${NO_EXPORT:+-n} CONFIG_SECTION="$($UCI add "$PACKAGE" 
"$TYPE")"
else
-   /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set 
"$

[LEDE-DEV] [PATCH 05/12] build: cleanup tmp/ dir of target rootfs

2017-03-05 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 include/rootfs.mk | 1 +
 package/Makefile  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/rootfs.mk b/include/rootfs.mk
index dc400a0..bd9af6a 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -80,6 +80,7 @@ define prepare_rootfs
@-find $(1) -name .svn  | $(XARGS) rm -rf
@-find $(1) -name .git  | $(XARGS) rm -rf
@-find $(1) -name '.#*' | $(XARGS) rm -f
+   rm -rf $(1)/tmp/*
rm -f $(1)/usr/lib/opkg/lists/*
rm -f $(1)/usr/lib/opkg/info/*.postinst*
$(call clean_ipkg,$(1))
diff --git a/package/Makefile b/package/Makefile
index ac8faec..4fdf415 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -63,7 +63,7 @@ endif
 $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if 
$(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
-   [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
+   mkdir -p $(TARGET_DIR)/tmp
$(call opkg,$(TARGET_DIR)) install \
$(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 
2>/dev/null))
@for file in $(PACKAGE_INSTALL_FILES); do \
-- 
2.6.4


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


[LEDE-DEV] [PATCH 07/12] build: ipkg: new field Alternatives

2017-03-05 Thread Yousong Zhou
It's a list of specs of the following form seprated by commas to
describe alternatives provided by this package

::

 will be a symbolic link to  of the highest 

Signed-off-by: Yousong Zhou 
---
 include/package-ipkg.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index 620be99..bf508fb 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -159,6 +159,7 @@ Version: $(VERSION)
 $$(call addfield,Depends,$$(Package/$(1)/DEPENDS)
 )$$(call addfield,Conflicts,$$(call mergelist,$(CONFLICTS))
 )$$(call addfield,Provides,$$(call mergelist,$(PROVIDES))
+)$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES))
 )$$(call addfield,Source,$(SOURCE)
 )$$(call addfield,License,$$(PKG_LICENSE)
 )$$(call addfield,LicenseFiles,$$(PKG_LICENSE_FILES)
-- 
2.6.4


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


[LEDE-DEV] [PATCH 06/12] build: opkg: enable presence of uci

2017-03-05 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 include/rootfs.mk | 18 +++---
 package/Makefile  |  1 +
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/include/rootfs.mk b/include/rootfs.mk
index bd9af6a..46ccce4 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -37,6 +37,9 @@ endif
 opkg = \
   IPKG_NO_SCRIPT=1 \
   IPKG_INSTROOT=$(1) \
+  UCI=$(STAGING_DIR_HOST)/sbin/uci \
+  UCI_CONFDIR=$(1)/etc/config \
+  UCI_SAVEDIR=$(1)/tmp/.uci \
   TMPDIR=$(1)/tmp \
   $(STAGING_DIR_HOST)/bin/opkg \
--offline-root $(1) \
@@ -61,9 +64,14 @@ define prepare_rootfs
fi
@mkdir -p $(1)/etc/rc.d
@( \
-   cd $(1); \
+   cd $(1); shell=$$(which bash); \
+   mkdir -p $(1)/tmp/.uci/;  \
for script in ./usr/lib/opkg/info/*.postinst; do \
-   IPKG_INSTROOT=$(1) $$(which bash) $$script; \
+   IPKG_INSTROOT=$(1) \
+   UCI=$(STAGING_DIR_HOST)/sbin/uci \
+   UCI_CONFDIR=$(1)/etc/config \
+   UCI_SAVEDIR=$(1)/tmp/.uci \
+   $$shell $$script; \
ret=$$?; \
if [ $$ret -ne 0 ]; then \
echo "postinst script $$script has failed with 
exit code $$ret" >&2; \
@@ -72,7 +80,11 @@ define prepare_rootfs
done; \
for script in ./etc/init.d/*; do \
grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || 
continue; \
-   IPKG_INSTROOT=$(1) $$(which bash) ./etc/rc.common 
$$script enable; \
+   IPKG_INSTROOT=$(1) \
+   UCI=$(STAGING_DIR_HOST)/sbin/uci \
+   UCI_CONFDIR=$(1)/etc/config \
+   UCI_SAVEDIR=$(1)/tmp/.uci \
+   $$shell ./etc/rc.common $$script enable; \
done || true \
)
$(if $(SOURCE_DATE_EPOCH),sed -i "s/Installed-Time: .*/Installed-Time: 
$(SOURCE_DATE_EPOCH)/" $(1)/usr/lib/opkg/status)
diff --git a/package/Makefile b/package/Makefile
index 4fdf415..79aa58d 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -58,6 +58,7 @@ $(curdir)/merge-index: $(curdir)/merge
 
 ifndef SDK
   $(curdir)/compile: $(curdir)/system/opkg/host/compile
+  $(curdir)/compile: $(curdir)/system/uci/host/compile
 endif
 
 $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if 
$(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index)
-- 
2.6.4


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


[LEDE-DEV] [PATCH 08/12] base-files: link /var to tmp instead of /tmp

2017-03-05 Thread Yousong Zhou
To de-couple with host /tmp

Signed-off-by: Yousong Zhou 
---
 package/base-files/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 78c3dc9..99a10ff 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -153,7 +153,7 @@ define Package/base-files/install
mkdir -p $(1)/root
$(LN) /proc/mounts $(1)/etc/mtab
rm -f $(1)/var
-   $(LN) /tmp $(1)/var
+   $(LN) tmp $(1)/var
mkdir -p $(1)/etc
$(LN) /tmp/resolv.conf /tmp/TZ /tmp/localtime $(1)/etc/
 
-- 
2.6.4


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


[LEDE-DEV] [PATCH 10/12] base-files: add update-alternatives call to default_{postinst, prerm}

2017-03-05 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 package/base-files/Makefile   |  2 +-
 package/base-files/files/lib/functions.sh | 18 ++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 99a10ff..7dde9e1 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/version.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=172
+PKG_RELEASE:=173
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
diff --git a/package/base-files/files/lib/functions.sh 
b/package/base-files/files/lib/functions.sh
index de3fa96..42c4f6c 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -168,6 +168,7 @@ default_prerm() {
 
name=$(basename ${1%.*})
[ -f "$root/usr/lib/opkg/info/${name}.prerm-pkg" ] && . 
"$root/usr/lib/opkg/info/${name}.prerm-pkg"
+   check_update_alternatives remove "${name}"
 
local shell="$(which bash)"
for i in `cat "$root/usr/lib/opkg/info/${name}.list" | grep 
"^/etc/init.d/"`; do
@@ -217,12 +218,29 @@ add_group_and_user() {
fi
 }
 
+check_update_alternatives() {
+   local cmd="$1"
+   local pkgname="$2"
+   local altspecs="$(sed -ne 's/^Alternatives: *//p' 
$root/usr/lib/opkg/info/${pkgname}.control 2>/dev/null)"
+   local spec
+   local oIFS
+   local shell="$(which bash)"
+
+   shell="${shell:-/bin/sh}"
+   oIFS="$IFS"; IFS=", "
+   for spec in $altspecs; do
+   $shell ${IPKG_INSTROOT}/usr/sbin/update-alternatives "$cmd" 
--spec "$spec"
+   done
+   IFS="$oIFS"
+}
+
 default_postinst() {
local root="${IPKG_INSTROOT}"
local pkgname="$(basename ${1%.*})"
local ret=0
 
add_group_and_user "${pkgname}"
+   check_update_alternatives update "${pkgname}"
 
if [ -f "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" ]; then
( . "$root/usr/lib/opkg/info/${pkgname}.postinst-pkg" )
-- 
2.6.4


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


[LEDE-DEV] [PATCH 09/12] base-files: enable presence of uci when IPKG_INSTROOT is set

2017-03-05 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 package/base-files/files/lib/functions.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/base-files/files/lib/functions.sh 
b/package/base-files/files/lib/functions.sh
index b68db6b..de3fa96 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -35,7 +35,6 @@ list_contains() {
 }
 
 config_load() {
-   [ -n "$IPKG_INSTROOT" ] && return 0
uci_load "$@"
 }
 
@@ -353,4 +352,4 @@ user_exists() {
grep -qs "^${1}:" ${IPKG_INSTROOT}/etc/passwd
 }
 
-[ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh
+. $IPKG_INSTROOT/lib/config/uci.sh
-- 
2.6.4


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


[LEDE-DEV] [PATCH 11/12] busybox: add as an alternative of /sbin/ip

2017-03-05 Thread Yousong Zhou
Signed-off-by: Yousong Zhou 
---
 package/utils/busybox/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile
index 0937ef9..28a6e89 100644
--- a/package/utils/busybox/Makefile
+++ b/package/utils/busybox/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.26.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
@@ -44,6 +44,7 @@ define Package/busybox
   URL:=http://busybox.net/
   DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam 
+BUSYBOX_CONFIG_NTPD:jsonfilter
   MENU:=1
+  ALTERNATIVES:=100:/sbin/ip:/bin/busybox
 endef
 
 define Package/busybox/description
-- 
2.6.4


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


[LEDE-DEV] [PATCH 12/12] iproute2: add ip-tiny, ip-full as alternatives of /sbin/ip

2017-03-05 Thread Yousong Zhou
They will not be in conflict anymore ;)

Signed-off-by: Yousong Zhou 
---
 package/network/utils/iproute2/Makefile | 28 +---
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/package/network/utils/iproute2/Makefile 
b/package/network/utils/iproute2/Makefile
index af8e64c..efc6051 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iproute2
 PKG_VERSION:=4.4.0
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
@@ -22,23 +22,29 @@ 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSI
 include $(INCLUDE_DIR)/package.mk
 
 define Package/iproute2/Default
-  TITLE:=Routing control utility ($(2))
   SECTION:=net
   CATEGORY:=Network
   
URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
   SUBMENU:=Routing and Redirection
   MAINTAINER:=Russell Senior 
   DEPENDS:= +libnl-tiny
-  VARIANT:=$(1)
-  PROVIDES:=$(3)
 endef
 
 define Package/ip-tiny
-$(call Package/iproute2/Default,tiny,Minimal,ip)
-  CONFLICTS:=ip-full
+$(call Package/iproute2/Default)
+ TITLE:=Routing control utility (Minimal)
+ VARIANT:=tiny
+ PROVIDES:=ip
+ ALTERNATIVES:=200:/sbin/ip:/sbin/ip-tiny
 endef
 
-Package/ip-full:=$(call Package/iproute2/Default,full,Full,ip)
+define Package/ip-full
+$(call Package/iproute2/Default)
+ TITLE:=Routing control utility (Full)
+ VARIANT:=full
+ PROVIDES:=ip
+ ALTERNATIVES:=300:/sbin/ip:/sbin/ip-full
+endef
 
 define Package/tc
 $(call Package/iproute2/Default)
@@ -103,13 +109,13 @@ define Build/InstallDev
 endef
 
 define Package/ip-tiny/install
-   $(INSTALL_DIR) $(1)/usr/bin
-   $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/bin/
+   $(INSTALL_DIR) $(1)/sbin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/sbin/ip-tiny
 endef
 
 define Package/ip-full/install
-   $(INSTALL_DIR) $(1)/usr/sbin
-   $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
+   $(INSTALL_DIR) $(1)/sbin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/sbin/ip-full
 endef
 
 define Package/tc/install
-- 
2.6.4


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


Re: [LEDE-DEV] [PATCH 00/12] alternatives support

2017-03-05 Thread Matthias Schiffer
On 03/05/2017 10:31 AM, Yousong Zhou wrote:
> This patch set tries to make it possible that files serving the same purpose
> and installed to different locations can be available under the same name
> through a symbolic link
> 
> The idea is from alternatives of debian system [1,2].  "ip" command is a good
> example of the problem it tries to solve [3].   Files provided by different
> packages cannot be installed to the same location, so we have busybox ip,
> ip-tiny, ip-full all installed to different locations
> 
> It works by first adding to CONTROL file of each ipkg a new field 
> "Alternatives",
> which is a list of specs of the following form seprated by commas to describe
> alternatives provided by this package
> 
> ::
> 
> The new field will be interpreted by postinst and prerm script.   will 
> be
> a symbolic link to  of the highest , and updates will be made 
> to
> UCI config "opkg"
> 
> Several patches for uci are also included here to support usage at build-time.
> The whole series is available in my staging tree [4]
> 
>  [1] https://wiki.debian.org/DebianAlternatives
>  [2] 
> https://debian-administration.org/article/91/Using_the_Debian_alternatives_system
>  [3] https://bugs.lede-project.org/index.php?do=details&task_id=428
>  [4] https://git.lede-project.org/?p=lede/yousong/staging.git;a=summary

First of all, thank you very much for working on this, I've been missing
this feature for a long time. I have some comments though:

I see that the opkg UCI config contains a lot of redundant data when many
alternatives are installed (for example, many busybox applets and their
corresponding coreutils/util-linux/... variants); AFAICT, the same
information is also available in the opkg status files.

I think I'd opt for not making this list of alternatives configurable
independently of opkg. Adding configuration to UCI would only be necessary
when a user overrides the automatic selection. This could also avoid adding
host UCI support to the build system, making the whole patchset a lot smaller.

Matthias



> 
> Content of UCI config file "opkg" when busybox and ip-tiny are installed
> 
>   root@LEDE:/# uci export opkg
>   package opkg
> 
>   config alternatives
>   option path '/sbin/ip'
>   list altpath '100:/bin/busybox'
>   list altpath '200:/sbin/ip-tiny'
> 
> Install ip-full
> 
>   root@LEDE:/# opkg install /tmp/ip-full_4.4.0-9_mips_24kc.ipk
>   Installing ip-full (4.4.0-9) to root...
>   Configuring ip-full.
>   /usr/sbin/update-alternatives: link /sbin/ip -> /sbin/ip-full
>   root@LEDE:/# uci export opkg
>   package opkg
> 
>   config alternatives
>   option path '/sbin/ip'
>   list altpath '100:/bin/busybox'
>   list altpath '200:/sbin/ip-tiny'
>   list altpath '300:/sbin/ip-full'
> 
> Remove ip-full
> 
>   root@LEDE:/# opkg remove ip-full
>   Removing package ip-full from root...
>   /usr/sbin/update-alternatives: link /sbin/ip -> /sbin/ip-tiny
>   root@LEDE:/# uci export opkg
>   package opkg
> 
>   config alternatives
>   option path '/sbin/ip'
>   list altpath '100:/bin/busybox'
>   list altpath '200:/sbin/ip-tiny'
> 
> Remove ip-tiny
> 
>   root@LEDE:/# opkg remove ip-tiny
>   Removing package ip-tiny from root...
>   /usr/sbin/update-alternatives: link /sbin/ip -> /bin/busybox
>   root@LEDE:/# uci export opkg
>   package opkg
> 
>   config alternatives
>   option path '/sbin/ip'
>   list altpath '100:/bin/busybox'
> 
> The "opkg" file and update-alternatives are not intended for interactive use,
> but let's a demo can be useful for understanding
> 
>   root@LEDE:/# update-alternatives remove --spec 100:/sbin/ip:/bin/busybox
>   /usr/sbin/update-alternatives: remove empty alternatives section for 
> /sbin/ip
>   root@LEDE:/# uci export opkg
>   package opkg
> 
>   root@LEDE:/# ip
>   /bin/ash: ip: not found
>   root@LEDE:/# update-alternatives update --spec 100:/sbin/ip:/bin/busybox
>   /usr/sbin/update-alternatives: link /sbin/ip -> /bin/busybox
>   root@LEDE:/# uci export opkg
>   package opkg
> 
>   config alternatives
>   option path '/sbin/ip'
>   list altpath '100:/bin/busybox'
> 
>   root@LEDE:/#
> 
> Yousong Zhou (12):
>   opkg: add update-alternatives support
>   uci: patch for static host build
>   uci: add host build
>   build: prepare_rootfs: preserve prerm script
>   build: cleanup tmp/ dir of target rootfs
>   build: opkg: enable presence of uci
>   build: ipkg: new field Alternatives
>   base-files: link /var to tmp instead of /tmp
>   base-files: enable presence of uci when IPKG_INSTROOT is set
>   base-files: add update-alternatives call to default_{post

Re: [LEDE-DEV] [PATCH] Lantiq Amazon-SE SoC / ADSL Modem Allnet All0333CJ Rev.C

2017-03-05 Thread Tino Reichardt
* Bastian Bittorf  wrote:
> * Tino Reichardt  [24.02.2017 16:26]:
> > Telnet on Port 23 is also there. I will check, if it can be upgraded via
> > telnet or webinterface.
> 
> user: root
> pass: admin

I found a way of flashing the device with telnet / tftp only. So there
is no more requirentment for the serial port.

I will add the instractions to my patch... and append them below.

> # cat /proc/mtd
> dev:size   erasesize  name
> mtd0: 0001 2000 "U-Boot"
> mtd1: 003f 0001 "RootFS,Kernel,Data,Environment"
> 
> there is an interesting binary:
> 
> # upgrade --help
> Usage : upgrade file_name image_type expand_direction saveenv_copy

This binary is not really usefull. It depends on some unknown format.

I am using tftp + flashwrite + fw_setenv. I have done some extra github
repo for the tools. I needed to compile them statically and other users
will have issues compiling there own binaries for that - I think.

Repo is here: https://github.com/mcmilk/uboot-utils

This is a summary of flashing via tftp:

# your own host must have an tftpd daemon, then do this:
ifconfig eth0:172 172.16.1.1 up

# telnet to allnet, root:admin
telnet 172.16.1.254

The following commands should be run on the Allnet Modem:

# kill this daemon, it spams your telnet console
killall dsl_cpe_control

# change to some place in ram:
cd /ramdisk/tftp_upload

# uImage should be your lede-lantiq-ase-ALL0333CJ-squashfs-sysupgrade.bin
tftp -g -r uImage 172.16.1.1

# https://github.com/mcmilk/uboot-utils/releases/download/0.1/mips32.tar.gz
# load these tools from your tftpd via:
tftp -g -r flashwrite 172.16.1.1
tftp -g -r fw_setenv 172.16.1.1
tftp -g -r fw.conf 172.16.1.1
ln -s fw_setenv fw_printenv
chmod +x *

# changing this variable is important, or LEDE will not boot:
./fw_setenv disable_recovery y

# this is also needed:
./fw_setenv kernel_addr 0xb001

# this will flash LEDE into the right address from fw.conf
./flashwrite /dev/mtd/1 uImage 0


BE AWARE:
My patch seems to work fine, even the dsl modem seems to be correctly
loaded. But it's not tested currently... so please do not flash your
modems, when they are needed currently ;)

-- 
Best regards, TR

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


[LEDE-DEV] Need fix / advice / idea

2017-03-05 Thread Denis Periša
Hi all,

I have situation where one of my devices (rb435g) has lot of bad
sectors on (NAND) kernel partition.

First of all, are those partitions physical? Can they be somehow
re-partitioned by kernel cmd line or? I'm left with only under 1mb of
usable space so I need to make kernel that fits that available space.

Currently `make kernel_menuconfig` does not work, any news on that?
Any ideas on how could I salvage this device to be usable?

Network boot is a option, but that's last resort.

Thank you!

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


[LEDE-DEV] bug / brcm47xx / mips74l / Netgear WNDR3400 V1

2017-03-05 Thread Ondřej Pumr

Hello,

I have Netgear WNDR3400 V1 running the latest stable version of OpenWrt 
15.05.1 and everything is ok.


Once I install the latest stable version of LEDE 17.01.0, the item 
"Wifi" in "Network" menu is gone and I am unable to configure wireless 
interfaces via web interface.


I have found the same issue under ID 455 by Netgear WNDR3400 V2 with 
status "unconfirmed".


And that is the reason, why I write this email - to confirm, that the 
same issue is affecting the older hardware revision too and it is 
probably affecting more brcm47xx / mips74l devices.


Best regards

Ondrej Pumr


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


Re: [LEDE-DEV] bug / brcm47xx / mips74l / Netgear WNDR3400 V1

2017-03-05 Thread Rafał Miłecki
On 5 March 2017 at 17:54, Ondřej Pumr  wrote:
> I have Netgear WNDR3400 V1 running the latest stable version of OpenWrt
> 15.05.1 and everything is ok.
>
> Once I install the latest stable version of LEDE 17.01.0, the item "Wifi" in
> "Network" menu is gone and I am unable to configure wireless interfaces via
> web interface.
>
> I have found the same issue under ID 455 by Netgear WNDR3400 V2 with status
> "unconfirmed".
>
> And that is the reason, why I write this email - to confirm, that the same
> issue is affecting the older hardware revision too and it is probably
> affecting more brcm47xx / mips74l devices.

Provide boot log form 15.05.1 and 17.01.0.

-- 
Rafał

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


[LEDE-DEV] [PATCH v3 1/2] ar71xx: Add support for TP-Link MR6400

2017-03-05 Thread Filip Moc
You can flash via u-boot tftp (serve factory image as /mr6400_tp_recovery.bin
on 192.168.0.66/24, connect to any ethernet port and power on device while
holding the reset button).

Signed-off-by: Filip Moc 
---

Notes:
v1->v2:
 - Fixed DEVICE_TITLE
 - Defined flash type as "w25q64" (but it's still being misdetected as
   "s25fl064k")

v2->v3:
 - Removed enablemodem
 - Changed license of mach-tl-mr6400.c

not yet fixed:
 - ordering in base-files/etc/diag.sh
 - ordering in base-files/lib/ar71xx.sh
 (I did not get any response to <20170211091924.ga23...@moc6.cz>)

 target/linux/ar71xx/base-files/etc/board.d/01_leds |   6 +
 .../linux/ar71xx/base-files/etc/board.d/02_network |   5 +
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   6 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.4 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  10 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-tl-mr6400.c  | 151 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/tp-link.mk   |  11 ++
 11 files changed, 196 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr6400.c

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 4dc4bfd..4d6c5c9 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -576,6 +576,12 @@ tl-wr941nd-v5)
;;
esac
;;
+tl-mr6400)
+   ucidef_set_led_netdev "lan" "LAN" "tp-link:white:lan" "eth0"
+   ucidef_set_led_netdev "wan" "WAN" "tp-link:white:wan" "eth1"
+   ucidef_set_led_netdev "4g" "4G" "tp-link:white:4g" "usb0"
+   ucidef_set_led_wlan "wlan" "WLAN" "tp-link:white:wlan" "phy0tpt"
+   ;;
 tl-wa7210n-v2)
ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0"
ucidef_set_rssimon "wlan0" "20" "1"
diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index e08d7dd..e2489aa 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -307,6 +307,11 @@ ar71xx_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth1" "1:lan:1" "2:lan:2" "3:lan:3" "4:lan:4"
;;
+   tl-mr6400)
+   ucidef_set_interfaces_lan_wan "eth0 eth1" "usb0"
+   ucidef_add_switch "switch0" \
+   "0@eth0" "1:lan" "2:lan" "3:lan"
+   ;;
dir-825-b1|\
nbg460n_550n_550nh|\
tew-673gru|\
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 1064641..0916fa0 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -354,6 +354,9 @@ get_status_led() {
tl-wa860re)
status_led="tp-link:green:power"
;;
+   tl-mr6400)
+   status_led="tp-link:white:power"
+   ;;
tl-mr3220|\
tl-mr3220-v2|\
tl-mr3420|\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index ae0189d..4ce6918 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -298,6 +298,9 @@ tplink_board_detect() {
"342000"*)
model="TP-Link TL-MR3420"
;;
+   "64"*)
+   model="TP-Link TL-MR6400"
+   ;;
"332000"*)
model="TP-Link TL-WDR3320"
;;
@@ -1002,6 +1005,9 @@ ar71xx_board_detect() {
*"TL-MR3420 v2")
name="tl-mr3420-v2"
;;
+   *TL-MR6400)
+   name="tl-mr6400"
+   ;;
*"TL-WA701ND v2")
name="tl-wa701nd-v2"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 576ff6c..6134604 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -394,6 +394,7 @@ platform_check_image() {
tl-mr3220|\
tl-mr3420-v2|\
tl-mr3420|\
+   tl-mr6400|\
tl-wa701nd-v2|\
tl-wa7210n-v2|\
tl-wa750re|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 206ace6..6c70091 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -169,6 +169,7 @@ CONFIG_ATH79_MACH_TL_MR11U=y
 CONFIG_ATH79_MACH_TL_MR13U=y
 CONFIG_ATH79_MACH_TL_MR3

[LEDE-DEV] [PATCH v3 2/2] Move enablemodem from ramips to new package adb-enablemodem and make it used also by TL-MR6400

2017-03-05 Thread Filip Moc
Signed-off-by: Filip Moc 
---

Notes:
This moves enablemodem from ramips to new package adb-enablemodem.
New adb-enablemodem uses modem's id rather than main board's name so it 
could
possibly work even on different boards without need to change anything.

Fixes:
 - Problem when modem is not responding causing adb to wait indefinitely and
   blocking boot process.
 - Asterisk path expansion.
 - Possible race condition when there are more devices attached.

New features:
 - Logging
 - Stopping httpd

v2->v3:
 - Less insane code for closing filedescriptors

 package/network/utils/adb-enablemodem/Makefile | 26 +
 .../utils/adb-enablemodem/files/adb-enablemodem| 64 ++
 target/linux/ar71xx/image/tp-link.mk   |  2 +-
 .../linux/ramips/base-files/etc/init.d/enablemodem | 17 --
 target/linux/ramips/image/mt7620.mk|  2 +-
 5 files changed, 92 insertions(+), 19 deletions(-)
 create mode 100644 package/network/utils/adb-enablemodem/Makefile
 create mode 100644 package/network/utils/adb-enablemodem/files/adb-enablemodem
 delete mode 100755 target/linux/ramips/base-files/etc/init.d/enablemodem

diff --git a/package/network/utils/adb-enablemodem/Makefile 
b/package/network/utils/adb-enablemodem/Makefile
new file mode 100644
index 000..3ffc64a
--- /dev/null
+++ b/package/network/utils/adb-enablemodem/Makefile
@@ -0,0 +1,26 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=adb-enablemodem
+PKG_VERSION:=2017-03-05
+PKG_RELEASE:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/adb-enablemodem
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=WWAN
+  TITLE:=Enable modem via adb
+  DEPENDS:=+adb
+endef
+
+define Build/Compile
+true
+endef
+
+define Package/adb-enablemodem/install
+   $(INSTALL_DIR)  $(1)/etc/init.d
+   $(INSTALL_BIN)  ./files/adb-enablemodem $(1)/etc/init.d/adb-enablemodem
+endef
+
+$(eval $(call BuildPackage,adb-enablemodem))
diff --git a/package/network/utils/adb-enablemodem/files/adb-enablemodem 
b/package/network/utils/adb-enablemodem/files/adb-enablemodem
new file mode 100644
index 000..ddfc681
--- /dev/null
+++ b/package/network/utils/adb-enablemodem/files/adb-enablemodem
@@ -0,0 +1,64 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+
+adb_exec() {
+   adb -s "$serial" shell "( $1 ) >/dev/null 2>&1"'; printf "\nEXIT_CODE: 
%i\n" $?' | head -c 64 | grep -qx 'EXIT_CODE: 0\r\?'
+}
+
+enablemodem_do() {
+   logger -t adb-enablemodem 'INFO: waiting for device'
+   adb wait-for-device
+   serial="$(adb get-serialno)"
+
+   vendor_id="$(adb -s "$serial" shell 'uci get product.usb.vid' | head -c 
16 | tr -d '\r\n')"
+   product_id="$(adb -s "$serial" shell 'uci get product.usb.pid' | head 
-c 16 | tr -d '\r\n')"
+
+   case "$vendor_id:$product_id" in
+   "0x2357:0x000D") # TP-LINK LTE MODULE
+   case "$1" in
+   start)
+   if adb_exec '
+   chmod +x /WEBSERVER/www/cgi-bin/*
+   fds="$(ls /proc/$$/fd | grep -v "^[012]$")"
+   for fd in $fds; do
+   eval "exec $fd>&-"
+   done
+   start-stop-daemon -x httpd -S -- -h 
/WEBSERVER/www/
+   '; then
+   logger -t adb-enablemodem 'INFO: httpd on modem 
started'
+   else
+   logger -t adb-enablemodem 'ERROR: failed to 
start httpd on modem'
+   fi
+   
option_newid='/sys/bus/usb-serial/drivers/option1/new_id'
+   if [ -e "$option_newid" ]; then
+   printf '%s %s' "$vendor_id" "$product_id" > 
"$option_newid"
+   fi
+   ;;
+   stop)
+   if adb_exec 'start-stop-daemon -x httpd -K'; then
+   logger -t adb-enablemodem 'INFO: httpd on modem 
stopped'
+   else
+   logger -t adb-enablemodem 'ERROR: failed to 
stop httpd on modem'
+   fi
+   ;;
+   esac
+   ;;
+   *)
+   logger -t adb-enablemodem "ERROR: unknown device 
$vendor_id:$product_id"
+   ;;
+   esac
+}
+
+start() {
+   ( enablemodem_do start ) &
+}
+
+stop() {
+   ( enablemodem_do stop ) &
+}
+
+restart() {
+   ( enablemodem_do stop; enablemodem_do start ) &
+}
+
diff --git a/target/linux/ar71xx/image/tp-link.mk 
b/target/linux/ar71xx/image/tp-link.mk
index 2a0b06a..a8b39a0 100644
--- a/target/linux/ar71xx/image/tp-link.mk
+++ b/target/linux/ar71xx/image/tp-link.mk
@@ -455,7 +455,7 @@ TARGET_DEVICES += tl-mr3020-v1 tl-mr3040-v1 tl-mr3040-v2 
tl-mr3220-v1 tl-mr3220-
 define Device/tl-mr6400-v1

Re: [LEDE-DEV] Need fix / advice / idea

2017-03-05 Thread Alberto Bursi


On 03/05/2017 04:25 PM, Denis Periša wrote:
> Hi all,
>
> I have situation where one of my devices (rb435g) has lot of bad
> sectors on (NAND) kernel partition.
>
> First of all, are those partitions physical? Can they be somehow
> re-partitioned by kernel cmd line or? I'm left with only under 1mb of
> usable space so I need to make kernel that fits that available space.
>
> Currently `make kernel_menuconfig` does not work, any news on that?
> Any ideas on how could I salvage this device to be usable?
>
> Network boot is a option, but that's last resort.
>
> Thank you!
>

You can try repartitioning through bootloader if you have serial 
console, see here
https://wiki.mikrotik.com/wiki/Manual:RouterBOOT

Then you may need to patch this file's partition list too and compile 
your own firmware, so LEDE actually uses the new partitions you have set 
up in the bootloader.
https://github.com/lede-project/source/blob/master/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c#L148

The kernel is compiled by default to add this
https://github.com/lede-project/source/blob/master/target/linux/ar71xx/config-4.4#L245
 

to the kernel command line added from bootloader.

I don't know that device so I can't tell you more specific info.

Note that in most devices there are hardware setup or bootloader 
partitions that should not be touched.

-Alberto

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


Re: [LEDE-DEV] bug / brcm47xx / mips74l / Netgear WNDR3400 V1

2017-03-05 Thread p . wassi
> > Once I install the latest stable version of LEDE 17.01.0, the item "Wifi" in
> > "Network" menu is gone and I am unable to configure wireless interfaces via
> > web interface.
> >
> > (...)
> 
> Provide boot log form 15.05.1 and 17.01.0.

What I experienced on my WRT54GL from the brcm47xx/legacy target:
The _upgrade_ file 'standard-squashfs' [1] seems to be missing the b43 driver,
therefore no wifi when using this file. Here's the list of packages which come
preinstalled with that trx file in [1]:
> root@LEDE:/# opkg list
> base-files - 172-r3205-59508e3
> busybox - 1.25.1-2
> dnsmasq - 2.76-6
> dropbear - 2016.74-2
> firewall - 2017-01-13-37cb4cb4-1
> fstools - 2016-12-04-84b530a7-1
> fwtool - 1
> hostapd-common - 2016-12-19-ad02e79d-2
> ip6tables - 1.4.21-2
> iptables - 1.4.21-2
> iwinfo - 2016-09-21-fd9e17be-1
> jshn - 2016-11-29-77a62937-1
> jsonfilter - 2016-07-02-dea067ad-1
> kernel - 4.4.50-1-a68501a4024395ba775027c091cf6f7a
> kmod-gpio-button-hotplug - 4.4.50-2
> kmod-ip6tables - 4.4.50-1
> kmod-ipt-conntrack - 4.4.50-1
> kmod-ipt-core - 4.4.50-1
> kmod-ipt-nat - 4.4.50-1
> kmod-leds-gpio - 4.4.50-1
> kmod-ledtrig-default-on - 4.4.50-1
> kmod-ledtrig-netdev - 4.4.50-1
> kmod-ledtrig-timer - 4.4.50-1
> kmod-lib-crc-ccitt - 4.4.50-1
> kmod-nf-conntrack - 4.4.50-1
> kmod-nf-conntrack6 - 4.4.50-1
> kmod-nf-ipt - 4.4.50-1
> kmod-nf-ipt6 - 4.4.50-1
> kmod-nf-nat - 4.4.50-1
> kmod-ppp - 4.4.50-1
> kmod-pppoe - 4.4.50-1
> kmod-pppox - 4.4.50-1
> kmod-slhc - 4.4.50-1
> lede-keyring - 2017-01-20-a50b7529-1
> libblobmsg-json - 2016-11-29-77a62937-1
> libc - 1.1.16-1
> libgcc - 5.4.0-1
> libip4tc - 1.4.21-2
> libip6tc - 1.4.21-2
> libiwinfo - 2016-09-21-fd9e17be-1
> libiwinfo-lua - 2016-09-21-fd9e17be-1
> libjson-c - 0.12.1-1
> libjson-script - 2016-11-29-77a62937-1
> liblua - 5.1.5-1
> libnl-tiny - 0.1-5
> libpthread - 1.1.16-1
> libubox - 2016-11-29-77a62937-1
> libubus - 2017-01-22-6f4e11e1-1
> libubus-lua - 2017-01-22-6f4e11e1-1
> libuci - 2016-07-04-e1bf4356-1
> libuci-lua - 2016-07-04-e1bf4356-1
> libuclient - 2016-12-09-52d955fd-1
> libxtables - 1.4.21-2
> logd - 2017-01-15-5649c028-1
> lua - 5.1.5-1
> luci - git-17.051.53299-a100738-1
> luci-app-firewall - git-17.051.53299-a100738-1
> luci-base - git-17.051.53299-a100738-1
> luci-lib-ip - git-17.051.53299-a100738-1
> luci-lib-jsonc - git-17.051.53299-a100738-1
> luci-lib-nixio - git-17.051.53299-a100738-1
> luci-mod-admin-full - git-17.051.53299-a100738-1
> luci-proto-ipv6 - git-17.051.53299-a100738-1
> luci-proto-ppp - git-17.051.53299-a100738-1
> luci-theme-bootstrap - git-17.051.53299-a100738-1
> mtd - 21
> netifd - 2017-01-25-650758b1-1
> nvram - 10
> odhcp6c - 2017-01-30-c13b6a05-1
> odhcpd - 2017-02-09-8df4253b-1
> opkg - 2011-04-08-9c97d5ec-17
> otrx - 1
> ppp - 2.4.7-10
> ppp-mod-pppoe - 2.4.7-10
> procd - 2017-02-08-cdc3dab3-1
> rpcd - 2016-12-03-0577cfc1-1
> swconfig - 11
> ubox - 2017-01-15-5649c028-1
> ubus - 2017-01-22-6f4e11e1-1
> ubusd - 2017-01-22-6f4e11e1-1
> uci - 2016-07-04-e1bf4356-1
> uclient-fetch - 2016-12-09-52d955fd-1
> uhttpd - 2016-10-25-1628fa4b-1
> uhttpd-mod-ubus - 2016-10-25-1628fa4b-1
> usign - 2015-07-04-ef641914-1
> wpad-mini - 2016-12-19-ad02e79d-2

Further, when using the 'factory' image in [2] (for the WRT54GL), it seems
that the image is too big right now for tftp flashing. The CFE first accepts
the image via TFTP, starts flashing and after a while stops with an 'Unknown 
error'.

Best regards,
P. Wassi


[1]:
https://downloads.lede-project.org/releases/17.01.0/targets/brcm47xx/legacy/lede-17.01.0-r3205-59508e3-brcm47xx-legacy-standard-squashfs.trx

[2]:
https://downloads.lede-project.org/releases/17.01.0/targets/brcm47xx/legacy/lede-17.01.0-r3205-59508e3-brcm47xx-legacy-linksys-wrt54g-squashfs.bin



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


[LEDE-DEV] [PATCH] ugps: fix and improve init script

2017-03-05 Thread Piotr Dymacz
The ugps tool expects device path in last argument. If it's provided
before other options, they won't be processed at all.

Additionally, make it possible to use absolute path for gps character
device in related uci configuration.

Signed-off-by: Piotr Dymacz 
---
 package/utils/ugps/Makefile| 2 +-
 package/utils/ugps/files/ugps.init | 8 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile
index 8744300..1dad863 100644
--- a/package/utils/ugps/Makefile
+++ b/package/utils/ugps/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ugps
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL=$(LEDE_GIT)/project/ugps.git
 PKG_SOURCE_PROTO:=git
diff --git a/package/utils/ugps/files/ugps.init 
b/package/utils/ugps/files/ugps.init
index a7a88c2..157043c 100644
--- a/package/utils/ugps/files/ugps.init
+++ b/package/utils/ugps/files/ugps.init
@@ -14,11 +14,15 @@ start_service() {
local tty="$(uci get gps.@gps[-1].tty)"
local atime="$(uci get gps.@gps[-1].adjust_time)"
 
-   [ -d "/sys/class/tty/$tty/" ] || return
+   [ -c "$tty" ] || {
+   tty="/dev/$tty"
+   [ -c "$tty" ] || return
+   }
 
procd_open_instance
-   procd_set_param command "$PROG" "/dev/$tty"
+   procd_set_param command "$PROG"
[ "$atime" -eq 0 ] || procd_append_param command "-a"
+   procd_append_param command "$tty"
procd_set_param respawn
procd_close_instance
 }
-- 
2.7.4


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


[LEDE-DEV] [PATCH 2/2] brcm2708: detect Raspberry Pi Zero W

2017-03-05 Thread Stijn Tintel
Signed-off-by: Stijn Tintel 
---
 target/linux/brcm2708/base-files/etc/board.d/02_network | 3 +++
 target/linux/brcm2708/base-files/etc/diag.sh| 3 ++-
 target/linux/brcm2708/base-files/lib/brcm2708.sh| 3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/target/linux/brcm2708/base-files/etc/board.d/02_network 
b/target/linux/brcm2708/base-files/etc/board.d/02_network
index e554b73..1093c9d 100755
--- a/target/linux/brcm2708/base-files/etc/board.d/02_network
+++ b/target/linux/brcm2708/base-files/etc/board.d/02_network
@@ -17,6 +17,9 @@ rpi-b |\
 rpi-b-plus)
ucidef_set_interface_lan "eth0"
;;
+rpi-zero-w)
+   ucidef_set_interface_lan "wlan0"
+   ;;
 esac
 
 board_config_flush
diff --git a/target/linux/brcm2708/base-files/etc/diag.sh 
b/target/linux/brcm2708/base-files/etc/diag.sh
index 0f34a53..9ebdd16 100644
--- a/target/linux/brcm2708/base-files/etc/diag.sh
+++ b/target/linux/brcm2708/base-files/etc/diag.sh
@@ -12,7 +12,8 @@ set_state() {
;;
rpi-b |\
rpi-cm |\
-   rpi-zero)
+   rpi-zero |\
+   rpi-zero-w)
status_led="led0"
;;
esac
diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh 
b/target/linux/brcm2708/base-files/lib/brcm2708.sh
index 3e7c30f..54d30f8 100644
--- a/target/linux/brcm2708/base-files/lib/brcm2708.sh
+++ b/target/linux/brcm2708/base-files/lib/brcm2708.sh
@@ -27,6 +27,9 @@ brcm2708_detect() {
"Raspberry Pi Zero Rev"*)
board_name="rpi-zero"
;;
+   "Raspberry Pi Zero W Rev"*)
+   board_name="rpi-zero-w"
+   ;;
*)
board_name="unknown"
;;
-- 
2.10.2


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


[LEDE-DEV] [PATCH 1/2] brcm2708: order boards and models alphabetically

2017-03-05 Thread Stijn Tintel
Signed-off-by: Stijn Tintel 
---
 .../linux/brcm2708/base-files/etc/board.d/02_network |  6 +++---
 target/linux/brcm2708/base-files/etc/diag.sh |  8 
 target/linux/brcm2708/base-files/lib/brcm2708.sh | 20 ++--
 .../lib/preinit/05_set_preinit_iface_brcm2708|  6 +++---
 4 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/target/linux/brcm2708/base-files/etc/board.d/02_network 
b/target/linux/brcm2708/base-files/etc/board.d/02_network
index 7642c06..e554b73 100755
--- a/target/linux/brcm2708/base-files/etc/board.d/02_network
+++ b/target/linux/brcm2708/base-files/etc/board.d/02_network
@@ -11,10 +11,10 @@ board_config_update
 board=$(brcm2708_board_name)
 
 case "$board" in
-rpi-b |\
-rpi-b-plus |\
 rpi-2-b |\
-rpi-3-b)
+rpi-3-b |\
+rpi-b |\
+rpi-b-plus)
ucidef_set_interface_lan "eth0"
;;
 esac
diff --git a/target/linux/brcm2708/base-files/etc/diag.sh 
b/target/linux/brcm2708/base-files/etc/diag.sh
index ecc6242..0f34a53 100644
--- a/target/linux/brcm2708/base-files/etc/diag.sh
+++ b/target/linux/brcm2708/base-files/etc/diag.sh
@@ -6,15 +6,15 @@
 
 set_state() {
case "$(brcm2708_board_name)" in
+   rpi-2-b |\
+   rpi-b-plus)
+   status_led="led1"
+   ;;
rpi-b |\
rpi-cm |\
rpi-zero)
status_led="led0"
;;
-   rpi-b-plus |\
-   rpi-2-b)
-   status_led="led1"
-   ;;
esac
 
case "$1" in
diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh 
b/target/linux/brcm2708/base-files/lib/brcm2708.sh
index ab7a23d..3e7c30f 100644
--- a/target/linux/brcm2708/base-files/lib/brcm2708.sh
+++ b/target/linux/brcm2708/base-files/lib/brcm2708.sh
@@ -8,25 +8,25 @@ brcm2708_detect() {
 
model=$(cat /proc/device-tree/model)
case "$model" in
-   "Raspberry Pi Model B Rev"*)
-   board_name="rpi-b"
+   "Raspberry Pi 2 Model B Rev"*)
+   board_name="rpi-2-b"
+   ;;
+   "Raspberry Pi 3 Model B Rev"*)
+   board_name="rpi-3-b"
+   ;;
+   "Raspberry Pi Compute Module Rev"*)
+   board_name="rpi-cm"
;;
"Raspberry Pi Model B Plus Rev"* |\
"Raspberry Pi Model B+ Rev"*)
board_name="rpi-b-plus"
;;
-   "Raspberry Pi Compute Module Rev"*)
-   board_name="rpi-cm"
+   "Raspberry Pi Model B Rev"*)
+   board_name="rpi-b"
;;
"Raspberry Pi Zero Rev"*)
board_name="rpi-zero"
;;
-   "Raspberry Pi 2 Model B Rev"*)
-   board_name="rpi-2-b"
-   ;;
-   "Raspberry Pi 3 Model B Rev"*)
-   board_name="rpi-3-b"
-   ;;
*)
board_name="unknown"
;;
diff --git 
a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 
b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
index 578172e..c5756be 100644
--- a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
+++ b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708
@@ -5,10 +5,10 @@
 
 set_preinit_iface() {
case "$(brcm2708_board_name)" in
-   rpi-b |\
-   rpi-b-plus |\
rpi-2-b |\
-   rpi-3-b)
+   rpi-3-b |\
+   rpi-b |\
+   rpi-b-plus)
ifname=eth0
;;
esac
-- 
2.10.2


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


Re: [LEDE-DEV] [PATCH netifd v3] system-linux: add VXLAN support

2017-03-05 Thread Hans Dedecker
On Tuesday, 28 February 2017 10:57:05 CET Matthias Schiffer wrote:
> VXLAN shares many attributes with the tunnel devices, so it is implemented
> as a new tunnel type. The 'remote' attribute can be used for an unicast
> peer or a multicast group.
> 
> The IANA-assigned port 4789 is used by default, instead of the non-standard
> port Linux defaults to.
> 
> Signed-off-by: Matthias Schiffer 
Acked-by: Hans Dedecker 
> ---
> 
> v2: Updated to use a nested JSON object for the VXLAN-specific attributes -
> although one could argue that MAC address, port and "ID" aren't very
> specific after all, at least I can see us using the same attributes if we
> ever add L2TPv3 support to netifd...
> v3: changed an incorrect __TUNNEL_ATTR_MAX to __VXLAN_DATA_ATTR_MAX
> 
>  system-linux.c | 160
> - system.c   | 
> 12 +
>  system.h   |  10 
>  3 files changed, 181 insertions(+), 1 deletion(-)
> 
> diff --git a/system-linux.c b/system-linux.c
> index f4d6c25..047 100644
> --- a/system-linux.c
> +++ b/system-linux.c
> @@ -4,6 +4,7 @@
>   * Copyright (C) 2013 Jo-Philipp Wich 
>   * Copyright (C) 2013 Steven Barth 
>   * Copyright (C) 2014 Gioacchino Mazzurco 
> + * Copyright (C) 2017 Matthias Schiffer 
>   *
>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License version 2
> @@ -25,6 +26,7 @@
>  #include 
> 
>  #include 
> +#include 
>  #include 
> 
>  #include 
> @@ -2540,6 +2542,155 @@ failure:
>  }
>  #endif
> 
> +#ifdef IFLA_VXLAN_MAX
> +static int system_add_vxlan(const char *name, const unsigned int link,
> struct blob_attr **tb, bool v6) +{
> + struct blob_attr *tb_data[__VXLAN_DATA_ATTR_MAX];
> + struct nl_msg *msg;
> + struct nlattr *linkinfo, *data;
> + struct ifinfomsg iim = { .ifi_family = AF_UNSPEC, };
> + struct blob_attr *cur;
> + int ret = 0;
> +
> + if ((cur = tb[TUNNEL_ATTR_DATA]))
> + blobmsg_parse(vxlan_data_attr_list.params, 
> __VXLAN_DATA_ATTR_MAX,
> tb_data, +blobmsg_data(cur), blobmsg_len(cur));
> + else
> + return -EINVAL;
> +
> + msg = nlmsg_alloc_simple(RTM_NEWLINK, NLM_F_REQUEST | NLM_F_CREATE |
> NLM_F_EXCL); +
> + if (!msg)
> + return -1;
> +
> + nlmsg_append(msg, &iim, sizeof(iim), 0);
> +
> + nla_put_string(msg, IFLA_IFNAME, name);
> +
> + if ((cur = tb_data[VXLAN_DATA_ATTR_MACADDR])) {
> + struct ether_addr *ea = ether_aton(blobmsg_get_string(cur));
> + if (!ea) {
> + ret = -EINVAL;
> + goto failure;
> + }
> +
> + nla_put(msg, IFLA_ADDRESS, ETH_ALEN, ea);
> + }
> +
> + if ((cur = tb[TUNNEL_ATTR_MTU])) {
> + uint32_t mtu = blobmsg_get_u32(cur);
> + nla_put_u32(msg, IFLA_MTU, mtu);
> + }
> +
> + if (!(linkinfo = nla_nest_start(msg, IFLA_LINKINFO))) {
> + ret = -ENOMEM;
> + goto failure;
> + }
> +
> + nla_put_string(msg, IFLA_INFO_KIND, "vxlan");
> +
> + if (!(data = nla_nest_start(msg, IFLA_INFO_DATA))) {
> + ret = -ENOMEM;
> + goto failure;
> + }
> +
> + if (link)
> + nla_put_u32(msg, IFLA_VXLAN_LINK, link);
> +
> + if ((cur = tb_data[VXLAN_DATA_ATTR_ID])) {
> + uint32_t id = blobmsg_get_u32(cur);
> + if (id >= (1u << 24) - 1) {
> + ret = -EINVAL;
> + goto failure;
> + }
> +
> + nla_put_u32(msg, IFLA_VXLAN_ID, id);
> + }
> +
> + if (v6) {
> + struct in6_addr in6buf;
> + if ((cur = tb[TUNNEL_ATTR_LOCAL])) {
> + if (inet_pton(AF_INET6, blobmsg_data(cur), &in6buf) < 
> 1) {
> + ret = -EINVAL;
> + goto failure;
> + }
> + nla_put(msg, IFLA_VXLAN_LOCAL6, sizeof(in6buf), 
> &in6buf);
> + }
> +
> + if ((cur = tb[TUNNEL_ATTR_REMOTE])) {
> + if (inet_pton(AF_INET6, blobmsg_data(cur), &in6buf) < 
> 1) {
> + ret = -EINVAL;
> + goto failure;
> + }
> + nla_put(msg, IFLA_VXLAN_GROUP6, sizeof(in6buf), 
> &in6buf);
> + }
> + } else {
> + struct in_addr inbuf;
> +
> + if ((cur = tb[TUNNEL_ATTR_LOCAL])) {
> + if (inet_pton(AF_INET, blobmsg_data(cur), &inbuf) < 1) {
> + ret = -EINVAL;
> + goto failure;
> + }
> + nla_put(msg, IFLA_VXLAN_LOCAL, sizeof(inbuf), &inbuf);
> + }
> +
> + if ((cur = tb[TUNNEL_ATTR_REMOTE])) {
> + if (inet_pton(AF_INET, blobmsg_data(cur), &inbuf) < 1) {
> + 

[LEDE-DEV] [PATCH mountd 3/5] mountd: Factor code getting block devices attributes

2017-03-05 Thread Florian Fainelli
Factor the code obtaining a bunch of a block devices attributes: vendor, rev,
model, size since this is a repetitive and identical procedure for each of 
these.

This also fixes unused fgets() return values for these parts of the code.

Signed-off-by: Florian Fainelli 
---
 mount.c | 89 -
 1 file changed, 33 insertions(+), 56 deletions(-)

diff --git a/mount.c b/mount.c
index a7f1862f2747..fa01eeba7402 100644
--- a/mount.c
+++ b/mount.c
@@ -432,6 +432,33 @@ static char* mount_get_serial(char *dev)
return disc_id;
 }
 
+static void mount_dev_get_property(char *name, char *prop_val,
+  const char *prop_name)
+{
+   char tmp[64];
+   FILE *fp;
+
+   snprintf(tmp, 64, "/sys/class/block/%s/device/%s", name, prop_name);
+   fp = fopen(tmp, "r");
+   if(!fp)
+   {
+   snprintf(tmp, 64, "/sys/block/%s/device/%s", name, prop_name);
+   fp = fopen(tmp, "r");
+   }
+   if(!fp)
+   goto unknown;
+   else {
+   if (!fgets(prop_val, 64, fp))
+   goto unknown;
+
+   prop_val[strlen(prop_val) - 1] = '\0';
+   fclose(fp);
+   return;
+   }
+unknown:
+   snprintf(prop_val, 64, "unknown");
+}
+
 static void mount_dev_add(char *dev)
 {
struct mount *mount = mount_find(0, dev);
@@ -489,62 +516,12 @@ static void mount_dev_add(char *dev)
}
strcpy(name, dev);
name[3] = '\0';
-   snprintf(tmp, 64, "/sys/class/block/%s/device/model", name);
-   fp = fopen(tmp, "r");
-   if(!fp)
-   {
-   snprintf(tmp, 64, "/sys/block/%s/device/model", name);
-   fp = fopen(tmp, "r");
-   }
-   if(!fp)
-   snprintf(model, 64, "unknown");
-   else {
-   fgets(model, 64, fp);
-   model[strlen(model) - 1] = '\0';;
-   fclose(fp);
-   }
-   snprintf(tmp, 64, "/sys/class/block/%s/device/vendor", name);
-   fp = fopen(tmp, "r");
-   if(!fp)
-   {
-   snprintf(tmp, 64, "/sys/block/%s/device/vendor", name);
-   fp = fopen(tmp, "r");
-   }
-   if(!fp)
-   snprintf(vendor, 64, "unknown");
-   else {
-   fgets(vendor, 64, fp);
-   vendor[strlen(vendor) - 1] = '\0';
-   fclose(fp);
-   }
-   snprintf(tmp, 64, "/sys/class/block/%s/device/rev", name);
-   fp = fopen(tmp, "r");
-   if(!fp)
-   {
-   snprintf(tmp, 64, "/sys/block/%s/device/rev", name);
-   fp = fopen(tmp, "r");
-   }
-   if(!fp)
-   snprintf(rev, 64, "unknown");
-   else {
-   fgets(rev, 64, fp);
-   rev[strlen(rev) - 1] = '\0';
-   fclose(fp);
-   }
-   snprintf(tmp, 64, "/sys/class/block/%s/size", dev);
-   fp = fopen(tmp, "r");
-   if(!fp)
-   {
-   snprintf(tmp, 64, "/sys/block/%s/%s/size", name, dev);
-   fp = fopen(tmp, "r");
-   }
-   if(!fp)
-   snprintf(size, 64, "unknown");
-   else {
-   fgets(size, 64, fp);
-   size[strlen(size) - 1] = '\0';
-   fclose(fp);
-   }
+
+   mount_dev_get_property(name, model, "model");
+   mount_dev_get_property(name, vendor, "vendor");
+   mount_dev_get_property(name, rev, "rev");
+   mount_dev_get_property(name, size, "size");
+
strcpy(tmp2, dev);
tmp2[3] = '\0';
snprintf(tmp, 64, "/sys/block/%s/queue/hw_sector_size", tmp2);
-- 
2.9.3


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


[LEDE-DEV] [PATCH mountd 5/5] mountd: Fix unused result in mount.c for fgets()

2017-03-05 Thread Florian Fainelli
Fixes the following warning:

mountd-2016-12-19-dd5799c9/mount.c: In function 'mount_dev_get_property':
mountd-2016-12-19-dd5799c9/mount.c:454:3: error: 'model' undeclared (first use 
in this function)
   model[strlen(prop_val) - 1] = '\0';
   ^

Signed-off-by: Florian Fainelli 
---
 mount.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mount.c b/mount.c
index fd5d073ca3eb..9607acdd8c5a 100644
--- a/mount.c
+++ b/mount.c
@@ -532,8 +532,10 @@ static void mount_dev_add(char *dev)
if(!fp)
snprintf(sector_size, 64, "unknown");
else {
-   fgets(sector_size, 64, fp);
-   sector_size[strlen(sector_size) - 1] = '\0';
+   if (!fgets(sector_size, 64, fp))
+   snprintf(sector_size, 64, "unknown");
+   else
+   sector_size[strlen(sector_size) - 1] = '\0';
fclose(fp);
}
snprintf(tmp, 64, "/dev/%s", dev);
-- 
2.9.3


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


[LEDE-DEV] [PATCH mountd 0/5] mounted: warnings fixes and refactoring

2017-03-05 Thread Florian Fainelli
Hi all,

This patch series fixed "unused results" warnings, and in the process
refactors how properties from block devices are obtained from sysfs.

Thanks

Florian Fainelli (5):
  mountd: Fix unused results warnings in autofs.c for chdir()
  mountd: Fix unused result in main.c for daemon()
  mountd: Factor code getting block devices attributes
  mountd: Fix unused result in mount.c for symlink()
  mountd: Fix unused result in mount.c for fgets()

 autofs.c |  22 +-
 main.c   |   9 +-
 mount.c  | 100 ++-
 3 files changed, 63 insertions(+), 68 deletions(-)

-- 
2.9.3


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


[LEDE-DEV] [PATCH mountd 2/5] mountd: Fix unused result in main.c for daemon()

2017-03-05 Thread Florian Fainelli
mountd-2016-12-19-dd5799c9/main.c: In function 'main':
mountd-2016-12-19-dd5799c9/main.c:18:9: error: ignoring return value of 
'daemon', declared with attribute warn_unused_result [-Werror=unused-result]
   daemon(0,0);

Signed-off-by: Florian Fainelli 
---
 main.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c
index 815d58e33fd9..f8f051232719 100644
--- a/main.c
+++ b/main.c
@@ -14,8 +14,15 @@ int daemonize = 0;
 
 int main(int argc, char *argv[])
 {
+   int ret = 0;
+
if ((argc < 2) || strcmp(argv[1], "-f"))
-   daemon(0,0);
+   ret = daemon(0,0);
+
+   if (ret < 0) {
+   fprintf(stderr, "Failed to daemonize\n");
+   return 1;
+   }
 
daemonize = 1;
log_start();
-- 
2.9.3


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


[LEDE-DEV] [PATCH mountd 1/5] mountd: Fix unused results warnings in autofs.c for chdir()

2017-03-05 Thread Florian Fainelli
Fixes the following warnings:

mountd-2016-12-19-dd5799c9/autofs.c: In function 'autofs_loop':
mountd-2016-12-19-dd5799c9/autofs.c:227:7: error: ignoring return value of 
'chdir', declared with attribute warn_unused_result [-Werror=unused-result]
  chdir("/");
   ^
mountd-2016-12-19-dd5799c9/autofs.c: In function 'autofs_process_request':
mountd-2016-12-19-dd5799c9/autofs.c:100:7: error: ignoring return value of 
'chdir', declared with attribute warn_unused_result [-Werror=unused-result]
  chdir("/tmp/run/mountd/");
   ^
mountd-2016-12-19-dd5799c9/autofs.c:112:7: error: ignoring return value of 
'chdir', declared with attribute warn_unused_result [-Werror=unused-result]
  chdir("/");

Signed-off-by: Florian Fainelli 
---
 autofs.c | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/autofs.c b/autofs.c
index 8c69cbea5c76..f77b929ab7ce 100644
--- a/autofs.c
+++ b/autofs.c
@@ -95,9 +95,12 @@ static void send_fail(unsigned int wait_queue_token)
 
 static int autofs_process_request(const struct autofs_v5_packet *pkt)
 {
+   int ret;
struct stat st;
log_printf("kernel is requesting a mount -> %s\n", pkt->name);
-   chdir("/tmp/run/mountd/");
+   ret = chdir("/tmp/run/mountd/");
+   if (ret < 0)
+   return ret;
if (lstat(pkt->name, &st) == -1 || (S_ISDIR(st.st_mode) && st.st_dev == 
dev)) {
if(!mount_new("/tmp/run/mountd/", (char*)pkt->name))
{
@@ -109,9 +112,7 @@ static int autofs_process_request(const struct 
autofs_v5_packet *pkt)
} else {
send_ready(pkt->wait_queue_token);
}
-   chdir("/");
-
-   return 0;
+   return chdir("/");
 }
 
 static void expire_proc(void)
@@ -224,7 +225,10 @@ static void autofs_init(void)
 
 int autofs_loop(void)
 {
-   chdir("/");
+   int ret;
+   ret = chdir("/");
+   if (ret < 0)
+   return 1;
autofs_init();
while(1)
{
@@ -234,9 +238,11 @@ int autofs_loop(void)
continue;
}
log_printf("Got a autofs packet\n");
-   if(pkt.hdr.type == autofs_ptype_missing_indirect)
-   autofs_process_request(&pkt.missing_indirect);
-   else
+   if(pkt.hdr.type == autofs_ptype_missing_indirect) {
+   ret = autofs_process_request(&pkt.missing_indirect);
+   if (ret < 0)
+   return 1;
+   } else
log_printf("unknown packet type %d\n", pkt.hdr.type);
poll(0, 0, 200);
}
-- 
2.9.3


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


[LEDE-DEV] [PATCH mountd 4/5] mountd: Fix unused result in mount.c for symlink()

2017-03-05 Thread Florian Fainelli
Fixes the following warning:

mountd-2016-12-19-dd5799c9/mount.c:454:3: note: each undeclared identifier is 
reported only once for each function it appears in
mountd-2016-12-19-dd5799c9/mount.c: In function 'mount_add_list':
mountd-2016-12-19-dd5799c9/mount.c:163:10: error: ignoring return value of 
'symlink', declared with attribute warn_unused_result [-Werror=unused-result]
   symlink(tmp2, tmp);
  ^

Signed-off-by: Florian Fainelli 
---
 mount.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/mount.c b/mount.c
index fa01eeba7402..fd5d073ca3eb 100644
--- a/mount.c
+++ b/mount.c
@@ -139,6 +139,7 @@ static void mount_add_list(char *name, char *dev, char 
*serial,
 {
struct mount *mount;
char tmp[64], tmp2[64];
+   int ret;
if(fs <= MBR || fs > LASTFS)
return;
mount  = malloc(sizeof(struct mount));
@@ -160,7 +161,9 @@ static void mount_add_list(char *name, char *dev, char 
*serial,
log_printf("new mount : %s -> %s (%s)\n", name, dev, 
fs_names[mount->fs]);
snprintf(tmp, 64, "%s%s", uci_path, name);
snprintf(tmp2, 64, "/tmp/run/mountd/%s", dev);
-   symlink(tmp2, tmp);
+   ret = symlink(tmp2, tmp);
+   if (ret < 0)
+   return;
mount_new("/tmp/run/mountd/", dev);
system_printf("ACTION=add DEVICE=%s NAME=%s /sbin/hotplug-call 
mount", dev, name);
}
-- 
2.9.3


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


Re: [LEDE-DEV] [PATCH] ugps: fix and improve init script

2017-03-05 Thread John Crispin


On 05/03/2017 21:09, Piotr Dymacz wrote:
> The ugps tool expects device path in last argument. If it's provided
> before other options, they won't be processed at all.
> 
> Additionally, make it possible to use absolute path for gps character
> device in related uci configuration.
> 
> Signed-off-by: Piotr Dymacz 

Acked-by: John Crispin 

> ---
>  package/utils/ugps/Makefile| 2 +-
>  package/utils/ugps/files/ugps.init | 8 ++--
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile
> index 8744300..1dad863 100644
> --- a/package/utils/ugps/Makefile
> +++ b/package/utils/ugps/Makefile
> @@ -8,7 +8,7 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=ugps
> -PKG_RELEASE:=2
> +PKG_RELEASE:=3
>  
>  PKG_SOURCE_URL=$(LEDE_GIT)/project/ugps.git
>  PKG_SOURCE_PROTO:=git
> diff --git a/package/utils/ugps/files/ugps.init 
> b/package/utils/ugps/files/ugps.init
> index a7a88c2..157043c 100644
> --- a/package/utils/ugps/files/ugps.init
> +++ b/package/utils/ugps/files/ugps.init
> @@ -14,11 +14,15 @@ start_service() {
>   local tty="$(uci get gps.@gps[-1].tty)"
>   local atime="$(uci get gps.@gps[-1].adjust_time)"
>  
> - [ -d "/sys/class/tty/$tty/" ] || return
> + [ -c "$tty" ] || {
> + tty="/dev/$tty"
> + [ -c "$tty" ] || return
> + }
>  
>   procd_open_instance
> - procd_set_param command "$PROG" "/dev/$tty"
> + procd_set_param command "$PROG"
>   [ "$atime" -eq 0 ] || procd_append_param command "-a"
> + procd_append_param command "$tty"
>   procd_set_param respawn
>   procd_close_instance
>  }
> 

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


Re: [LEDE-DEV] [PATCH] ar71xx: set status led for the gl-* boards

2017-03-05 Thread John Crispin


On 28/02/2017 14:18, Wojciech Jowsa wrote:
> This sets status_led for the  gl-ar300m and gl-mifi boards, and fixes led 
> names
> so that they follow correct naming scheme.
> It also fixes mangled whitespace in the mach-gl-ar300m.c.
> 
> Signed-off-by: Wojciech Jowsa 

Applying: ar71xx: set status led for the gl-* boards
fatal: corrupt patch at line 88
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 ar71xx: set status led for the gl-* boards
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
applying 733516 FAILED

the patch has line breakages at 3 places where your mail clients wrapped
the mail at 80 chars. once i fixed these manually, git complains about
other whitespace errors. please look at "git send-email" you mail client
is evidently broken

John

> ---
>  target/linux/ar71xx/base-files/etc/board.d/01_leds |  21 +-
>  target/linux/ar71xx/base-files/etc/diag.sh |   4 +-
>  .../ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c  | 222 
> ++---
>  .../ar71xx/files/arch/mips/ath79/mach-gl-mifi.c|  10 +-
>  4 files changed, 129 insertions(+), 128 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 4dc4bfd..0ed533d 100755
> --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
> +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
> @@ -312,19 +312,18 @@ dlan-pro-1200-ac)
> ucidef_set_led_gpio "plcw" "dLAN" "devolo:status:dlan" "17" "0"
> ucidef_set_led_gpio "plcr" "dLAN" "devolo:error:dlan" "16" "0"
> ;;
> -gl-ar150|\
> -gl-ar300|\
> -gl-ar300m|\
> +gl-ar300m)
> +   ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt"
> +   ;;
>  gl-mifi)
> +   ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
> +   ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
> +   ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1"
> +   ucidef_set_led_netdev "3gnet" "3GNET" "$board:green:net" "3g-wan"
> +   ;;
> +gl-ar150|\
> +gl-ar300)
> ucidef_set_led_wlan "wlan" "WLAN" "$board:wlan" "phy0tpt"
> -
> -   case "$board" in
> -   gl-mifi)
> -   ucidef_set_led_netdev "wan" "WAN" "$board:wan" "eth0"
> -   ucidef_set_led_netdev "lan" "LAN" "$board:lan" "eth1"
> -   ucidef_set_led_netdev "3gnet" "3GNET" "$board:net" "3g-wan"
> -   ;;
> -   esac
> ;;
>  gl-domino|\
>  sc300m|\
> diff --git a/target/linux/ar71xx/base-files/etc/diag.sh
> b/target/linux/ar71xx/base-files/etc/diag.sh
> index 1064641..7987e51 100644
> --- a/target/linux/ar71xx/base-files/etc/diag.sh
> +++ b/target/linux/ar71xx/base-files/etc/diag.sh
> @@ -61,7 +61,9 @@ get_status_led() {
> ap90q|\
> cpe830|\
> cpe870|\
> -   gl-inet)
> +   gl-inet|\
> +   gl-mifi|\
> +   gl-ar300m)
> status_led="$board:green:lan"
> ;;
> ap96)
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
> index 62906a1..8f4a0c5 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c
> @@ -6,9 +6,9 @@
>   *  Copyright (C) 2013 alzhao 
>   *  Copyright (C) 2014 Michel Stempin 
>   *
> - *  This program is free software; you can redistribute it and/or modify it
> - *  under the terms of the GNU General Public License version 2 as published
> - *  by the Free Software Foundation.
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 2 as published
> + * by the Free Software Foundation.
>   */
> 
>  #include 
> @@ -37,130 +37,130 @@
>  #define GL_AR300M_GPIO_BTN_LEFT0
>  #define GL_AR300M_GPIO_BTN_RIGHT   1
> 
> -#define GL_AR300M_KEYS_POLL_INTERVAL20  /* msecs */
> -#define GL_AR300M_KEYS_DEBOUNCE_INTERVAL(3 * 
> GL_AR300M_KEYS_POLL_INTERVAL)
> +#define GL_AR300M_KEYS_POLL_INTERVAL   20  /* msecs */
> +#define GL_AR300M_KEYS_DEBOUNCE_INTERVAL   (3 *
> GL_AR300M_KEYS_POLL_INTERVAL)
> 
> -#define GL_AR300M_MAC0_OFFSET   0
> -#define GL_AR300M_MAC1_OFFSET   6
> -#define GL_AR300M_WMAC_CALDATA_OFFSET   0x1000
> -#define GL_AR300M_PCIE_CALDATA_OFFSET   0x5000
> +#define GL_AR300M_MAC0_OFFSET  0
> +#define GL_AR300M_MAC1_OFFSET  6
> +#define GL_AR300M_WMAC_CALDATA_OFFSET  0x1000
> +#define GL_AR300M_PCIE_CALDATA_OFFSET  0x5000
> 
>  static struct gpio_led gl_ar300m_leds_gpio[] __initdata = {
> -{
> -.name = "gl-ar300m:usb",
> -.gpio = GL_AR300M_GPIO_LED_USB,
> -.active_low = 0,
> -.d

Re: [LEDE-DEV] [PATCH mountd 0/5] mounted: warnings fixes and refactoring

2017-03-05 Thread Florian Fainelli


On 03/05/2017 04:50 PM, Florian Fainelli wrote:
> Hi all,
> 
> This patch series fixed "unused results" warnings, and in the process
> refactors how properties from block devices are obtained from sysfs.

So this was marked "Not applicable" in patchwork, what was the reason
for that? Patch 3 seems at least relevant, if nothing else.

Thanks
-- 
Florian

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


Re: [LEDE-DEV] [PATCH mountd 0/5] mounted: warnings fixes and refactoring

2017-03-05 Thread John Crispin


On 06/03/2017 07:11, Florian Fainelli wrote:
> 
> 
> On 03/05/2017 04:50 PM, Florian Fainelli wrote:
>> Hi all,
>>
>> This patch series fixed "unused results" warnings, and in the process
>> refactors how properties from block devices are obtained from sysfs.
> 
> So this was marked "Not applicable" in patchwork, what was the reason
> for that? Patch 3 seems at least relevant, if nothing else.
> 
> Thanks
> 

Hi Florian,

did not have time to send the mail earlier, i will drop mountd today and
replace it with blockd. feel free to push the patches to the mountd
master though.

John

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