Saturday, October 08, 2011

WPA wireless in Haiku

I've been following the development of the Haiku OS for nearly four years now and still remain enthralled by it's lightening fast boot and its many other distinctive features.
Now, I've got Haiku working on my EeePC901 netbook with WPA2 wireless encryption and this is really another remarkable milestone in the evolution of this OS.
A week or so ago, the availability of wpa_supplicant on Haiku was announced here.
Unfortunately, I just couldn't get any of the nightlies from r42775 to r42804 to actually boot for me on the netbook as all of my attempts just ended up booting to a black screen from a usb-key.
Luckily I posted to the Haiku forum and found that others, too, had the same problem. Not only that but a solution was posted which worked well for me.
Nevertheless, while the solution suggests using a fail-safe video mode to boot the recalcitrant nightly from usb-key to a workable Desktop, none of available fail-safe video modes, even when additionally using full fail-safe mode, brought me to anything other than an unusable black screen.
Therefore, I booted to Haiku R1A3 on my E520 Desktop and mounted the live usb-key containing r42804 in read-write mode.
Then I copied /boot/system/add-ons/accelerants/intel_extreme.accelerant from R1A3 on the Desktop HD to /system/add-ons/accelerants/ on the usb-key thereby replacing the intel-extreme.accelerant in the r42804 nightly.
[Note that in the account given in the forum thread, I also replaced from haiku R1A3 the intel-extreme drivers in both /system/add-ons/kernel/drivers/bin/ and /system/add-ons/kernel/drivers/dev/graphics. However, this appears to be unnecessary as replacing only intel_extreme.accelerant is sufficient to get the usb-key to boot perfectly]
Now, the usb-key with the nightly booted perfectly on my netbook so that I was easily able to install the upgraded version of Haiku over Haiku R1A3 without prior partition initialization.
To fully restore everything I initially had on the R1A3, I just needed to install the optionalpackage webpositive which unexplainedly did not survive the upgrade.
Additionally, I had to add this line

/boot/home/config/be/"Desktop applets"/LaunchBox &
to /boot/home/config/boot/UserBootscript and then restore /boot/Synthetic/Synthetic and /boot/apps/freeSpace/freeSpace to the LaunchBox.
Now, with everything back to the way it was before upgrading the System, I was able to install the optionalpackage wpa_supplicant.
Then, after a reboot, I unplugged my ethernet cable and issue this command
ifconfig /dev/net/ralink2860/0 list
and found the two wifi networks in our house.
Then to get a connection, I issued this command
ifconfig /dev/net/ralink2860/0 join wifi_interface_name wifi_interface_password
and within seconds, I was connected to my local wpa2 encrypted wifi network.
One problem, however, is that Haiku, at present, does not remember previous wifi networks and the join command must be issued after every reboot.
However, this difficulty can be easily overcome by reating a small script as shown below:
#! /bin/bash
sleep 1
ifconfig /dev/net/ralink2860/0 join wifi_interface_name wifi_interface_password
which I called wifi_start and then adding the line
/boot/home/wifi_start &
to /boot/home/config/boot/UserBootscript which will then connect to the wifi at boot.

No comments:

Post a Comment