Re: [qubes-users] Re: Qubes and Broadcom BCM4360 - A Success Story

2017-01-21 Thread Gray Olson
On Friday, January 20, 2017 at 11:48:06 PM UTC-5, Gray Olson wrote:
> On Wednesday, December 21, 2016 at 12:17:52 PM UTC-5, Kent Davis wrote:
> > Maybe you could use sleep, e.g., sleep 30 at the beginning of your
> > rc.local? kinda hacky though...
> > 
> > On Wed, Dec 21, 2016 at 9:58 AM, Dave Cohen  wrote:
> > >
> > >
> > > On Wed, Dec 21, 2016, at 08:53 AM, Kent Davis wrote:
> > >> I'm not certain, but based on when wireless comes up, I think it runs
> > >> towards the end of the boot process.
> > >>
> > >
> > > I mean rc.local.  Can I put some instruction in there and make sure it is 
> > > performed at the very end of startup?
> 
> 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
> echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf
> echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
> echo "blacklist bcma" >> /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
> 
> ```

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?

-- 
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/e1b2a779-792b-4705-afd7-04020266ede1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Re: Qubes and Broadcom BCM4360 - A Success Story

2017-01-20 Thread friends . gray
On Wednesday, December 21, 2016 at 12:17:52 PM UTC-5, Kent Davis wrote:
> Maybe you could use sleep, e.g., sleep 30 at the beginning of your
> rc.local? kinda hacky though...
> 
> On Wed, Dec 21, 2016 at 9:58 AM, Dave Cohen  wrote:
> >
> >
> > On Wed, Dec 21, 2016, at 08:53 AM, Kent Davis wrote:
> >> I'm not certain, but based on when wireless comes up, I think it runs
> >> towards the end of the boot process.
> >>
> >
> > I mean rc.local.  Can I put some instruction in there and make sure it is 
> > performed at the very end of startup?

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
echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf
echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
echo "blacklist bcma" >> /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

```

-- 
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/559c7f8d-ba2f-43f3-a492-8753c09bf58a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Re: Qubes and Broadcom BCM4360 - A Success Story

2016-12-21 Thread Kent Davis
Maybe you could use sleep, e.g., sleep 30 at the beginning of your
rc.local? kinda hacky though...

On Wed, Dec 21, 2016 at 9:58 AM, Dave Cohen  wrote:
>
>
> On Wed, Dec 21, 2016, at 08:53 AM, Kent Davis wrote:
>> I'm not certain, but based on when wireless comes up, I think it runs
>> towards the end of the boot process.
>>
>
> I mean rc.local.  Can I put some instruction in there and make sure it is 
> performed at the very end of startup?

-- 
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/CADbtXuCHiN0tGHGcsgBEs%2B8%2BZum-8Luzo%2Bcf6h3z5vezb%2ByQ3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Re: Qubes and Broadcom BCM4360 - A Success Story

2016-12-21 Thread Dave Cohen


On Wed, Dec 21, 2016, at 08:53 AM, Kent Davis wrote:
> I'm not certain, but based on when wireless comes up, I think it runs
> towards the end of the boot process.
> 

I mean rc.local.  Can I put some instruction in there and make sure it is 
performed at the very end of startup?

-- 
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/1482339516.4028111.826120297.211DB97F%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Re: Qubes and Broadcom BCM4360 - A Success Story

2016-12-21 Thread Kent Davis
I'm not certain, but based on when wireless comes up, I think it runs
towards the end of the boot process.

On Wed, Dec 21, 2016 at 9:52 AM, Dave C  wrote:
> On Wednesday, December 21, 2016 at 8:47:49 AM UTC-8, Kent Davis wrote:
>> My solution involves directly modifying the sys-net VM and I handle
>> all the modules in sys-net:/rw/config/rc.local.
>>
>> Is your rc.local executable?
>>
>
> 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
>
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "qubes-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/qubes-users/VVwWqvz5dX4/unsubscribe.
> To unsubscribe from this group and all its topics, 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/ee19bba7-99dc-4b65-ba66-8f09d9ef588f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/CADbtXuCaxtU9XW--HoYEXfnUJ7hNS%2B4FGNLrZoOrjsbYPXth%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Re: Qubes and Broadcom BCM4360 - A Success Story

2016-12-21 Thread Dave C
On Wednesday, December 21, 2016 at 8:47:49 AM UTC-8, Kent Davis wrote:
> My solution involves directly modifying the sys-net VM and I handle
> all the modules in sys-net:/rw/config/rc.local.
> 
> Is your rc.local executable?
> 

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

-- 
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/ee19bba7-99dc-4b65-ba66-8f09d9ef588f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [qubes-users] Re: Qubes and Broadcom BCM4360 - A Success Story

2016-12-21 Thread Kent Davis
My solution involves directly modifying the sys-net VM and I handle
all the modules in sys-net:/rw/config/rc.local.

Is your rc.local executable?

On Wed, Dec 21, 2016 at 9:37 AM, Dave C  wrote:
> 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 ":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 a topic in the Google 
> Groups "qubes-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/qubes-users/VVwWqvz5dX4/unsubscribe.
> To unsubscribe from this group and all its topics, 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 
> 

[qubes-users] Re: Qubes and Broadcom BCM4360 - A Success Story

2016-12-21 Thread Dave C
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 ":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.