LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-05-2012, 06:49 AM   #1
beyefendi
LQ Newbie
 
Registered: Jan 2011
Posts: 7

Rep: Reputation: 0
How to compile a custom ata driver ?


Hello,

I have a patched libata-eh.c file. But I don't know how to compile a custom ata driver with it. Can anyone help me ?

Thanks.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-07-2012, 05:36 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
ata drivers are typically part of the kernel and not separate modules, since they are needed to boot.
So you need to build a kernel. You should follow a tutorial on the net for the details, but I'll list some important points:

1) download and install the kernel source package for your distro.
You'll now have kernel source in some place like '/usr/src/linux' so cd there.
2) Save your original source file
cp drivers/ata/libata-eh.c drivers/ata/libata-eh.c.orig
3) apply your patch to drivers/ata/libata-eh.c
4) You should have the right .config file in the source directory for your distro.
cp .config .config.orig
The only thing you want to change is EXTRAVERSION so it doesn't clobber your existing kernel when you install it.
make menuconfig
Local version - append to kernel release <== set this to something like '-LIBATA'
5) make all; make modules_install ; make install

Verify that you have your new kernel, initramfs, and system map in /boot and your modules under /lib/modules/something-LIBATA/
Now boot up and select your new kernel in the grub prompt. It will be the one that says '-LIBATA'
You can always go back to the old one (the one without LIBATA).
 
2 members found this post helpful.
Old 05-09-2012, 04:59 AM   #3
beyefendi
LQ Newbie
 
Registered: Jan 2011
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks, I hope I can do it
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
driver development: usbhid is blocking custom device driver beetleskin Programming 9 11-19-2013 09:04 AM
cannot compile nvidia driver 177.82 with custom 2.6.30.5 tramni1980 Slackware 8 08-22-2009 12:31 PM
how to compile a custom driver in ubuntu madhusudana Ubuntu 12 07-04-2007 11:52 AM
help. ATA/SCSI Serial-ATA error: "ATA: Abnormal Status" xin Linux - Hardware 10 09-05-2003 10:59 PM
Problems trying to compile custom ATI binary driver guerilla fighta Linux - Software 0 02-13-2003 04:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration