# Advice to install bwi driver on Mac without internet



## Dave109 (Nov 26, 2016)

I created a freebsd bootable memory stick for my mac from which i gened up a dual boot El captitan/freebsd.

My problem is the freebsd gen did not gen my wifi bwi driver. As the ethernet card in my mac is not attached to my home network, to continue the bwi driver installation, bsd's pkg is just a slim program that uses the internet to haul in the wifi driver from the internet as a package and i believe to create the package repository etc.

So i am stuck to complete freebsd install on my mac. ugh ;{
I need to have the internet to do some debugging using dtrace.
Apple has closed down this capability in El Capitan. What remains is just useless --- no user scripts allowed, dtrace probes disabled, and sip just casting its authority to not allow this debugging to be done.

Question: Can i use the full dvd iso image download (just as a file system) and place it on the memory stick but not as a bootable device? Bsd was installed from the memory stick.
The problem is Apple and its dvd device does not create a bootable dvd.

Unetbootin does not create a bootable memory stick for the mac --- probably due to efi partition required.
(ie the memory stick will not be seen by the mac as bootable at start up time)
The efi freebsd img put onto a memory stick created by my mac/el captitan works; this required creating a fat32 disk with a efi partition. I commented on this previously that it is doable and works.
Unfortunately the efi bsd image is a slim requiring internet to import other capabilities.

By creating the memory stick iso without the boot capability(just a file system) from the dvd iso, i believe i should be able to mount it on my freebsd system and copy appropriate files to bsd disk.
And then complete the driver install locally rather than have pkg going out thru my internet which at the moment is nonexistent.

Does this look possible for pkg to run locally by copying appropriate package files to my freebsd master disk?
If so, where can i find the appropriate steps needed to get the packages placed for pkg to do it thing locally from the master disk?

Thank you for considering this request
dave


----------



## ANOKNUSA (Nov 26, 2016)

First, let's clear a couple things up, since there seems to be some confusion about all this:

What is "freebsd gen?" I've never heard that term before.
The regular *-memstick.img installation images don't require a network connection to install FreeBSD. So I'm guessing what you're saying---the actual problem you're having with the installation---is that the installer does not automatically detect your wireless card, and you believe you need to install the wireless driver from the Internet, which you can't do without a wireless connection, which you can't have without the driver...
The installer probably did not pick up on your wireless card because the bwi(4) driver is not available in the GENERIC (default) kernel (assuming your NIC model is supported by that driver). On top of that, the driver is not available in the ports tree, only the firmware is available. And that falls under a restrictive license, so there's no package for it anyway. Your only real option, then, is to install FreeBSD as normal using the memstick.img, and _include the source tree in your install_. Once you've installed you'll need to need to build a custom kernel that includes the bwi(4) driver. This is much easier than you might think; it's more time-consuming than difficult. Hopefully that will let FreeBSD detect your wireless card, and you can move on to configuring the network.


----------



## tobik@ (Nov 26, 2016)

ANOKNUSA said:


> Once you've installed you'll need to need to build a custom kernel that includes the bwi(4) driver. This is much easier than you might think; it's more time-consuming than difficult


That's not necessary. bwi(4) is available as a kernel module. As you said, what's missing is the firmware from net/bwi-firmware-kmod which is not part of the FreeBSD source tree and also not available as a package unfortunately. (I never understood why. OpenBSD has firmware packages for Broadcom cards on http://firmware.openbsd.org, so distributing them seems to be allowed.)

Dave109
Is there really no way to temporarily connect the Mac to an Ethernet network? Does your AP/router not have an extra Ethernet port? Or maybe bridge from another computer?

As a last resort I would do this:

Install FreeBSD in a VM
Grab a copy of the ports tree
Run `make -C /usr/ports/net/bwi-firmware-kmod install`
Copy /boot/modules/bwi_v3_ucode.ko to your memory stick ...
... then copy it to /boot/modules/ on your Mac.
One `kldload if_bwi` later you should be ready to configure everything according to https://www.freebsd.org/doc/handbook/network-wireless.html


----------



## Dave109 (Nov 27, 2016)

I thank you  both for your responses.
This is my first attempt to create a dual boot system on my Macpro and I apologize in how I phrased the problem. My terminology probably goes back before u where born Anoknusa.
Freebsd was chosen for its dtrace capabilities.

I will try to attach to my router / ethernet port to redo the freebsd install.
It's a pain-in-the-??? due to its physical location but seems to be the easiest of the 2 solutions: re VM as my mac has very limited resources: 4 gigabytes only and not sure what vm will support this run environment.

If I understand Tobik's answer, the dvd iso solution proposed by me wont work as it also does not have the missing broadband firmware and I still need to use the internet anyway to complete the installation.
I tried the ``make install'' above and its aborted log showed its attempt to go out using the internet by pkg to fetch the firmware.
This is what prompted my original post/ask for help.

I will keep u posted.
Dave


----------



## tobik@ (Nov 27, 2016)

.





Dave109 said:


> If I understand Tobik's answer, the dvd iso solution proposed by me wont work as it also does not have the missing broadband firmware and I still need to use the internet anyway to complete the installation.


Yes.



Dave109 said:


> I tried the ``make install'' above and its aborted log showed its attempt to go out using the internet by pkg to fetch the firmware.


You misunderstood me here. `make install` in your FreeBSD installation which doesn't have a network connection doesn't make any sense. That's why I suggested installing FreeBSD in a VM first. I assumed that the VM has a network connection via the host. Let the port do its thing, afterwards copy the firmware to a memory stick. 4 GB on the host is more than enough to do this. FreeBSD runs fine on VirtualBox for example.

Attaching the Mac to your router directly is still easier anyway.


----------



## Dave109 (Nov 27, 2016)

Hi Tobik,
I agree to your suggestions.
Off to buy an Ethernet cable to continue my journey.

Regarding  'make install', it was a comment about my first attempt installing the driver before I posted to this forum, and not a comment about your suggestions. As I am new to forums in general, I will be more careful in my postings and ramblings/contexts.

Your suggestions are well taken and I will be trying them out asap.
Dave


----------



## ANOKNUSA (Nov 27, 2016)

tobik said:


> That's not necessary. bwi(4) is available as a kernel module.



I somehow managed to overlook the name of the module (if_bwi) in the man page, and forgot that kernel config files only list what gets _built into_ the kernel, not the modules available. Thanks for the correction. That's the second bit of dumb advice I've offered this week. Sorry about that; my home office flooded on Thanksgiving day, so my head's not on straight.


----------



## Dave109 (Nov 27, 2016)

Hi Anoknusa,
Please do not deprecate your suggestions.
I appreciate the responses and the suggested learning steps within this journey.

This message is created by my Macpro Ethernet connection to the router as Tobik suggested.

So now my new journey begins.

Good luck with the plumbing. 
I know this is stressful as it happened to me in my home last Christmas day and I am not a plumber but an apprentice to learning by trial-and-error --- sounds like my Freebsd journey :}. 
I was lucky to control the broken pipe and even luckier that boxing day (26 Dec) had stores open at 1:00PM  allowing me to buy the supplies required (3 trips later). Just as I am doing for this port :} but in the same vein digitally.
Dave


----------



## Dave109 (Nov 29, 2016)

To Tobik and Anoknusa,
As the song
What a difference a day makes where u substitute day with ethernet cable
Now I'm pkging and doing the bsd walk :}
Thanks for your help
Dave


----------

