LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Ath9k Linux Driver Installation with source from linux kernels for 2.6.34 (https://www.linuxquestions.org/questions/linux-networking-3/ath9k-linux-driver-installation-with-source-from-linux-kernels-for-2-6-34-a-839854/)

CyclicFlux 10-22-2010 03:57 PM

Ath9k Linux Driver Installation with source from linux kernels for 2.6.34
 
I am relatively new and I have been using my official second linux distro to help fulfill a number of projects and I have had some trouble with understanding the wireless drivers. I am using backtrack 4 R1, and the reason was merely for the network and having many necessary networking dependencies already there. However I found that I am using a HAL for the ath9k and madwifi-ng drivers, thus I must patch the card and go through all of that.

The specific distribution I am using is Backtrack 4 R1 with KDE3 and ubuntu on the 2.6.34 kernel. I know I have through an update script found the wireless drivers and downloaded them, however all attempts to get it to fully work haven't helped. I checked the forums, and it doesn't seem like they consider it a backtrack specific question but a linux specific question. I performed hwinfo and it returns ath9k and the memory address, channels 1-14, wlan frequencies(2.412,2.417, 2.422, 2.427, 2.432, 2.437, 2.442, 2.447, 2.452, 2.457, 2.462, 2.467, 2.472, 2.484. I have all modes of encryption set.

I am using both ifconfig and iwconfig with a wicd frontend to access the network typically. Unfortunately I am only seeing a wlan0 and no ath0. Furthermore, I manually issue these commands I am doing so I set each aspect of the card up (i.e essid, channel, mtu, fragmentation, etc....).

Now I did shed some light upon this in the sense that I found out how to initialize the madwifi-ng hal abstraction layer via

'start airmon-ng wlan0'

and then it returns.....

mon0 ath9k py0 etc. etc. etc.( this isn't exact I am unfortunately not at my computer. But the device is then able to work, however I am not sure as to why I am not able to have the ath0 device in my wireless devices if indeed everything else appears to be ath0. I look forward to any help with this matter

soppy 10-23-2010 07:30 PM

I'm not exactly sure what network card you have, but the ath9k drivers are in the Linux Kernel cutting out the need for Madwifi unless you have one the specifically needs the HAL which only a handful do. You may need to recompile your kernel for these to be activated.
Head on over to your kernel source (if installed) and make sure you're in root.
Code:

cd /usr/src/linux
Then type in
Code:

make menuconfig
The Atheros Drivers options are found in
[Device Drivers] -> [Network Device Support] -> [Wireless LAN] -> [Atheros Wireless Cards]
Modulize your card, (if you're not sure, just do all 4 without debugging).
then type
Code:

make ; cp /usr/src/linux/arch/$yourarch/boot/bzImage /boot/vmlinuz-new
where $yourarch is the architecture of your computer. Mine is i686 yet it's found in the i386 directory. So mine is
Code:

make ; cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-new
From here, make an initrd with your new modules and add another option to your bootloader to boot into this new kernel and initrd, update your bootloader and reboot. Once it's turned back on, select the new kernel you chose and see if it works. Hopefully it does! :D If not, this is why we didn't over write the older kernel. If it doesn't work then there's no need to use these extra drivers and have them loaded into our precious memory.
Hope I helped my friend!

CyclicFlux 10-31-2010 02:30 AM

Hellz yeah boss I am soooo glad you responded!! I tried out everything and believe it worked properly. I unfortunately ran outta town and didn't have a computer with me. You provided some of the best information thus far and that is much appreciated!!!!

I had a couple of questions:
1. Whats the name of the file that it produces?
-I say this because half tired while performing ended up typing both commands(the last two) and entering them thinking that they were different, lol!!! So I feel like I got a lotta stuff floating around. I saw a few random kconfig files, and some other like temp files, etc....

2. If I do it twice does it cause any differences, extra modules to be loaded, etc....

3. How do I edit the initrd with new modules? If I reboot is it automatically done? Also, my intuition is telling me the initrd is in the /etc folder?

I appreciate your help and def. got propa respect for make menuconfig!!

soppy 10-31-2010 09:50 AM

Well thank you sir! Now to answer your questions:

1. The file that is produced is found in /usr/src/$youracrh/bzImage. This is your kernel that you just compiled. All we did was copy it into /boot, and rename it vmliunz-new. I'm guessing that since the second command worked your computer isn't of the 86_64 architecture? If you ran make again, all it did was overwrite this file. If you want to clean it all up, just cd back into your /usr/src/linux folder and run
Code:

make clean
That'll get rid of all the .o files from the compilation and what not.

2. Since you didn't actually install any modules or change the source no. Everything is held within the kernel.

3. The initrd is created in you /boot folder by manually invoking mkinitrd. I don't believe backtrack has this by default, but you can downlaod mkinitrd from here http://carroll.cac.psu.edu/pub/linux...4.5-i486-2.txz and run as root
Code:

installpkg /path/to/download/mkinitrd-1.4.5-1486-2.txz
I'm pretty sure that'll work on Backtrack beacuse it is based on Slackware. If it not, you can run
Code:

tar xvJf mkinitrd-1.4.5-1486-2.tar.xz /
rm -rf /install

This will also install it, but I would prefer installpkg.
Now, cd into /boot nad run
Code:

mkinitrd -c -k 2.6.34 -m $YOURFILESYSTEM
replacing $YOURFILESYSTEM with what your filesystem is (ex. ext4, ext3, reiserfs etc) This will create a initrd.gz in /boot. Add this to your bootloader in the entry you wish it to be in after your kernel name:
LILO:
Code:

initrd = /boot/initrd.gz
GRUB:
Code:

initrd /boot/initrd.gz
Mine currently looks like
Code:

image = /boot/vmlinuz-new
  root = /dev/sda2
  initrd = /boot/initrd.gz
  label = Slack-current
  read-only

After this reboot and all is done!!

CyclicFlux 10-31-2010 06:45 PM

Thanks again bud, I am going to be trying this out shortly. It looks like its going to work. I was thinking that 'make clean' would do it but wasn't sure. Now I have seen mad initrd files all over BT4 R1. But I before downloading it am going to try the mkinitrd command just to check it all out first. But I'll let you know how it all goes, and I am not entirely sure if Backtrack is currently based of slacks. I think this may have changed when they combined their WHAX software with Max Moser's Auditor. Not gonna lie though I have no idea what slacks is, aside from it being a linux distro. I do know that I had read that it is based on debian and ubuntu with KDE3.5.

soppy 10-31-2010 06:58 PM

I think you mean Slax which is an unofficial live-cd of Slackware. It was my first preview into the Linux world. :D Regardless, mkinitrd is platform independent so it should work.


All times are GMT -5. The time now is 05:44 PM.