diff options
-rw-r--r-- | debian/vyos-1x.install | 1 | ||||
-rwxr-xr-x | src/conf_mode/interfaces-wirelessmodem.py | 11 | ||||
-rw-r--r-- | src/etc/udev/rules.d/99-vyos-wwan.rules | 11 |
3 files changed, 22 insertions, 1 deletions
diff --git a/debian/vyos-1x.install b/debian/vyos-1x.install index 5bb7ea507..5004d111f 100644 --- a/debian/vyos-1x.install +++ b/debian/vyos-1x.install @@ -3,6 +3,7 @@ etc/init.d etc/ppp etc/rsyslog.d etc/systemd +etc/udev etc/vyos lib/ opt/ diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py index 388d98f4e..93f60d038 100755 --- a/src/conf_mode/interfaces-wirelessmodem.py +++ b/src/conf_mode/interfaces-wirelessmodem.py @@ -32,6 +32,9 @@ config_wwan_tmpl = """### Autogenerated by interfaces-wirelessmodem.py ### # {{ description }} {% endif %} +# physical device +/dev/{{ device }} + ipparam {{ intf }} {{ metric }} {% if on_demand -%} demand @@ -53,6 +56,7 @@ crtscts lock persist + """ default_config_data = { @@ -136,9 +140,14 @@ def get_config(): return wwan def verify(wwan): - if wwan is None: + if wwan['deleted']: return None + # we can not use isfile() here as Linux device files are no regular files + # thus the check will return False + if not os.path.exists(f"/dev/{wwan['device']}"): + raise ConfigError(f"Device {wwan['device']} does not exist") + return None def generate(wwan): diff --git a/src/etc/udev/rules.d/99-vyos-wwan.rules b/src/etc/udev/rules.d/99-vyos-wwan.rules new file mode 100644 index 000000000..67f30a3dd --- /dev/null +++ b/src/etc/udev/rules.d/99-vyos-wwan.rules @@ -0,0 +1,11 @@ +ACTION!="add|change", GOTO="mbim_to_qmi_rules_end" + +SUBSYSTEM!="usb", GOTO="mbim_to_qmi_rules_end" + +# ignore any device with only one configuration +ATTR{bNumConfigurations}=="1", GOTO="mbim_to_qmi_rules_end" + +# force Sierra Wireless MC7710 to configuration #1 +ATTR{idVendor}=="1199",ATTR{idProduct}=="68a2",ATTR{bConfigurationValue}="1" + +LABEL="mbim_to_qmi_rules_end" |