Archive

Posts Tagged ‘FreeBSD’

FreeBSD 7.0 – Wireless Encyption With WPA-PSK

October 23rd, 2008 1 comment

Why is it that wireless is the “killer-app” of hardware on the *NIX platforms?  I remember spending hours and hours getting it working via ndiswrapper on Ubuntu back in the day.  Luckily its simple to get working in FreeBSD 7.0, and adding WPA encryption is just a few more steps.

Here I’ll outline what I’ve added to get WPA-PSK working on FreeBSD 7.0 on my Dell Latitude D630.

First, if you are not using the default GENERIC kernel you’ll need to load some encryption modules.

You’ll want to load the following by adding the lines to your /boot/loader.conf:

wlan_ccmp_load=”YES”
wlan_tkip_load=”YES”
wlan_wep_load=”YES”
wlan_xauth_load=”YES”
wlan_acl_load=”YES”

If you are using the default GENERIC kernel these are already included so you can skip right on to the next step.

You’ll need to configure wpa_supplicant with your ssid, key type and pre-shared key.  This is an example of what my config looks like using WPA-PSK from my netgear wireless router:

network={
ssid=”ssid-name”
key_mgmt=WPA-PSK
psk=”pre-shared-key”
}

I also added this line to my /etc/rc.conf to automate the connection process:

ifconfig_wpi0=”WPA DHCP”

Hope it works for you as well.  Good luck!

Categories: FreeBSD Tags: , , ,

FreeBSD 7.0 – Finding and Loading the Correct Sound Driver

October 22nd, 2008 1 comment

After getting my desktop setup (following these steps) I realized that I didn’t have working sound.  It took me a bit of digging around and help from IRC to find out how.  I hope to make this a bit easier for others by getting it on the web and into the infinite wisdom of Google.

First of all you need to find the right module.  The method that I used initially was a bit of a shotgun approach, but it ended up telling me the right module in the end.

If you’re coming from Linux you might be familiar with the ‘modprobe’ tool for adding and removing modules from your kernel.  In FreeBSD this tool is ‘kldload’.  So, what we’ll do is load the ‘snd_driver’ module, which will end up telling us which one.  This may take some time and your machine may be unresponsive for a few moments.  Don’t panic (…unless, of course, it remains unresponsive for more than five-minutes).

kldload snd_driver

cat /dev/sndstat

On my machine I get the following output, which tells me I should use the ‘snd_hda’ module.

FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
Installed devices:
pcm0: <Intel 82801H High Definition Audio Controller> at memory 0xf6dfc000 irq 21 kld snd_hda [20071129_0050] [MPSAFE] (1p:1v/1r:1v channels duplex default)

To autoload this module at boot time you’ll want to add the module to your /boot/loader.conf file:

snd_hda_load=”YES”

If your output reports a different module the syntax is still the same.  module_name_load=”YES”

Unfortunately, on the D630 and D830, this only activates sound from the headphones but not the built in speakers.  A workaround(?) that I found was to add another line to activate the built in speakers.  The following line goes in your /boot/device.hints file.

hint.pcm.0.config=”gpio0,gpio1,gpio2,gpio3,gpio4,gpio5,gpio6,gpio7″

note: I don’t know which of the gpioX values actually does the trick, but leaving all of them in doesn’t seem to negatively affect anything.  If anyone knows which value(s) actually does the job I’d appreciate the help.  (I haven’t had the time to try each one or a combination, followed by reboots, to test.)

Categories: FreeBSD Tags: , , , ,

FreeBSD 7.0 – Update The Boot Delay (Faster Boot)

October 21st, 2008 No comments

By default FreeBSD sets a ten second delay during the boot process allowing the user to select alternate boot options.  Options such as single user mode, recovery, etc.  If you’d like to change this boot delay to something more reasonable you can add the following to your /boot/loader.conf:

autoboot_delay=X

