Solved

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

Posted on 2004-09-20
18
428 Views
Last Modified: 2013-12-06
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.
0
Comment
Question by:beaker67
  • 9
  • 7
18 Comments
 
LVL 20

Expert Comment

by:Gns
ID: 12110258
> 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
0
 
LVL 2

Author Comment

by:beaker67
ID: 12122037
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.
0
 
LVL 2

Author Comment

by:beaker67
ID: 12122133
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.
0
 
LVL 20

Expert Comment

by:Gns
ID: 12137455
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
0
 
LVL 2

Author Comment

by:beaker67
ID: 12138687
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...
0
 
LVL 20

Expert Comment

by:Gns
ID: 12144991
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
0
 
LVL 2

Author Comment

by:beaker67
ID: 12149074
I've added those lines (they do look correct) but it doesn't do anything.
0
 
LVL 20

Expert Comment

by:Gns
ID: 12159461
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
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Author Comment

by:beaker67
ID: 12176426
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?
0
 
LVL 20

Accepted Solution

by:
Gns earned 250 total points
ID: 12188746
Rc-scripts are the scripts run by init during bootup (What "rc" really stands for is lost in time, with its roots in unix, but the general consensus is "Running Conditions":-). Also refered to as "init-scripts" due to the fact that the init proces (process #1, the first one started by the kernel) is responsible for running 'em.
There are generally two forms of these, depending on whether the init one is using is "SysV-ish" or "BSD-ish". LFS seems to be using a "SysV-ish" init... Just to show that loved children have many names, they refer to them as "boot scripts" which is OK, albeit (from my point of view:) slightly wrong.

Basically what you need do is do the network setup bit, but substitute ifconfig with iwconfig, eth0 with ath0 ... and generally !adjust" things that don't overlap well.
(I haven't looked (no time unfortunately), but you might need hack a bit in the relevant "boot script")

-- Glenn
0
 
LVL 2

Author Comment

by:beaker67
ID: 12223274
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?
0
 
LVL 2

Author Comment

by:beaker67
ID: 12223484
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...
0
 
LVL 2

Author Comment

by:beaker67
ID: 12233623
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.
0
 
LVL 20

Expert Comment

by:Gns
ID: 12274116
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
0
 
LVL 2

Author Comment

by:beaker67
ID: 12279865
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.
0
 
LVL 20

Expert Comment

by:Gns
ID: 12307523
Eh, one wonders what "magic tools" YaST would employ then:-). Unfortunately SuSE is scarce at "my end".

-- Glenn
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now