-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Fri, Mar 11, 2016 at 10:30:35PM -0800, Dave C wrote:
> With earlier Qubes I tried to get a broadcom BCM4360 wireless card working,
> but had no luck. Recently I tried again with Qubes 3.1 and guess what, its
> working. I'm using it to post this message now.
Thanks!
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!
It is:
[user@net-powerbook24 ~]$ ls -l /rw/config/rc.local
-rwxr-xr-x 1 root root 523 Dec 18 15:57 /rw/config/rc.local
And I had a simple rc.local working for earlier version of fedora. But with 24, there are conflicting modules and I haven't managed to get it right.
I'm wondering when rc.local is executed during startup, and whether I need to explicitly wait for other startup to complete. As I mentioned, my script works only after startup, when I manually run in a terminal.
-Dave
I figured it out! The problem is that you ordered your rmmods wrong. I figured this out because if I disabled the rc.local script and just ran it on my own after boot, it would require to be run twice because two of the other modules were being used by b43 and therefore could not be disabled with it still running. So, you need to disable it first. This rc.local works perfectly on Fedora 24:
```
# Unload conflicting modules.
rmmod b43
rmmod ssb
rmmod bcma
rmmod brcmsmac
rmmod wl
# blacklist modules that may interfere with wl (broadcom)
# Not sure if this matters, haven't tried without
Okay so I've found another issue. For some reason, when the system is hibernated (e.g. lid is closed), the module seems to unload itself and the whole netvm freezes, requiring a "kill vm" and restart for it to work again. Any ideas on the cause of this?