I’ve set mine to two seconds (autoboot_delay=2) as I feel that is reasonable to give me time if I need it, but not sit and count down if I don’t.  If you’d like to bypass this menu altogether you can set the value to “-1″.

Categories: FreeBSD Tags: ,

Putting Beastie Back In The Boot Menu

October 20th, 2008 No comments

If you’ve used FreeBSD in the past you’re likely familiar with the mascot, Beastie.  In the past Beastie was part of the boot menu, but recently he was replaced with a simple FREEBSD text image.  To put Beastie back in the menu you can add the following to your /boot/loader.conf:

loader_logo=”beastiebw”

Next time you reboot you’ll see something a little more fun than the generic FreeBSD text.

Categories: FreeBSD Tags: , ,

Dell Latitude D630 – FreeBSD – Wireless (ipw3945)

October 19th, 2008 No comments

Activating the wireless on your Dell Latitude D630 is fairly easy. For whatever reason its not supported in the default generic kernel, but all it takes is adding a few lines to a config file. A added the following lines to the /boot/loader.conf:

if_wpi_load=”YES”
wlan_load=”YES”
wlan_amrr_load=”YES”
firmware_load=”YES”
wpifw_load=”YES”
legal.intel_wpi.license_ack=1

These steps are also outlined in the wpi man page (man wpi). It tells you exactly the lines that need to go into the /boot/loader.conf. So, if you ever happen to forget again, at least that much of the instructions are on your machine (assuming you have man pages installed.)

At this point you should be able to reboot and be able to use your wireless. I use the following commands to activate and connect to an access point:

ifconfig wpi0 up
ifconfig wpi0 list scan
ifconfig wpi0 ssid [broadcast ID]
dhclient wpi0

I’ve had good luck with the wireless so far, outside of a few times when the device seems to have just switched itself off. In those cases I simply repeat the above steps after issuing a “ifconfig wpi0 down”.

Categories: FreeBSD Tags: , ,

How To Install FreeBSD 7.x From USB

October 17th, 2008 12 comments

I have the horrible habit of not putting a label on a CD after I’ve burned it.  This leads to having a stack of CDs and not knowing which does what.  This was my problem recently when installing FreeBSD, so I decided to start using USB based installations where possible.  I prefer the multiple-write capability of USB, and this way I don’t waste CDs.

Step one is to download a modified unetbootin utility particularly for FreeBSD.  You can get .rpm, .deb, .exe or .sh for both 32 and 64bit here.  I went with the 32bit .sh file.  BE CAREFUL WITH THE PACKAGED VERSIONS AS IT SEEMS THEY DEFAULT TO WRITING TO YOUR LOCAL DISK!

Once you have the unetbootin utility downloaded you’ll want to write the data to your USB drive.  This is done using the command:

chmod +x unetbootin-freebsd70*.sh

./unetbootin-freebsd70*.sh installmode=usbdrive targetpartition=/dev/sdX1 formatpartition=yes|no

Be sure you know which /dev entry your USB drive is connected to and don’t overwrite your existing boot loader on your main disk.  The last option, “formatpartition” can be a yes or no.

This will take a minute, and when its done you should have a bootable FreeBSD 7.0 usb disk.  If you are able to do FTP based installation you’re ready to go at this point.

Now if you’d like to be able to do the full installation from the USB as well you’ll want to copy the contents of the .iso onto the same drive.  If you don’t have an .iso you can find one here.

To copy the contents of the .iso to the USB drive I did something like this:

sudo mount -o loop 7.0-RELEASE-i386-disc1.iso /mnt/

sudo mount /dev/sdX1 /media/disk (this should auto-mount if you re-plug the USB drive)

sudo cp -RvLu /mnt/* /media/disk/

When this is done you should have the contents of the FreeBSD install CD on your USB drive.  When prompted for the install type specify MSDOS partition and you’re set.

I will likely post some more FreeBSD tips based on more of my notes.

Categories: FreeBSD Tags: , ,