[LEDE-DEV] [LEDE-DEV v3] Add support of using device symlinks.

Nickolay Ledovskikh nledovskikh at gmail.com
Fri Dec 16 03:14:05 PST 2016


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 <nledovskikh at gmail.com>
---
 package/network/utils/comgt/files/3g.sh                  | 2 ++
 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 | 2 ++
 4 files changed, 7 insertions(+)

diff --git a/package/network/utils/comgt/files/3g.sh b/package/network/utils/comgt/files/3g.sh
index b0cdae2..d438cb7 100644
--- a/package/network/utils/comgt/files/3g.sh
+++ b/package/network/utils/comgt/files/3g.sh
@@ -31,6 +31,8 @@ proto_3g_setup() {
 	json_get_var dialnumber dialnumber
 
 	[ -n "$dat_device" ] && device=$dat_device
+
+	device="$(readlink -f $device)"
 	[ -e "$device" ] || {
 		proto_set_available "$interface" 0
 		return 1
diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh
index 79b8c32..381bfb0 100644
--- a/package/network/utils/comgt/files/directip.sh
+++ b/package/network/utils/comgt/files/directip.sh
@@ -27,6 +27,7 @@ proto_directip_setup() {
 
 	[ -n "$ctl_device" ] && device=$ctl_device
 
+	device="$(readlink -f $device)"
 	[ -e "$device" ] || {
 		proto_notify_error "$interface" NO_DEVICE
 		proto_set_available "$interface" 0
diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh
index 09c2c18..cf3cef6 100644
--- a/package/network/utils/comgt/files/ncm.sh
+++ b/package/network/utils/comgt/files/ncm.sh
@@ -45,6 +45,8 @@ proto_ncm_setup() {
 		proto_set_available "$interface" 0
 		return 1
 	}
+
+	device="$(readlink -f $device)"
 	[ -e "$device" ] || {
 		echo "Control device not valid"
 		proto_set_available "$interface" 0
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 05b9242..cab9cb9 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -42,6 +42,8 @@ proto_qmi_setup() {
 		proto_set_available "$interface" 0
 		return 1
 	}
+
+	device="$(readlink -f $device)"
 	[ -c "$device" ] || {
 		echo "The specified control device does not exist"
 		proto_notify_error "$interface" NO_DEVICE
-- 
2.7.3




More information about the Lede-dev mailing list