Carbider | 18 September, 2007 13:14
Last week I asked Kostya to install Fedora 7 and BlueZ. We have a big pile of parts so when ever
we need some cheesy unix box (no xwindows etc) we just make one from the parts lying around.
Kostya is fresh out of college and hadn't really worked on UNIX that much, if at all, so, I figured
I'd go ahead and work on the same task and play with it a bit.
The last thing I wanted to do is get into a big argument with the programmers in the office
as to which *nix is better, besides, the whole idea was a simple machine that might work like
an out of the box bluetooth NAP, with the addition of radius.
My project was a $200-300 machine, booting from USB flash, no monitor, running BlueZ and SLAX http://www.slax.org.
If you haven't checked out SLAX, check it out. I have a couple machines in the office that run it, burn an ISO,
pop it in the CDrom and wala you are rolling.
If you unpack that ISO onto a USB MSD, then write the boot sector using a utility called syslinux, you can
do without the cdrom and boot right from USB with a motherboard that supports it.
pretty cool eh?
In one of my emails to Kevin, I wrote that I started working on the NAP side to which he replied
"Hey post about it" mentioning that the road there is often as interesting as the destination and
part of the S2F blogs nature is the public display of trials and tribulations in the process of development.
More likely this will be a post on how not to develop.
So, down to the store for some parts, I'd need a motherboard (FOXCONN WINFAST), memory (256), a CPU(AMD SEMPERON),
and some cheesy case w/ PSU. Grand total $150 or so in the local currrency.
I took the base installation of SLAX as my starting point, I figured what i'd wind up with in the end of it
all was a machine that would only be accessed via telnet and never rebooted. With Bluetooth, figure you can
connect any 7 devices so I was hoping that the machine I built would be enough.
Downloaded SLAX, unpacked it, installed it, sys'ed it and set the bios up for booting from USB. This should have given
me a nice little UNIX environment that would let me configure a little OS that I could later pack back into an
ISO and distribute as a bootable CD or use in a virtual machine (like virtual box).
SLAX uses a UNION file System, located in ramdisk. All the changed you make are saved to a second file system
and before you shut the system down, you can issue the command 'configsave' which takes all your changes and
puts them in a special module file. Next time you boot, SLAX looks for this file in the root directory of all
your mounted drives and if it fonds it, loads it. Alternatively, you can save the file to the /modules directory
and have it loaded during boot.
http://pendrivelinux.com is a good site for reference.
everything up to this point was as advertised.
You can make a module by installing software, then saving the changes. BlueZ, the Official Linux Bluetooth stack
has a module, so I used it, there were a few dependancies and some functionality added by these modules:
blueproxy_1_13.mo
Bluetooth_1_1.mo
bluez_mo_1_0.mo
dbus_0_61.mo
gtk_2_10_6_i386.mo
PyGTK_2_6_2.mo
Python_2_4_3.mo
All of which you can get on the get on the SLAX repository.
The PIN helper application complained a bit about not finding a library, got around that with
'ln /usr/lib/libbluetooth.so.1.0.25 /usr/liblibbluetooth.so.2'
BNEP is loaded in the kernel at runtime with
' modprobe bnep '
which I stuck in /etc/rc.local along with
' hciconfig hci0 up '
which turns on the USB Bluetooth DOngle and the service discovery protocol deamon
' sdpd '
and last but not least
' pand --listen --role NAP '
http://bluez.sourceforge.net/contrib/HOWTO-PAN is a good link for explaining the actual workings.
so far so good, I could see the SLAX machines from a windows notebook, SDP returned the existence of a NAP but when I tried to pair, nothing,.. a long timeout.
Tried switching the PIN helper but that didn't seem to do much and further investigation revealed it was looking for x windows and couldn't open a window so it died.
There is another version SLAX with X windows, but by the time I tried to connect with the new SLAX it seems my windows had been poisened with ad information or something, Couldn't ever get a connect from my notbook although from other machines, it connected but failed to give an IP address. I hadn't actually considered the system fully configured, DHCP hadn't been turned on for BNEP0 nor had I set up any hotplug scripts yet.
Prior to this, I had been booting the machine pretty regularly, changing the config, saving a module and rebooting to ensure the changes I made where being included in the regular boot. With the advent of a connection and the knowledge that's need to script hotplug for the devices, I went to lunch. Upon return - the machine had hung. Completely dead, no signs of life, and since everything is going on it a ramdisk, nothing to read later after a hard boot to give clues as to what had actually happened.
Futher testing showed that the machine would hang regularly, often within an hour. Not very interesting for our purposes since a big part of the idea to set up the whole thing from boot to operation on a "diskless" system was to make it somewhat "foolproof" and reliable. Download, make a flash, or boot the ISO in a virtual machine.
My first though was maybe the whole boot from a flash idea wasn't the best way.. Second thought was maybe SLAX wasn't the best solution, I grabbed the machine, grabbed a copy of Fedora-7-i386-DVD.ISO and went home figured I'd have a project for the weekend, back in the office Monday to show my tricks to the boys.
Back to the computer store, to pick up a hard drive to install Fedora on. Once you get a Linux installation you want, you can use the Linux Live scripts to make a ISO and that was my plan. ( http://www.linux-live.org/ )
I burned a DVD with the ISO I had, installed the hardrive and a DVD in my "diskless" machine" and set off to install.
" INSERT BOOT DISK and PRESS ENTER "
Hmm, read the forums - "Me too! and me, and me too" I wasn't the only one not booting from the Fedora ISO, yet most of the suggestions where along the lines "probably a bad disk try to burn another one" or "you should stop smoking crack and try again"
After 3 attempts on 2 different burners I finally figured out the software I was using was not writing the El Torito boot system in sector 17 of the last session of the ISO.
4th time was a charm, downloaded deepburner pro, it worked fine.
Fedora wants some memory for it's GUI setup, with 256 MBs it whined and gave me text mode - fine with me, I didn't grab a mouse anyways. Obviously not your father's UNIX.
A quick run through the standard options, pick a keyboard, pick a language, config your NIC, give a name and slice your disk into partitions. I didn't really expect to use 500 GB, I just wanted a big disk for my music collection later. I broke the disk up, gave myself 100 mb and mounted /boot there, and another 5 GB on / and 300 MB for swap.
The system complained I didn't have enough ram and asked if it was alright if it turned on swap right away. I was suprised actually, gee, I didn't want X windows and didn't realy expect the text based installation to be memory intensive. I clicked YES, and the set up went on execute the changes to the partition and format the disk.
46% through the format, I got a red screen with a bunch of garbage and the hard drive was making terrible noises.
Hmm, ok, reboot, do it all again, this time, let it take the defaults for the partitions. No luck, same red screen, same 46%.
A friend of mine who had stopped watched the machine booting said, Gee, "how can you read that fast" I chuckled and answered "That's why we make the big money. When he saw the red screen with all the garbage he asked, "how can anyone understand what that means?"
By now the Seagate Barracuda 500GB SATA hard drive was making chirping and cracking sounds as if it was about to explode. I answered my friend, "it means the drive is dead"
I figured i'd found a bad sector and the OS wasn't dealing with it. Google noisy seagate and saw quite a bit about it, a few people had suggested adjusting some of the SMART settings, others just sent the drives back.
Figured try that on a fresh head (err) and a another hard drive. "Vodka - Connecting people" was the motto for the rest of the night as I left my cyber endevors for the evening. The next morning I went down the the computer store and picked a $50 samsung 80G SATA drive. Nope, same red screen at 46%.
By now, my cheesy $150 machine was already in the $500 range and things still didn't look any better. Checked the net for bios updates and when I couldn't find any I becames convinced I had been stuck with a cheap immitation chinese motherboard.
Back to the computer store. ANother motherboard (ASUS), 512 MB of RAM, and promises that the board would boot from USB. Tried the Seagate, still chirped. tried to boot from USB, nope, and settled in on the 80 GB drive.
Back to square one. I'm going to still try to do it on SLAX, get the smallest ISO I can, and go from there. I learned some lessons:
* Never trust a salesman, I don't care if the guy says the machine will boot from USB, "Prove it" will be my answer.
* If your UNIX is flaking out, you can probably get it to fit on your system, recompile the kernel, nifty boot tricks etc,.. but why mess with it. My mistake was trying to get everything under a couple hundred bucks and picking a less than friendly motherboard in the process.
* SLAX is plenty stable, if you boot it on a decent machine.
* If your weekend project lasts until Thursday you are doing something wrong.
* Even if you have been working on UNIX since 1989 you'll never know it all and sometimes the only way you'll find out is by actually doing it. UNIX is amazing, it's like you can do anything.
I wouldn't write that it was a complete loss. I know everything that needs to be done and how to do it. I don't have the biggest choice of parts here in Ukraine, so, I'm going to spend a little time shopping around for a decent motherboard and I'm going to try again when I find it. BTW, the CHillispot.org site is down, and has been for at least 2 weeks, anyone that has any suggestions for another NAS, please let me know. with so many WiFi Hotspots using it, I'm hard pressed to believe that project is dead.
Ohh and if you have read this far, please save the internet at http://www.savetheinternet.org You really have to wonder what will happen to the open source world if you and millions like you don't do something to keep the internet free. Thanks in Advance.
Kevin thought it would be interesting to know the behind the scenes, if S2F blogs where about the HOW-to's of development - let this be a how-not-to :)
David Stickney
Fishnest Ukraine
Konstantine Voytenko
BluSPAN project coordinator
Fishnest Ltd.
bluspan@gmail.com
RDF Facets:
qfnZtopicQUqfnTopicZconnectivityQ
qfnZtopicQUqfnTopicZtestingQ
qfnZtypeQUqfnTypeZBlogContentQ
qfnZtypeQUqfnTypeZBlogE45ntryQ
qfnZtypeQUqfnTypeZCommunityContentQ
qfnZtypeQUqfnTypeZWebpageQ
qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX
Re: The Battle for BlueZ
savago | 20/09/2007, 23:54
Ah... the joys of *nix installing. Sometimes is just plain simple, sometimes is just plainly impossible. At least everything turned fine in the end.
One year ago, I was trying to install FreeBSD 6.1 in my personal notebook. But for some reason, after booting, the computer always *just* turned off! Probing in the problem I discovered a ACPI/APCI bug report with the manufacturer mapping of multimedia keys that triggered the notebook to turn off. The fix was to set some boot parameters.
A quick tip: you can have multiple libraries versions across you system. The loader seeks for libraries reading the environment variable LD_LIBRARY_PATH (you can just append more directories by running 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local:/usr/lib').
It is a safer and more flexible way to solve library issues than using hard links (which breaks when you decide to do some upgrades in software components of system).
Best regards
Adenilson