<div dir="ltr"><div dir="ltr"><div>I think I get all working with this setup :</div><div>in lxc config :</div><div><br></div><div>  raw.lxc: |-<br>    lxc.mount.entry=/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/net/wwan0 sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/net/wwan0 none bind,optional,create=dir</div><div>devices:</div><div>  cdc-wdm0:<br>    gid: "20"<br>    mode: "0666"<br>    path: /dev/cdc-wdm0<br>    source: /dev/cdc-wdm0<br>    type: unix-char<br>  ttyACM0:<br>    gid: "20"<br>    mode: "0666"<br>    path: /dev/ttyACM0<br>    source: /dev/ttyACM0<br>    type: unix-char<br>  usb_modem:<br>    gid: "0"<br>    productid: a001<br>    type: usb<br>    uid: "0"<br>    vendorid: "1199"<br>  wwan0:<br>    name: wwan0<br>    nictype: physical<br>    parent: wwan0<br>    type: nic<br></div></div><div><br></div><div>then in container (for each reboot):</div><div>create :</div><div>/var/lib/cloud/scripts/per-boot/LTE_udev_helper.sh</div><div><br></div><div>#!/bin/bash<br>service ModemManager stop<br>udevadm test /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/usbmisc/cdc-wdm0<br>udevadm test /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/tty/ttyACM0<br>udevadm test /sys/class/net/wwan0<br>sleep 1<br>service ModemManager start</div><div><br></div><div>Off course you had to adapte the usb path with your environement, maybe a special hook in usb dev ?!<br></div><div><br></div><div>and it seems ok (detection is a little slow)... I'm starting my tests on this setup (LTE Connect OK, SMS Ok).<br></div><div><br></div><div>Regards</div><div><br></div><div>Nicolas F.<br></div><div><br></div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 4 sept. 2020 à 19:40, Nicolas FOURNIL <<a href="mailto:nicolas.fournil@gmail.com">nicolas.fournil@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello</div><div><br></div><div>I'm trying dealing with modemmanager and unprivilived container... what I have done :</div><div>- creating /dev/ttyACM0</div><div>- creation /dev/cdc-wdm0</div><div>- sysfs entry to host /sys for this USB device</div><div><br></div><div>To get the correct udev flags (ID_MM_DEVICE_PROCESS=1 & ID_MM_CANDIDATE=1) ...if there's better you're welcome!) :</div><div></div><div>udevadm test /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/usbmisc/cdc-wdm0<br>udevadm test /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.2/tty/ttyACM0</div><div><br></div><div>Then I had a start of locating modem ... but It failed when trying to attach mbim interface (wwan0 to cdc-wdm0) :</div><div><br></div><div>ModemManager[374]: <debug> [1599237879.432413] Modem (Sierra) '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2' completely disposed<br>ModemManager[374]: <warn>  [1599237879.432446] Couldn't create modem for device '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-2': Failed to find a net port in the MBIM modem<br></div><div><br></div><div>To my investigations, there's an entry in /sys/devices/pci0000\:00/0000\:00\:14.0/usb1/1-2/1-2\:1.0/net/wwan0 who is linked by /sys/class/net/wwan0 -> ../../devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/net/wwan0/ and this is what modem manager is seeking.</div><div><br></div><div>And I haven't found how to import this network interface (wwan0 is like an ethernet device) directly inside the container without broke this link (yes tried to simply attach wwan0 to container of course... and is totaly ignore because not udev flagged and not "real" wwan0 but macvlan...)</div><div><br></div><div>Thanks for your help</div><div><br></div><div>Nicolas F.</div><div><br></div><div><br></div><div><br></div></div>
</blockquote></div></div>