From 1c7d7cbd3963428888068af679946e6329567451 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 7 Jun 2020 14:04:36 +0200 Subject: wwan: T2529: migrate device from ttyUSB to usbXbY.YpZ.Z During testing it was discovered that there is a well known problem (we had for ethernet interfaces) also in the serial port world. They will be enumerated and mapped to /dev/ttyUSBxxx differently from boot to boot. This is especially painful on my development APU4 board which also has a Sierra Wireless MC7710 LTE module installed. The serial port will toggle between ttyUSB2 and ttyUSB5 depending on the amount of serial port extenders attached (FT4232H). The shipped udev rule (/usr/lib/udev/rules.d/60-serial.rules) partly solves this by enumerating the devices into /dev/serial/by-id folder with their name and serial number - it's a very good idea but I've found that not all of the FT4232H dongles have a serial number programmed - this leads to the situation that when you plug in two cables with both having serial number 0 - only one device symlink will appear - the previous one is always overwritten by the latter one. Derive /usr/lib/udev/rules.d/60-serial.rules and create a /dev/serial/by-bus directory and group devices by attached USB root port. vyos@vyos:~$ find /dev/serial/by-bus/ -name usb* -exec basename {} \; | sort usb0b1.3p1.0 usb0b1.3p1.2 usb0b1.3p1.3 usb0b2.4p1.0 usb0b2.4p1.1 usb0b2.4p1.2 usb0b2.4p1.3 So we have USB root 0 with bus 1.3 and port 1.0. The enumeration is constant accross reboots. --- data/templates/wwan/peer.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data/templates/wwan') diff --git a/data/templates/wwan/peer.tmpl b/data/templates/wwan/peer.tmpl index 04ab4f844..b8a7d10ae 100644 --- a/data/templates/wwan/peer.tmpl +++ b/data/templates/wwan/peer.tmpl @@ -10,7 +10,7 @@ linkname {{ intf }} usepeerdns {%- endif %} # physical device -/dev/{{ device }} +{{ device }} lcp-echo-failure 0 115200 debug -- cgit v1.2.3 From d70f1538f215f065855a89b1afe4cd8b26cd9cc2 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 7 Jun 2020 14:12:28 +0200 Subject: wwan: T2488: remove generation of dedicated logfile ... all information are present in journald. --- data/templates/wwan/peer.tmpl | 1 - src/conf_mode/interfaces-wirelessmodem.py | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'data/templates/wwan') diff --git a/data/templates/wwan/peer.tmpl b/data/templates/wwan/peer.tmpl index b8a7d10ae..0168283fd 100644 --- a/data/templates/wwan/peer.tmpl +++ b/data/templates/wwan/peer.tmpl @@ -14,7 +14,6 @@ usepeerdns lcp-echo-failure 0 115200 debug -logfile {{ logfile }} nodefaultroute ipcp-max-failure 4 ipcp-accept-local diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py index f16457a7f..571969f4d 100755 --- a/src/conf_mode/interfaces-wirelessmodem.py +++ b/src/conf_mode/interfaces-wirelessmodem.py @@ -24,7 +24,7 @@ from sys import exit from vyos.config import Config from vyos.ifconfig import BridgeIf, Section from vyos.template import render -from vyos.util import chown, chmod_755, cmd, call +from vyos.util import call from vyos.validate import is_member from vyos import ConfigError @@ -41,7 +41,6 @@ default_config_data = { 'disable': False, 'disable_link_detect': 1, 'on_demand': False, - 'logfile': '', 'metric': '10', 'mtu': '1500', 'name_server': True, @@ -76,7 +75,6 @@ def get_config(): raise ConfigError('Interface (VYOS_TAGNODE_VALUE) not specified') wwan['intf'] = os.environ['VYOS_TAGNODE_VALUE'] - wwan['logfile'] = f"/var/log/vyatta/ppp_{wwan['intf']}.log" wwan['chat_script'] = f"/etc/ppp/peers/chat.{wwan['intf']}" # check if interface is member if a bridge @@ -225,8 +223,6 @@ def apply(wwan): if not wwan['disable']: # "dial" WWAN connection intf = wwan['intf'] - # make logfile owned by root / vyattacfg - chown(wwan['logfile'], 'root', 'vyattacfg') call(f'systemctl start ppp@{intf}.service') # re-add ourselves to any bridge we might have fallen out of -- cgit v1.2.3