Since starting this thread, I've (belatedly) upgraded to Qubes 3.2.  In doing 
so, I never figured out how to get the old kernel for which I compiled the wl 
module to migrate over to the new install.  Unfortunately a VM's kernel is not 
included when backing it up.

Anyway, I thought of that as an excuse to upgrade my net vm for broadcom to the 
latest version of fedora.  Unfortunately things are not working 100%.  So while 
I've made progress, this is actually a call for help to get things working on 
fedora 24.

# Give the PCI Device Permissive Passthrough (on dom0)

https://www.qubes-os.org/doc/assigning-devices/#pci-passthrough-issues

My /etc/systemd/system/qubes-pre-netvm.service ended up like this:

```
[Unit]
Description=permission pci netvm fixup
Before=qubes-netvm.servce

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c 'echo "0000:03:00.0" > 
/sys/bus/pci/drivers/pciback/permissive'

[Install]
WantedBy=multi-user.target
```

# Preparation to compile modules

Start a VM running same template and kernel version that your netvm
will use.  This can be a dispvm.

>From 
>https://www.broadcom.com/support/download-search/?pf=Wireless+LAN+Infrastructure

Move tarball to that vm (if not there already) and extract with

```
tar xvzf hybrid-v25_64-nodebug-nopcoem-6_30_223_271.tar.gz
```

Conveniently the README is not included.  You might find it at
https://docs.broadcom.com/docs/1211168561592, a link which will soon
be just as broken as all its predecessors scattered all over the
internet.


## Compile the modules


```
# Install kernel-devel that matches running kernel!
sudo yum install "kernel-devel-uname-r == $(uname -r)"

# I think necessary (?)
sudo modprobe cfg80211

# possibly necessary (?)
sudo yum install gcc

# Finally
make
```

## Install

I compiled in a dvm, so my install procedure was...

First, on the dvm where I compiled:

```
# Copy the built module
qvm-copy-to-vm net-powerbook24 wl.ko

# Find out what the install command will be.  Note -n will not actually install.
make -n install
```

Now we can use the command shown by `make -n install` earlier, in the new net 
vm (net-powerbook24 in my case).

```
install -D -m 755 QubesIncoming/disp2/wl.ko /lib/modules/`uname 
-r`/kernel/drivers/net/wireless

# This is documented in the readme, but not done by the install command.
depmod -a
```

But we want the module to be loaded automatically when the netvm starts.  This 
is the part I'm having trouble with!  If anyone can suggest a better way, 
please let me know.

Start by using Marek's technique for custom modules.  
(https://groups.google.com/forum/#!msg/qubes-users/Wt9Nm7posho/msTN_v2oa_oJ)

I've been experimenting with what to put in /rw/config/rc.local.  What I have 
at the moment is shown below.  But here's the problem...

When first starting the netvm, it does not successfully use the wifi.  However, 
if I manually open a terminal and run `sudo /rw/config/rc.local` then it will 
be able to connect to wifi.  So, something about this script is working, but 
not working on initial vm startup!

I have the following in /rw/config/rc.local:

```
# Unload conflicting modules.
rmmod ssb
rmmod bcma
rmmod b43
rmmod brcmsmac
rmmod wl

# blacklist modules that may interfere with wl (broadcom)
# (Not convinced these actually prevent the modules from loading!)
echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
echo "blacklist bcma" >> /etc/modprobe.d/blacklist.conf
echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf
echo "blacklist brcmsmac" >> /etc/modprobe.d/blacklist.conf

mount --bind /rw/modules /lib/modules
systemctl restart systemd-udevd

modprobe wl
```

...and make that rc.local executable.

I've tried various experiments. I've changed the order in that script of when I 
remove conflicting modules.  Nothing I've tried makes that script work 
successfully on startup.  I suspect that conflicting modules are loaded despite 
my attempt to blacklist them.  But when I run the script manually in a 
terminal, it works as hoped, and I can connect to wifi.  As I said earlier, I'd 
appreciate any help!

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/f191cec7-3514-427f-9e78-3ec066b9cec8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to