Link to home
Start Free TrialLog in
Avatar of beaker67
beaker67

asked on

Attempting an lfs (linux from scratch) installation - what do I do to use the wireless LAN?

I'm installing Linux from Scratch, and so far I've gotten up to installing inetutils - http://lfs.osuosl.org/lfs/view/stable/chapter06/inetutils.html - and I started wondering what I would have to do to get my wireless card working. I know when I tried installing Fedora Core (a few months ago) it didn't see my wireless card (an internal Atheros Wireless-g) so I downloaded a driver but had no idea what to do with the file I got. The problem was solved when I got SuSE 9.0 (now have 9.1) which recognized my wireless card immediately, but obviously I now have to figure out how to do that myself. How would I make sure it's recognized, and at what point would I do that? Would it need to be somewhere in the kernel configuration, or could I add it later?

It might be something I'll just find out through the course of installing everything, but I'm paranoid so I figure it's better to ask now.
Avatar of Gns
Gns

> Would it need to be somewhere in the kernel configuration, or could I add it later?
Yes and yes.
A driver is part of the kernel in linux, either compiled in or a dynamically loadable kernel module. If you compile the driver as a module, you'll be able to load it into the kernel whenever you like... And with the modern build system it's even rather easy to build/load drivers "after the fact".
I've not tried to find your specific package, so I cannot say what the driver can and cannot do, nor if it'll compile OK with a 2.4 or 2.6 kernel... There usually is some form of readme that details what you need to build it.
You'll need pretty much the same type of tools as for building an LFS anyway, so that shouldn't be a problem.
If you like, you could give us the link to the driver you found and (at least) I'll have a look.

When you have the driver you'll have to start worrying about getting the network bits right:-).

-- Glenn
Avatar of beaker67

ASKER

I found the driver and tried installing it as specified in the README  file - http://prdownloads.sourceforge.net/madwifi/madwifi-20030802.tgz?download

When I ran make, it said "clock skew detected - your build may be incomplete" - that doesn't happen for anything else. Is that bad?

Anyway, I ran make install and it seemed to work. I can't tell if it's being loaded at startup because the messages flash by too quickly. How can I tell if it's there? Anything else I might have to do?

BTW, I skipped over most of the network file configuration on LFS because a lot of it referred to stuff I didn't know about, like references to "eth0" - I wouldn't know what my wireless card would be called (it's "ath0" on my SuSE system). Also, what would I need to configure the wireless settings? The README for the wireless driver says it can be done with "iwconfig" but I don't have that on the lfs system.
Also, the LFS book section on the kernel says that if you have modules you should have a "/etc/modules.conf" file. I've looked at the suggested documentation but I can't find anything about it.
Ok, this is progress!
> ... "clock skew detected - your build may be incomplete"
Probably nothing to worry about, but to be sure, "touch" the Makefile(s)... and redo the make. Or check your date so that you're at least pretty close  (within a day or so:-) of the real time...;-).

> How can I tell if it's there?
"lsmod" is the command to use for that. You probably haven't set it to load automatically (since you ask about /etc/modules.conf), so to test things out you'd probably be best of doing the manual insmods as detailed in the README ("insmod wlan; insmod ath_hal; insmod ath_pci" or similar).
You could then check (with dmesg) that your card got detected and assinged as ath0 ...
Now, as essential as "ifconfig" is for regular NIC interfaces, iwconfig is for wlan dittos... As you are essentially building your own distro, it is up to you to include all tools needed... Go get the wlan toolset from http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html (and I'm sure you'll find enough expanations and examples there too).

BTW, are you building a 2.4 or 2.6 kernel? For 2.4 you'll need create/modify /etc/modules.conf to make the driver load automagically, with 2.6 it is the (very similar) /etc/modprobe.conf file. IIRC the former is documented in the modprobe manpage, in the latter it is in "man modprobe.conf". Wxctly what you need put in the file depends a bit on the kernel version.

-- Glenn
I've gotten some help from #lfs-support on IRC, but I'm still stuck. I believe the clock skew was due to the fact that I had compiled the kernel with my host system, which was set to local time, so the times on all of those files were "in the future". I recompiled the kernel under the lfs system itself (I needed to change some kernel config settings anyway), and the make for the wireless drivers worked flawlessly. I did make install and that worked as well, or at least it said so.

The driver still isn't being loaded at startup, at least I don't think so - I can't tell. When I run lsmod right after startup, nothing is listed. I know kernel modules in general do work though - I have ReiserFS support enabled as a module, and am able to easily mount /dev/hda2 (where my host SuSE system is) easily - *after* I do that, ReiserFS is listed under lsmod. I don't see any wireless driver files listed though, and iwconfig says it doesn't see any wireless devices. I can use insmod to load the driver files and then iwconfig says it does see "ath0". I tried changing settings, like the essid, but when I run iwconfig the changes don't stick. I took the advice of someone in IRC and added "commit" to the iwconfig command, but then I'm told the operation is not supported.

I'm using a 2.4 kernel. I've looked at the manpage for modules.conf, but can't seem to figure out what I'm supposed to do. Guess I'll look at it again and to figure it out...
Well, you'll need an
alias ath0 ath_pci
and probably something like
above ath_pci wlan ath_hal

Or something different. Let me know how it goes.

-- Glenn
I've added those lines (they do look correct) but it doesn't do anything.
Well, you need to add the iwconfig "stuff" to an rc-script too, just like you'd need setup a "normal" ethernet NIC via ifconfig. The alias is just there to load the modules automatically when needed.

-- Glenn
I screwed up something and had to start my lfs installation over again. Then, right after I finished, I screwed up again (I believe I messed up in fstab and told it to mount my lfs partition as "swap") and now have to rebuild again. After I finish this, hopefully I won't mess up again and should be able to continue trying to make my wireless work.

Anyway, what is an "rc-script"? Are you referring to an "ifconfig.ath0" file?
ASKER CERTIFIED SOLUTION
Avatar of Gns
Gns

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK, I've made partial progress. I at least have gotten to the point where ath0 is recognized at bootup and the modules are correctly loaded. I still can't configure anything though - every time I run iwconfig any settings I try to set don't stick. When I add the "commit" option I'm told it's not supported.

BTW, "NETDEV WATCHDOG" keeps telling me every 10 second that the transmit timed out. I'm pretty sure this has nothing to do with the problems I'm having (actually just a result) but it's really just telling me something I already know. Any way I can stop these messages?
I've verified that the wireless does in fact work - when I disabled the encryption on my wireless router, the wireless card automatically found it and was able to successfully ping it. Now I just need to figure out how to change the settings...
More progress made...

I was not able to access the internet before - I could ping my wireless router but that was it. I've installed dhcpcd and can now access the internet (with a text web browser...), but still only with the wireless encryption off, since I still can't change any wireless settings. Any attempt to run iwconfig accomplishes nothing - whenever I try to get the changes to stick (adding "commit" to the command) I'm told the operation is not supported.
Hm, how very irritating. Did SuSE allow it?
Anyway, great with the progress, only sorry I've been to busy lately to participate much... (Still am unrfotunately)

-- Glenn
No, SuSE won't let me change anything on the command line either - the only way SuSE will let me change anything is with YaST.
Eh, one wonders what "magic tools" YaST would employ then:-). Unfortunately SuSE is scarce at "my end".

-- Glenn