Commit 32857a09 authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

modemu: fall back to a virtual bus

This allows us to somehow work with no PCI (or USB for that matter), such
as some virtual machines. Old ModemManager doesn't like this though, but
there doesn't seem to be a way around it.
parent bbb1a360
Pipeline #7820 passed with stages
in 11 minutes and 43 seconds
......@@ -121,8 +121,16 @@ sub send_netlink
die "Can't send a netlink message: $!" if $! and not $!{ECONNREFUSED};
my $devpath = '/devices/pci0000:00/0000:00:00.0';
unless (-d "/sys/$devpath") {
# Create a virtual device. Older ModemManager likes a hotpluggable bus
# (USB, PCI), but there's none on an IBM POWER lpar...
warn "No PCI bus to use for parent. Don't expect this to work with ModemManager 1.6";
$devpath = '/devices/virtual';
my %props = (
DEVPATH => "/devices/pci0000:00/0000:00:00.0/$name",
DEVPATH => "$devpath/$name",
SUBSYSTEM => 'tty',
DEVNAME => "/dev/$name",
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment