[LEDE-DEV] [LEDE-DEV, 1/3, v2] uqmi: Add sync command to release all cids.

2016-12-07 Thread Nickolay Ledovskikh
Signed-off-by: Nickolay Ledovskikh 
---
 commands.c | 8 
 commands.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/commands.c b/commands.c
index b1b54d7..eb19280 100644
--- a/commands.c
+++ b/commands.c
@@ -64,6 +64,14 @@ cmd_version_prepare(struct qmi_dev *qmi, struct qmi_request 
*req, struct qmi_msg
return QMI_CMD_REQUEST;
 }
 
+#define cmd_sync_cb no_cb
+static enum qmi_cmd_result
+cmd_sync_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg 
*msg, char *arg)
+{
+   qmi_set_ctl_sync_request(msg);
+   return QMI_CMD_DONE;
+}
+
 #define cmd_get_client_id_cb no_cb
 static enum qmi_cmd_result
 cmd_get_client_id_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct 
qmi_msg *msg, char *arg)
diff --git a/commands.h b/commands.h
index 1c9b5d6..30c59d6 100644
--- a/commands.h
+++ b/commands.h
@@ -54,6 +54,7 @@ struct uqmi_cmd {
 
 #define __uqmi_commands \
__uqmi_command(version, get-versions, no, QMI_SERVICE_CTL), \
+   __uqmi_command(sync, sync, no, QMI_SERVICE_CTL), \
__uqmi_command(set_client_id, set-client-id, required, 
CMD_TYPE_OPTION), \
__uqmi_command(get_client_id, get-client-id, required, 
QMI_SERVICE_CTL), \
__uqmi_command(ctl_set_data_format, set-data-format, required, 
QMI_SERVICE_CTL), \
-- 
2.7.3


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


[LEDE-DEV] [LEDE-DEV, 2/3, v2] Add support of using device symlinks.

2016-12-07 Thread Nickolay Ledovskikh
It's useful when using multiple usb devices that should be bound to
certain usb ports. Symlinks are created by hotplug handlers.

Signed-off-by: Nickolay Ledovskikh 
---
 package/network/utils/comgt/files/directip.sh| 1 +
 package/network/utils/comgt/files/ncm.sh | 2 ++
 package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 3 +++
 3 files changed, 6 insertions(+)

diff --git a/package/network/utils/comgt/files/directip.sh 
b/package/network/utils/comgt/files/directip.sh
index 79b8c32..4dcbd70 100644
--- a/package/network/utils/comgt/files/directip.sh
+++ b/package/network/utils/comgt/files/directip.sh
@@ -33,6 +33,7 @@ proto_directip_setup() {
return 1
}
 
+   device="$(readlink -f $device)"
devname="$(basename "$device")"
devpath="$(readlink -f /sys/class/tty/$devname/device)"
ifname="$( ls "$devpath"/../../*/net )"
diff --git a/package/network/utils/comgt/files/ncm.sh 
b/package/network/utils/comgt/files/ncm.sh
index 14b6347..917a8c5 100644
--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -63,7 +63,9 @@ proto_ncm_setup() {
return 1
}
 
+   device="$(readlink -f $device)"
devname="$(basename "$device")"
+
case "$devname" in
'tty'*)
devpath="$(readlink -f /sys/class/tty/$devname/device)"
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh 
b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 1235698..fb4c339 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -51,6 +51,7 @@ proto_qmi_setup() {
return 1
}
 
+   device="$(readlink -f $device)"
devname="$(basename "$device")"
devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)"
ifname="$( ls "$devpath"/net )"
@@ -213,6 +214,8 @@ qmi_wds_stop() {
 
[ -n "$cid" ] || return
 
+   device="$(readlink -f $device)"
+
# disable previous autoconnect state using the global handle
uqmi -s -d "$device" --set-client-id wds,"$cid" --stop-network 
"0x"
 
-- 
2.7.3


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


[LEDE-DEV] [LEDE-DEV, 3/3, v2] uqmi: Prevent 'POLICY MISMATH' error.

2016-12-07 Thread Nickolay Ledovskikh
Add uqmi 'sync' command call to release stalled cid when preparing to
setup new connection. As a result it prevents 'POLICY MISMATCH' errors.

Signed-off-by: Nickolay Ledovskikh 
---
 package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh 
b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index fb4c339..3b24539 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -85,6 +85,7 @@ proto_qmi_setup() {
 
# try to clear previous autoconnect state
# do not reuse previous wds client id to prevent hangs caused by stale 
data
+   uqmi -s -d "$device" --sync
uqmi -s -d "$device" \
--stop-network 0x \
--autoconnect > /dev/null
-- 
2.7.3


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


Re: [LEDE-DEV] [PATCH 1/1] add support for overlaying rootfs content

2016-12-07 Thread Rafał Miłecki
On 7 December 2016 at 16:44, Karl Palsson  wrote:
> How is this different from just reverting the commit that stopped
> this from working? I'm all for this, don't get me wrong, but if a
> package can just explicitly define a file as "this overwrites
> whatever" how is that any different from before?

This new solution doesn't depend on the order of adding/installing
packages and we have actually some control  which package overwrites
files.

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


Re: [LEDE-DEV] What's the purpose / gain from using VARIANT?

2016-12-07 Thread Sergey Ryazanov
On Wed, Dec 7, 2016 at 10:52 PM, Rafał Miłecki  wrote:
> On 12/07/2016 08:36 PM, Sergey Ryazanov wrote:
>> On Wed, Dec 7, 2016 at 10:10 PM, Rafał Miłecki  wrote:
>>> I'm aware some packages (e.g. upstream-ssl, hostapd, dnsmasq) use
>>> VARIANT.
>>>
>>> I don't really understand the gain of this. How does it differ from
>>> specifying separated packages?
>>> I'm looking at package/libs/ustream-ssl/Makefile and I don't see much
>>> code saving from using this VARIANT variable/feature.
>>> Looking at package/system/opkg/Makefile I can see BUILD_VARIANT is
>>> used for more specific CONFIGURE_ARGS. Is that where VARIANTS gets
>>> really helpful?
>>> Maybe I'm missing some real gain/value?
>>
>>
>> IMHO VARIANT usage helps consolidate patches in single place. E.g. if
>> you would like change some common code in hostapd then just create a
>> new patch and VARIANT build two packages  (hostapd/wpa_supplicant)
>> from updated code. Without VARIANT you should duplicate your changes
>> (patch) in multiple places and keep them synchronized. So the gain is
>> simple: reducing of unproductive work.
>
> I don't think sharing patches has anything to do with VARIANT. As long as
> you
> define packages in one Makefile they are going to share source (and so
> patches).
>
> I did a trivial test with iw package. I created iw2 and compiled it using
> make package/network/utils/iw/install V=s
>
> I got one source directory:
> build_dir/target-*/iw-4.9
> and two package directories:
> build_dir/target-arm_cortex-a9_musl-1.1.15_eabi/iw-4.9/ipkg-*/iw
> build_dir/target-arm_cortex-a9_musl-1.1.15_eabi/iw-4.9/ipkg-*/iw2
>
Exactly. You got single build directory with the same sources the same
objects and finally the same binaries. But not different output
binaries from the same sources.

Another one good example of VARIANT usage is OpenVPN package(s).

-- 
Sergey

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


[LEDE-DEV] [PATCH] kernel: add KERNEL_DEBUG_PINCTRL and KERNEL_DEBUG_GPIO

2016-12-07 Thread Hauke Mehrtens
This makes it possible to activate the gpio and the pinctl debugging
from LEDE menuconfig.

Signed-off-by: Hauke Mehrtens 
---
 config/Config-kernel.in | 8 
 1 file changed, 8 insertions(+)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index d8ca76c..3c69c86 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -190,6 +190,14 @@ config KERNEL_MAGIC_SYSRQ
bool "Compile the kernel with SysRq support"
default y
 
+config KERNEL_DEBUG_PINCTRL
+   bool "Compile the kernel with pinctrl debugging"
+   select KERNEL_DEBUG_KERNEL
+
+config KERNEL_DEBUG_GPIO
+   bool "Compile the kernel with gpio debugging"
+   select KERNEL_DEBUG_KERNEL
+
 config KERNEL_COREDUMP
bool
 
-- 
2.10.2


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


[LEDE-DEV] [PATCH] kernel: add TI tmp102 and tmp103 temperature sensors

2016-12-07 Thread Hauke Mehrtens
This just adds the kmods for these kernel modules.
This is found on some Lantiq / Intel reference boards.

Signed-off-by: Hauke Mehrtens 
---
 package/kernel/linux/modules/hwmon.mk | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/package/kernel/linux/modules/hwmon.mk 
b/package/kernel/linux/modules/hwmon.mk
index 56cd0ec..f7f1101 100644
--- a/package/kernel/linux/modules/hwmon.mk
+++ b/package/kernel/linux/modules/hwmon.mk
@@ -328,6 +328,36 @@ endef
 $(eval $(call KernelPackage,hwmon-gsc))
 
 
+define KernelPackage/hwmon-tmp102
+  TITLE:=Texas Instruments TMP102 monitoring support
+  KCONFIG:=CONFIG_SENSORS_TMP102
+  FILES:=$(LINUX_DIR)/drivers/hwmon/tmp102.ko
+  AUTOLOAD:=$(call AutoLoad,60,tmp102)
+  $(call AddDepends/hwmon,+kmod-i2c-core)
+endef
+
+define KernelPackage/hwmon-tmp102/description
+ Kernel module for Texas Instruments TMP102 temperature sensors chip
+endef
+
+$(eval $(call KernelPackage,hwmon-tmp102))
+
+
+define KernelPackage/hwmon-tmp103
+  TITLE:=Texas Instruments TMP103 monitoring support
+  KCONFIG:=CONFIG_SENSORS_TMP103
+  FILES:=$(LINUX_DIR)/drivers/hwmon/tmp103.ko
+  AUTOLOAD:=$(call AutoLoad,60,tmp103)
+  $(call AddDepends/hwmon,+kmod-i2c-core +kmod-regmap)
+endef
+
+define KernelPackage/hwmon-tmp103/description
+ Kernel module for Texas Instruments TMP103 temperature sensors chip
+endef
+
+$(eval $(call KernelPackage,hwmon-tmp103))
+
+
 define KernelPackage/hwmon-tmp421
   TITLE:=TI TMP421 and compatible monitoring support
   KCONFIG:=CONFIG_SENSORS_TMP421
-- 
2.10.2


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


Re: [LEDE-DEV] [PATCH] kernel: add TI tmp102 and tmp103 temperature sensors

2016-12-07 Thread Rafał Miłecki
On 7 December 2016 at 22:45, Hauke Mehrtens  wrote:
> This just adds the kmods for these kernel modules.
> This is found on some Lantiq / Intel reference boards.
>
> Signed-off-by: Hauke Mehrtens 
> ---
>  package/kernel/linux/modules/hwmon.mk | 30 ++
>  1 file changed, 30 insertions(+)
>
> diff --git a/package/kernel/linux/modules/hwmon.mk 
> b/package/kernel/linux/modules/hwmon.mk
> index 56cd0ec..f7f1101 100644
> --- a/package/kernel/linux/modules/hwmon.mk
> +++ b/package/kernel/linux/modules/hwmon.mk
> @@ -328,6 +328,36 @@ endef
>  $(eval $(call KernelPackage,hwmon-gsc))
>
>
> +define KernelPackage/hwmon-tmp102
> +  TITLE:=Texas Instruments TMP102 monitoring support
> +  KCONFIG:=CONFIG_SENSORS_TMP102
> +  FILES:=$(LINUX_DIR)/drivers/hwmon/tmp102.ko
> +  AUTOLOAD:=$(call AutoLoad,60,tmp102)
> +  $(call AddDepends/hwmon,+kmod-i2c-core)
> +endef

Do we have any policy on AutoLoad vs. AutoProbe? I guess AutoLoad is
still used in many places, just wondering if new code should be using
AutoProbe maybe?

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


Re: [LEDE-DEV] What's the purpose / gain from using VARIANT?

2016-12-07 Thread Sergey Ryazanov
Hello Rafał,

On Wed, Dec 7, 2016 at 10:10 PM, Rafał Miłecki  wrote:
> I'm aware some packages (e.g. upstream-ssl, hostapd, dnsmasq) use VARIANT.
>
> I don't really understand the gain of this. How does it differ from
> specifying separated packages?
> I'm looking at package/libs/ustream-ssl/Makefile and I don't see much
> code saving from using this VARIANT variable/feature.
> Looking at package/system/opkg/Makefile I can see BUILD_VARIANT is
> used for more specific CONFIGURE_ARGS. Is that where VARIANTS gets
> really helpful?
> Maybe I'm missing some real gain/value?

IMHO VARIANT usage helps consolidate patches in single place. E.g. if
you would like change some common code in hostapd then just create a
new patch and VARIANT build two packages  (hostapd/wpa_supplicant)
from updated code. Without VARIANT you should duplicate your changes
(patch) in multiple places and keep them synchronized. So the gain is
simple: reducing of unproductive work.

-- 
Sergey

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


Re: [LEDE-DEV] [PATCH 1/1] add support for overlaying rootfs content

2016-12-07 Thread Karl Palsson

Rafał Miłecki   wrote:
> On 7 December 2016 at 16:44, Karl Palsson 
> wrote:
> > How is this different from just reverting the commit that stopped
> > this from working? I'm all for this, don't get me wrong, but if a
> > package can just explicitly define a file as "this overwrites
> > whatever" how is that any different from before?
> 
> This new solution doesn't depend on the order of
> adding/installing packages and we have actually some control
> which package overwrites files.
> 
re order: how? You've still got to collect all the packages with
this special define and run them right? You're still going to get
conflicts one way or the other.

re control: how?  How is this:

```Your new way
package/blah/overlay
$(CP) wop /etc/somewhere
endef

any different from this

```The old way that was removed
package/blah/install
$(CP) wop /etc/somewhere
endef
```

Cheers,
Karl P

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


[LEDE-DEV] What's the purpose / gain from using VARIANT?

2016-12-07 Thread Rafał Miłecki
I'm aware some packages (e.g. upstream-ssl, hostapd, dnsmasq) use VARIANT.

I don't really understand the gain of this. How does it differ from
specifying separated packages?
I'm looking at package/libs/ustream-ssl/Makefile and I don't see much
code saving from using this VARIANT variable/feature.
Looking at package/system/opkg/Makefile I can see BUILD_VARIANT is
used for more specific CONFIGURE_ARGS. Is that where VARIANTS gets
really helpful?
Maybe I'm missing some real gain/value?

-- 
Rafał

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


Re: [LEDE-DEV] batman-adv-legacy fails building because of missing dep kmod-crypto-core

2016-12-07 Thread Matthias Schiffer
On 12/07/2016 12:34 PM, Jochen Demmer wrote:
> Hi,
> 
> my current commit: ee55a19a618a30182213937c8c96e056d8f9ed41
> tried to build with the following diffconfig:
> https://paste.fedoraproject.org/500943/
> 
> Getting this error:
> 
> Collected errors:
>  * satisfy_dependencies_for: Cannot satisfy the following dependencies
> for kmod-batman-adv-legacy:
>  *  kmod-crypto-core *
>  * opkg_install_cmd: Cannot install package kmod-batman-adv-legacy.
> package/Makefile:56: recipe for target 'package/install' failed
> make[2]: *** [package/install] Error 255
> 
> 
> Obviously Felix Fietkau removed kmod-crypto-core package on Sept. 8th
> but why is batman-adv-legacy still requiring it?
> I'm not using any third party feeds in feeds.conf.
> 
> Thx
> Jochen Demmer

Where do you get kmod-batman-adv-legacy? AFAIK, it is in none of the
default feeds.

https://github.com/freifunk-gluon/packages has recently been updated to
work with LEDE; if you're using another source, the changes will need to be
applied there, too.

Regards,
Matthias



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


Re: [LEDE-DEV] [PATCH 1/2] armvirt: new target

2016-12-07 Thread Felix Fietkau
On 2016-12-07 03:02, Yousong Zhou wrote:
> An ARM Cortex-A15 machine provided by QEMU.
> 
> Kernel drivers enabled:
> 
>  - pl011, uart
>  - pl031, rtc
>  - pl061, gpio
>  - pci-host-generic
>  - virtio_{mmio,pci,net,blk,scsi,9p,console,balloon}
>  - smp with NR_CPUS=4
>  - cpu-hotplug
>  - ext4
>  - neon, vfp extensions support (otherwise userland will fail with
>illegal instruction signal (code 0x0004))
>  - DEBUG_BUGVERBOSE for debug purposes
> 
> Signed-off-by: Yousong Zhou 
Instead of ext4, I would recommend using squashfs images, like on x86 or
uml.

- Felix


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


[LEDE-DEV] [patch]layerscape: update uboot/fman, add 64b/32b target for ls1046ardb device

2016-12-07 Thread Y.T. Jiang
Hi all,

https://github.com/lede-project/source/pull/593
This PR include three patches:
 [PATCH 1/3] layerscape: uboot-layerscape: prefer github over git.freescale.com
 [PATCH 2/3] layerscape: fman-ucode: prefer github over git.freescale.com
 [PATCH 3/3] layerscape: add 64b/32b target for ls1046ardb device

For avoid the impact of the merger of the company and the potential rebase of 
the SDK repositories, migrate the uboot-layerscape and fman-ucode source to 
github, so update them PKG_SOURCE_URL.
Add a new ls1046ardb device support.

Please review, thanks.


Thanks & Best Regards
Jiang Yutang

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


[LEDE-DEV] batman-adv-legacy fails building because of missing dep kmod-crypto-core

2016-12-07 Thread Jochen Demmer
Hi,

my current commit: ee55a19a618a30182213937c8c96e056d8f9ed41
tried to build with the following diffconfig:
https://paste.fedoraproject.org/500943/

Getting this error:

Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies
for kmod-batman-adv-legacy:
 *  kmod-crypto-core *
 * opkg_install_cmd: Cannot install package kmod-batman-adv-legacy.
package/Makefile:56: recipe for target 'package/install' failed
make[2]: *** [package/install] Error 255


Obviously Felix Fietkau removed kmod-crypto-core package on Sept. 8th
but why is batman-adv-legacy still requiring it?
I'm not using any third party feeds in feeds.conf.

Thx
Jochen Demmer

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


[LEDE-DEV] [PATCH 1/1] add support for overlaying rootfs content

2016-12-07 Thread Rafał Miłecki
From: Rafał Miłecki 

This adds support for install-overlay define. When used in package it
allows installing files to a special directory that gets copied to the
root when installing it.
It allows overwriting files provided by other packages.

Signed-off-by: Rafał Miłecki 
---
 include/package-ipkg.mk   | 9 +
 package/base-files/files/lib/functions.sh | 5 +
 2 files changed, 14 insertions(+)

diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index afd2d4e..e168eb3 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -96,7 +96,14 @@ ifeq ($(DUMP),)
 KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
 
 ifeq ($(BUILD_VARIANT),$$(if $$(VARIANT),$$(VARIANT),$(BUILD_VARIANT)))
+do_install=
 ifdef Package/$(1)/install
+  do_install=yes
+endif
+ifdef Package/$(1)/install-overlay
+  do_install=yes
+endif
+ifdef do_install
   ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
 IPKGS += $(1)
 compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides 
$(STAGING_DIR_ROOT)/stamp/.$(1)_installed
@@ -178,6 +185,8 @@ $(_endef)
@rm -rf $$(IDIR_$(1)) $$(call opkg_package_files,$(1))
mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
$(call Package/$(1)/install,$$(IDIR_$(1)))
+   $(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) 
$$(IDIR_$(1))/rootfs-overlay)
+   $(call Package/$(1)/install-overlay,$$(IDIR_$(1))/rootfs-overlay)
-find $$(IDIR_$(1)) -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name 
'*~'| $(XARGS) rm -rf
@( \
find $$(IDIR_$(1)) -name lib\*.so\* -or -name \*.ko | awk -F/ 
'{ print NF }'; \
diff --git a/package/base-files/files/lib/functions.sh 
b/package/base-files/files/lib/functions.sh
index b3bf221..b68db6b 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -230,6 +230,11 @@ default_postinst() {
ret=$?
fi
 
+   if [ -d "$root/rootfs-overlay" ]; then
+   cp -R $root/rootfs-overlay/. $root/
+   rm -fR $root/rootfs-overlay/
+   fi
+
if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" 
"/usr/lib/opkg/info/${pkgname}.list"; then
. /lib/functions/system.sh
[ -d /tmp/.uci ] || mkdir -p /tmp/.uci
-- 
2.10.1


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


[LEDE-DEV] uqmi: Add sync command to release all cids.

2016-12-07 Thread Nickolay Ledovskikh
Signed-off-by: Nickolay Ledovskikh 
---
 commands.c | 8 
 commands.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/commands.c b/commands.c
index b1b54d7..eb19280 100644
--- a/commands.c
+++ b/commands.c
@@ -64,6 +64,14 @@ cmd_version_prepare(struct qmi_dev *qmi, struct qmi_request 
*req, struct qmi_msg
return QMI_CMD_REQUEST;
 }
 
+#define cmd_sync_cb no_cb
+static enum qmi_cmd_result
+cmd_sync_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg 
*msg, char *arg)
+{
+   qmi_set_ctl_sync_request(msg);
+   return QMI_CMD_DONE;
+}
+
 #define cmd_get_client_id_cb no_cb
 static enum qmi_cmd_result
 cmd_get_client_id_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct 
qmi_msg *msg, char *arg)
diff --git a/commands.h b/commands.h
index 1c9b5d6..30c59d6 100644
--- a/commands.h
+++ b/commands.h
@@ -54,6 +54,7 @@ struct uqmi_cmd {
 
 #define __uqmi_commands \
__uqmi_command(version, get-versions, no, QMI_SERVICE_CTL), \
+   __uqmi_command(sync, sync, no, QMI_SERVICE_CTL), \
__uqmi_command(set_client_id, set-client-id, required, 
CMD_TYPE_OPTION), \
__uqmi_command(get_client_id, get-client-id, required, 
QMI_SERVICE_CTL), \
__uqmi_command(ctl_set_data_format, set-data-format, required, 
QMI_SERVICE_CTL), \
-- 
2.7.3


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


[LEDE-DEV] [EXAMPLE 2/1] custom-banner: package customizing LEDE banner

2016-12-07 Thread Rafał Miłecki
From: Rafał Miłecki 

Signed-off-by: Rafał Miłecki 
---
 package/custom-banner/Makefile | 28 
 package/custom-banner/banner   | 10 ++
 2 files changed, 38 insertions(+)
 create mode 100644 package/custom-banner/Makefile
 create mode 100644 package/custom-banner/banner

diff --git a/package/custom-banner/Makefile b/package/custom-banner/Makefile
new file mode 100644
index 000..f860d2d
--- /dev/null
+++ b/package/custom-banner/Makefile
@@ -0,0 +1,28 @@
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/version.mk
+
+PKG_NAME:=custom-banner
+PKG_RELEASE:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/custom-banner
+  SECTION:=base
+  CATEGORY:=Base system
+  DEPENDS:=+base-files
+  TITLE:=Custom banner
+endef
+
+define Build/Prepare
+   mkdir -p $(PKG_BUILD_DIR)
+endef
+
+define Build/Compile
+endef
+
+define Package/custom-banner/install-overlay
+   $(INSTALL_DIR) $(1)/etc/
+   $(CP) ./banner $(1)/etc/
+endef
+
+$(eval $(call BuildPackage,custom-banner))
diff --git a/package/custom-banner/banner b/package/custom-banner/banner
new file mode 100644
index 000..c95a4c0
--- /dev/null
+++ b/package/custom-banner/banner
@@ -0,0 +1,10 @@
+ _
+//\
+   /U   /  \
+  /   C/\
+ //  S   \
+ \\T /
+  \   M\/  ---
+   \O   \  /Custom banner
+\\/---
+
-- 
2.10.1


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


Re: [LEDE-DEV] What's the purpose / gain from using VARIANT?

2016-12-07 Thread Rafał Miłecki

On 12/07/2016 08:36 PM, Sergey Ryazanov wrote:

On Wed, Dec 7, 2016 at 10:10 PM, Rafał Miłecki  wrote:

I'm aware some packages (e.g. upstream-ssl, hostapd, dnsmasq) use VARIANT.

I don't really understand the gain of this. How does it differ from
specifying separated packages?
I'm looking at package/libs/ustream-ssl/Makefile and I don't see much
code saving from using this VARIANT variable/feature.
Looking at package/system/opkg/Makefile I can see BUILD_VARIANT is
used for more specific CONFIGURE_ARGS. Is that where VARIANTS gets
really helpful?
Maybe I'm missing some real gain/value?


IMHO VARIANT usage helps consolidate patches in single place. E.g. if
you would like change some common code in hostapd then just create a
new patch and VARIANT build two packages  (hostapd/wpa_supplicant)
from updated code. Without VARIANT you should duplicate your changes
(patch) in multiple places and keep them synchronized. So the gain is
simple: reducing of unproductive work.


I don't think sharing patches has anything to do with VARIANT. As long as you
define packages in one Makefile they are going to share source (and so
patches).

I did a trivial test with iw package. I created iw2 and compiled it using
make package/network/utils/iw/install V=s

I got one source directory:
build_dir/target-*/iw-4.9
and two package directories:
build_dir/target-arm_cortex-a9_musl-1.1.15_eabi/iw-4.9/ipkg-*/iw
build_dir/target-arm_cortex-a9_musl-1.1.15_eabi/iw-4.9/ipkg-*/iw2



diff --git a/package/network/utils/iw/Makefile 
b/package/network/utils/iw/Makefile
index f84978f..7674056 100644
--- a/package/network/utils/iw/Makefile
+++ b/package/network/utils/iw/Makefile
@@ -28,6 +28,11 @@ define Package/iw
   DEPENDS:= +libnl-tiny
 endef

+define Package/iw2
+  $(Package/iw)
+  TITLE:=cfg80211 interface configuration utility 2
+endef
+
 define Build/Configure
echo "const char iw_version[] = \"$(PKG_VERSION)\";" > 
$(PKG_BUILD_DIR)/version.c
rm -f $(PKG_BUILD_DIR)/version.sh
@@ -54,4 +59,9 @@ define Package/iw/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/iw $(1)/usr/sbin/
 endef

+define Package/iw2/install
+   $(Package/iw/install)
+endef
+
 $(eval $(call BuildPackage,iw))
+$(eval $(call BuildPackage,iw2))


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


[LEDE-DEV] [PATCH uclient v3] Fix unused results warnings

2016-12-07 Thread Florian Fainelli
Fixes:

uclient-http.c:385:8: error: ignoring return value of 'fread', declared with 
attribute warn_unused_result [-Werror=unused-result]
   fread(, sizeof(val), 1, f);
^

uclient-fetch.c: In function 'main':
uclient-fetch.c:664:12: error: ignoring return value of 'asprintf', declared 
with attribute warn_unused_result [-Werror=unused-result]
asprintf(_str, "%s:%s", username, password);
^
uclient-fetch.c: In function 'read_data_cb':
uclient-fetch.c:269:9: error: ignoring return value of 'write', declared with 
attribute warn_unused_result [-Werror=unused-result]
write(output_fd, buf, len);

Signed-off-by: Florian Fainelli 
---
 uclient-fetch.c | 16 +++-
 uclient-http.c  |  5 -
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/uclient-fetch.c b/uclient-fetch.c
index 4c603fbc1945..d9582f55e2c1 100644
--- a/uclient-fetch.c
+++ b/uclient-fetch.c
@@ -254,6 +254,7 @@ static void header_done_cb(struct uclient *cl)
 static void read_data_cb(struct uclient *cl)
 {
char buf[256];
+   ssize_t n;
int len;
 
if (!no_output && output_fd < 0)
@@ -265,8 +266,11 @@ static void read_data_cb(struct uclient *cl)
return;
 
out_bytes += len;
-   if (!no_output)
-   write(output_fd, buf, len);
+   if (!no_output) {
+   n = write(output_fd, buf, len);
+   if (n < 0)
+   return;
+   }
}
 }
 
@@ -660,9 +664,11 @@ int main(int argc, char **argv)
uloop_init();
 
if (username) {
-   if (password)
-   asprintf(_str, "%s:%s", username, password);
-   else
+   if (password) {
+   rc = asprintf(_str, "%s:%s", username, password);
+   if (rc < 0)
+   return rc;
+   } else
auth_str = username;
}
 
diff --git a/uclient-http.c b/uclient-http.c
index 8d26bd4884be..ac9d50f4b2ad 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -379,11 +379,14 @@ get_cnonce(char *dest)
 {
uint32_t val = 0;
FILE *f;
+   size_t n;
 
f = fopen("/dev/urandom", "r");
if (f) {
-   fread(, sizeof(val), 1, f);
+   n = fread(, sizeof(val), 1, f);
fclose(f);
+   if (n != 1)
+   return;
}
 
bin_to_hex(dest, , sizeof(val));
-- 
2.9.3


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


Re: [LEDE-DEV] [PATCH 1/1] add support for overlaying rootfs content

2016-12-07 Thread Karl Palsson

How is this different from just reverting the commit that stopped
this from working? I'm all for this, don't get me wrong, but if a
package can just explicitly define a file as "this overwrites
whatever" how is that any different from before?

If I remember correctly it was this one:

commit 021b96d7c5c668fbcb5375c65cee90832bb2854f
Author: Matthias Schiffer  Date:
Mon Sep 26 15:25:38 2016 +0200

rootfs: remove unnecessary and potentially harmful force flags from opkg 
call

Especially --force-overwrite and --force-depends will often lead to broken
images; it's better to fail the build in such cases than to silently ignore
the errors.

Instead, ignore errors in the per-device rootfs opkg remove command, so
the build doesn't break when packages can't be removed because of
dependencies.

Signed-off-by: Matthias Schiffer 



Perhaps putting --force-overwrite back on?

Cheers,
Karl Palsson


Rafał Miłecki   wrote:
> From: Rafał Miłecki 
> 
> This adds support for install-overlay define. When used in
> package it allows installing files to a special directory that
> gets copied to the root when installing it. It allows
> overwriting files provided by other packages.
> 
> Signed-off-by: Rafał Miłecki 
> ---
>  include/package-ipkg.mk   | 9 +
>  package/base-files/files/lib/functions.sh | 5 +
>  2 files changed, 14 insertions(+)
> 
> diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
> index afd2d4e..e168eb3 100644
> --- a/include/package-ipkg.mk
> +++ b/include/package-ipkg.mk
> @@ -96,7 +96,14 @@ ifeq ($(DUMP),)
>  KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
>  
>  ifeq ($(BUILD_VARIANT),$$(if $$(VARIANT),$$(VARIANT),$(BUILD_VARIANT)))
> +do_install=
>  ifdef Package/$(1)/install
> +  do_install=yes
> +endif
> +ifdef Package/$(1)/install-overlay
> +  do_install=yes
> +endif
> +ifdef do_install
>ifneq ($(CONFIG_PACKAGE_$(1))$(DEVELOPER),)
>  IPKGS += $(1)
>  compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides 
> $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
> @@ -178,6 +185,8 @@ $(_endef)
>   @rm -rf $$(IDIR_$(1)) $$(call opkg_package_files,$(1))
>   mkdir -p $(PACKAGE_DIR) $$(IDIR_$(1))/CONTROL $(PKG_INFO_DIR)
>   $(call Package/$(1)/install,$$(IDIR_$(1)))
> + $(if $(Package/$(1)/install-overlay),mkdir -p $(PACKAGE_DIR) 
> $$(IDIR_$(1))/rootfs-overlay)
> + $(call Package/$(1)/install-overlay,$$(IDIR_$(1))/rootfs-overlay)
>   -find $$(IDIR_$(1)) -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name 
> '*~'| $(XARGS) rm -rf
>   @( \
>   find $$(IDIR_$(1)) -name lib\*.so\* -or -name \*.ko | awk -F/ 
> '{ print NF }'; \
> diff --git a/package/base-files/files/lib/functions.sh
> b/package/base-files/files/lib/functions.sh index
> b3bf221..b68db6b 100755
> --- a/package/base-files/files/lib/functions.sh
> +++ b/package/base-files/files/lib/functions.sh
> @@ -230,6 +230,11 @@ default_postinst() {
>   ret=$?
>   fi
>  
> + if [ -d "$root/rootfs-overlay" ]; then
> + cp -R $root/rootfs-overlay/. $root/
> + rm -fR $root/rootfs-overlay/
> + fi
> +
>   if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" 
> "/usr/lib/opkg/info/${pkgname}.list"; then
>   . /lib/functions/system.sh
>   [ -d /tmp/.uci ] || mkdir -p /tmp/.uci
> -- 
> 2.10.1
> 
> 
> ___
> Lede-dev mailing list
> Lede-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev

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


Re: [LEDE-DEV] batman-adv-legacy fails building because of missing dep kmod-crypto-core

2016-12-07 Thread Jochen Demmer
I used to include gluon-packages in feeds.conf. After I removed it
batman-adv-legacy was still available. It just didn't get any updates.
Since I added gluon-packages back to feeds.conf and then updated it
building now works fine.

Thank you

Am 07.12.2016 um 14:08 schrieb Matthias Schiffer:
> On 12/07/2016 12:34 PM, Jochen Demmer wrote:
>> Hi,
>>
>> my current commit: ee55a19a618a30182213937c8c96e056d8f9ed41
>> tried to build with the following diffconfig:
>> https://paste.fedoraproject.org/500943/
>>
>> Getting this error:
>> 
>> Collected errors:
>>  * satisfy_dependencies_for: Cannot satisfy the following dependencies
>> for kmod-batman-adv-legacy:
>>  *  kmod-crypto-core *
>>  * opkg_install_cmd: Cannot install package kmod-batman-adv-legacy.
>> package/Makefile:56: recipe for target 'package/install' failed
>> make[2]: *** [package/install] Error 255
>> 
>>
>> Obviously Felix Fietkau removed kmod-crypto-core package on Sept. 8th
>> but why is batman-adv-legacy still requiring it?
>> I'm not using any third party feeds in feeds.conf.
>>
>> Thx
>> Jochen Demmer
> Where do you get kmod-batman-adv-legacy? AFAIK, it is in none of the
> default feeds.
>
> https://github.com/freifunk-gluon/packages has recently been updated to
> work with LEDE; if you're using another source, the changes will need to be
> applied there, too.
>
> Regards,
> Matthias
>




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


[LEDE-DEV] * Add support of using device symlinks in network config. For example, it useful when using multiple usb devices that should be bound to certain usb ports. * Add uqmi 'sync' command call to

2016-12-07 Thread Nickolay Ledovskikh
Signed-off-by: Nickolay Ledovskikh 
---
 package/network/utils/comgt/files/directip.sh| 1 +
 package/network/utils/comgt/files/ncm.sh | 2 ++
 package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 4 
 3 files changed, 7 insertions(+)

diff --git a/package/network/utils/comgt/files/directip.sh 
b/package/network/utils/comgt/files/directip.sh
index 79b8c32..4dcbd70 100644
--- a/package/network/utils/comgt/files/directip.sh
+++ b/package/network/utils/comgt/files/directip.sh
@@ -33,6 +33,7 @@ proto_directip_setup() {
return 1
}
 
+   device="$(readlink -f $device)"
devname="$(basename "$device")"
devpath="$(readlink -f /sys/class/tty/$devname/device)"
ifname="$( ls "$devpath"/../../*/net )"
diff --git a/package/network/utils/comgt/files/ncm.sh 
b/package/network/utils/comgt/files/ncm.sh
index 14b6347..917a8c5 100644
--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -63,7 +63,9 @@ proto_ncm_setup() {
return 1
}
 
+   device="$(readlink -f $device)"
devname="$(basename "$device")"
+
case "$devname" in
'tty'*)
devpath="$(readlink -f /sys/class/tty/$devname/device)"
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh 
b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 1235698..3b24539 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -51,6 +51,7 @@ proto_qmi_setup() {
return 1
}
 
+   device="$(readlink -f $device)"
devname="$(basename "$device")"
devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)"
ifname="$( ls "$devpath"/net )"
@@ -84,6 +85,7 @@ proto_qmi_setup() {
 
# try to clear previous autoconnect state
# do not reuse previous wds client id to prevent hangs caused by stale 
data
+   uqmi -s -d "$device" --sync
uqmi -s -d "$device" \
--stop-network 0x \
--autoconnect > /dev/null
@@ -213,6 +215,8 @@ qmi_wds_stop() {
 
[ -n "$cid" ] || return
 
+   device="$(readlink -f $device)"
+
# disable previous autoconnect state using the global handle
uqmi -s -d "$device" --set-client-id wds,"$cid" --stop-network 
"0x"
 
-- 
2.7.3


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


[LEDE-DEV] * Add support of using device symlinks in network config. For example, it useful when using multiple usb devices that should be bound to certain usb ports. * Add uqmi 'sync' command call to

2016-12-07 Thread Nickolay Ledovskikh
Signed-off-by: Nickolay Ledovskikh 
---
 package/network/utils/comgt/files/directip.sh| 1 +
 package/network/utils/comgt/files/ncm.sh | 2 ++
 package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 4 
 3 files changed, 7 insertions(+)

diff --git a/package/network/utils/comgt/files/directip.sh 
b/package/network/utils/comgt/files/directip.sh
index 79b8c32..4dcbd70 100644
--- a/package/network/utils/comgt/files/directip.sh
+++ b/package/network/utils/comgt/files/directip.sh
@@ -33,6 +33,7 @@ proto_directip_setup() {
return 1
}
 
+   device="$(readlink -f $device)"
devname="$(basename "$device")"
devpath="$(readlink -f /sys/class/tty/$devname/device)"
ifname="$( ls "$devpath"/../../*/net )"
diff --git a/package/network/utils/comgt/files/ncm.sh 
b/package/network/utils/comgt/files/ncm.sh
index 14b6347..917a8c5 100644
--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -63,7 +63,9 @@ proto_ncm_setup() {
return 1
}
 
+   device="$(readlink -f $device)"
devname="$(basename "$device")"
+
case "$devname" in
'tty'*)
devpath="$(readlink -f /sys/class/tty/$devname/device)"
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh 
b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 1235698..3b24539 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -51,6 +51,7 @@ proto_qmi_setup() {
return 1
}
 
+   device="$(readlink -f $device)"
devname="$(basename "$device")"
devpath="$(readlink -f /sys/class/usbmisc/$devname/device/)"
ifname="$( ls "$devpath"/net )"
@@ -84,6 +85,7 @@ proto_qmi_setup() {
 
# try to clear previous autoconnect state
# do not reuse previous wds client id to prevent hangs caused by stale 
data
+   uqmi -s -d "$device" --sync
uqmi -s -d "$device" \
--stop-network 0x \
--autoconnect > /dev/null
@@ -213,6 +215,8 @@ qmi_wds_stop() {
 
[ -n "$cid" ] || return
 
+   device="$(readlink -f $device)"
+
# disable previous autoconnect state using the global handle
uqmi -s -d "$device" --set-client-id wds,"$cid" --stop-network 
"0x"
 
-- 
2.7.3


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


Re: [LEDE-DEV] What's the purpose / gain from using VARIANT?

2016-12-07 Thread Florian Fainelli
On 12/07/2016 11:52 AM, Rafał Miłecki wrote:
> On 12/07/2016 08:36 PM, Sergey Ryazanov wrote:
>> On Wed, Dec 7, 2016 at 10:10 PM, Rafał Miłecki  wrote:
>>> I'm aware some packages (e.g. upstream-ssl, hostapd, dnsmasq) use
>>> VARIANT.
>>>
>>> I don't really understand the gain of this. How does it differ from
>>> specifying separated packages?
>>> I'm looking at package/libs/ustream-ssl/Makefile and I don't see much
>>> code saving from using this VARIANT variable/feature.
>>> Looking at package/system/opkg/Makefile I can see BUILD_VARIANT is
>>> used for more specific CONFIGURE_ARGS. Is that where VARIANTS gets
>>> really helpful?
>>> Maybe I'm missing some real gain/value?
>>
>> IMHO VARIANT usage helps consolidate patches in single place. E.g. if
>> you would like change some common code in hostapd then just create a
>> new patch and VARIANT build two packages  (hostapd/wpa_supplicant)
>> from updated code. Without VARIANT you should duplicate your changes
>> (patch) in multiple places and keep them synchronized. So the gain is
>> simple: reducing of unproductive work.
> 
> I don't think sharing patches has anything to do with VARIANT. As long
> as you
> define packages in one Makefile they are going to share source (and so
> patches).

IMHO, this is more about sharing the build recipe more than anything
else. Usually building from one variant to another is just a matter of
tuning a bunch of build configuration parameters, but the bulk of how to
build a package remains the same.
-- 
Florian

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


[LEDE-DEV] [PATCH] comgt-ncm: Add support for specifying profile index

2016-12-07 Thread Giuseppe Lippolis
> --- a/package/network/utils/comgt/files/getcardinfo.gcom
> +++ b/package/network/utils/comgt/files/getcardinfo.gcom
> @@ -6,7 +6,7 @@ opengt
>   flash 0.1
> 
>  :start
> - send "ATI^m"
> + send "AT+CGMI^m"

> diff --git a/package/network/utils/comgt/files/ncm.json


> diff --git a/package/network/utils/comgt/files/ncm.sh
> b/package/network/utils/comgt/files/ncm.sh
> index 14b6347..df60fe8 100644


> - manufacturer=`gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | awk
'/Manufacturer/ { print tolower($2) }'`
> + manufacturer=`gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | awk
+'NF { print tolower($1); exit; }'`

Unfortunately this currently doesn't work for me, but can be easily fixed.
Adding this line:
+   echo "Manufacturer: $manufacturer"
this is what I get in the logread:
Tue Dec  6 18:49:52 2016 daemon.notice netifd: Interface 'wan3g' is setting
up now
Tue Dec  6 18:49:52 2016 daemon.notice netifd: wan3g (1082): wwan[1082]
Using proto:wwan device:/dev/ttyUSB0 iface:usb0 desc:
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1082): Manufacturer:
at+cgmi
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1082): WARNING:
Variable 'at+cgmi' does not exist or is not an array/object
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1082): Unsupported
modem
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1122): Stopping
network device:
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1122): Can't open
device .
Tue Dec  6 18:49:54 2016 daemon.notice netifd: wan3g (1122): Failed to
disconnect
Tue Dec  6 18:49:54 2016 daemon.notice netifd: Interface 'wan3g' is now down

Running the getcardinfo script manually:
root@lede:~# gcom -d /dev/ttyUSB0 -s /etc/gcom/getcardinfo.gcom
AT+CGMI
+CGMI: MTK1

OK

A general comment:
Currently the wwan is dividing only for manufacturer and not per device
model.
I don't know if this is a good strategy. Probably the same manufacturer can
produce different modem models requiring some more specific configuration.
My suggestion is to keep the manufactured identification (as it is now) to
address the generic configuration, but identify also the model in order to
allow a more specific configuration if needed.

Bye.


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