Hi All, My question is directed at those with kernel compiling experience.
I have a driver source xxxxx.c file and a Makefile with it. I want to recompile the kernel to include the driver and rebuild the initrd.img. Where do I copy the file in the kernel sources? I currently have it in a sub folder of the drivers directory in the kernel source folder. There is one more question if I may, it does not have a xxxx.h (header file) do I need it? The driver does compile perfectly without it. But I am not sure if I need to compile it into the kernel?
[cid:image001.jpg@01C9F4CF.43AAE290]http://www.pinnacle.co.za/
Chadley Wilson | Research and Development Engineer Research and Development | Pinnacle Micro
Direct: +27-11-265-3020 | Fax: +27-11-265-3277
chadley@pinnacle.co.za www.pinnacle.co.zahttp://www.pinnacle.co.za/ Proline Computershttp://www.pinnacle.co.za/proline/ | AMDhttp://www.pinnacle.co.za/hardware/products/?brand=28 | Apacerhttp://www.pinnacle.co.za/hardware/products/?brand=29 | Canonhttp://www.pinnacle.co.za/canon/ | Dicotahttp://www.pinnacle.co.za/hardware/products/?brand=67 | D-Link http://www.pinnacle.co.za/networking/products/?brand=37 | Hauppauge!http://www.pinnacle.co.za/hardware/products/?brand=69 | Hitachihttp://www.pinnacle.co.za/ | IBMhttp://www.pinnacle.co.za/ | Intelhttp://www.pinnacle.co.za/hardware/products/?brand=27 HPhttp://www.pinnacle.co.za/systems/ | Lenovohttp://www.pinnacle.co.za/hardware/products/?brand=34 | Lexmarkhttp://www.pinnacle.co.za/imaging/ | LGhttp://www.pinnacle.co.za/hardware/products/?brand=34 | Logitechhttp://www.pinnacle.co.za/hardware/products/?brand=12 | Mapowerhttp://www.pinnacle.co.za/ | Microsofthttp://www.pinnacle.co.za/hardware/products/?brand=15 | MSIhttp://www.pinnacle.co.za/hardware/products/?brand=26 | RiDATAhttp://www.pinnacle.co.za/ridata/ | Samsunghttp://www.pinnacle.co.za/pos/products/?brand=56 | Senaohttp://www.pinnacle.co.za/hardware/products/?brand=95 | Sonyhttp://www.pinnacle.co.za/hardware/products/?brand=30 | Spectra Logichttp://www.pinnacle.co.za/storage/products/?category=251&brand=63 Sunnixhttp://www.pinnacle.co.za/pos/products/?brand=71 | Super Microhttp://www.pinnacle.co.za/systems/products/?category=224 | Symantechttp://www.pinnacle.co.za/ | Motorola/Symbolhttp://www.pinnacle.co.za/symbol/ | Western Digitalhttp://www.pinnacle.co.za/hardware/products/?brand=31 | Zebexhttp://www.pinnacle.co.za/pos/products/?brand=73 | Zebrahttp://www.pinnacle.co.za/pos/ Electronic Communications Disclaimerhttp://www.pinnacle.co.za/general/terms.asp
(c) 2008 Pinnacle Micro
________________________________ Pinnacle Technology Holdings E-Mail Disclaimer:
This e-mail is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Pinnacle Technology Holdings any of it's divisions or affiliates. If you are not the intended recipient, be advised that you have this e-mail in error and that any use, dissemination, forwarding, printing, or copying of it is strictly prohibited.
Hi,
On Wed, Jun 24, 2009 at 07:29, Chadley Wilsonchadley@pinteq.co.za wrote:
I have a driver source xxxxx.c file and a Makefile with it. I want to recompile the kernel to include the driver
You may not need to recompile the kernel, instead compile your driver only. There are (extensive) instructions for how to do it here: http://wiki.centos.org/HowTos/BuildingKernelModules
If building the driver without adding it to the kernel does not work, and you really think you should build a new kernel package that includes the driver, see these instructions instead: http://wiki.centos.org/HowTos/Custom_Kernel
and rebuild the initrd.img.
This should be a matter of running "mkinitrd" with the right parameters. If you include a line for your driver in /etc/modprobe.conf it should be included in new initrd.imgs by default.
Where do I copy the file in the kernel sources? I currently have it in a sub folder of the drivers directory in the kernel source folder.
This would be usually said in the driver's documentation, but what you said implies there is none... If that works for you just go ahead...
There is one more question if I may, it does not have a xxxx.h (header file) do I need it? The driver does compile perfectly without it. But I am not sure if I need to compile it into the kernel?
I don't think it would be required.
By the way: when posting to this mailing list, please send e-mails with text only and not HTML. This is the first requirement in Guidelines for CentOS Mailing List, see this page: http://www.centos.org/modules/tinycontent/index.php?id=16. Your e-mails also include a silly disclaimer which I believe was already topic of discussion a little while ago. If you can't control HTML format, company logo image and disclaimer in your company's e-mail address, I strongly suggest that you get a free e-mail account (I use and recommend GMail) and subscribe to the lists using that address instead.
HTH, Filipe
|-----Original Message----- |From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf |Of Filipe Brandenburger |Sent: 24 June 2009 02:46 PM |To: CentOS mailing list |Subject: Re: [CentOS] Compile driver for new kernel rpm | |Hi, | |On Wed, Jun 24, 2009 at 07:29, Chadley Wilsonchadley@pinteq.co.za wrote: |> I have a driver source xxxxx.c file and a Makefile with it. |> I want to recompile the kernel to include the driver | |You may not need to recompile the kernel, instead compile your driver |only. There are (extensive) instructions for how to do it here: |http://wiki.centos.org/HowTos/BuildingKernelModules | |If building the driver without adding it to the kernel does not work, |and you really think you should build a new kernel package that |includes the driver, see these instructions instead: |http://wiki.centos.org/HowTos/Custom_Kernel | |> and rebuild the initrd.img. | |This should be a matter of running "mkinitrd" with the right |parameters. If you include a line for your driver in |/etc/modprobe.conf it should be included in new initrd.imgs by |default. | |> Where do I copy the file in the kernel sources? |> I currently have it in a sub folder of the drivers directory in the kernel |> source folder. | |This would be usually said in the driver's documentation, but what you |said implies there is none... If that works for you just go ahead... | |> There is one more question if I may, it does not have a xxxx.h (header |file) |> do I need it? The driver does compile perfectly without it. But I am not |> sure if I need to compile it into the kernel? | |I don't think it would be required. | |By the way: when posting to this mailing list, please send e-mails |with text only and not HTML. This is the first requirement in |Guidelines for CentOS Mailing List, see this page: |http://www.centos.org/modules/tinycontent/index.php?id=16. Your |e-mails also include a silly disclaimer which I believe was already |topic of discussion a little while ago. If you can't control HTML |format, company logo image and disclaimer in your company's e-mail |address, I strongly suggest that you get a free e-mail account (I use |and recommend GMail) and subscribe to the lists using that address |instead. | |HTH, |Filipe [CW] Thanks for the links Filipe, much appreciated.
to Tim, I had another thread where the scenario is that the centos boot disk does not include a critical ATA driver. We (the company where I work) are planning to distribute the discs with the computers we sell. So I need the driver included in the disc in the same fashion we do with our OEM Windows. The problem is that I can get the driver into the initrd.img and you can select it from the list when prompted for installation sources / load driver(select or disc). But this means we can't run the kickstart files from CD because before you can select your CD drivers, you must locate your ks.cfg file or cancel kickstart and load the driver. And I am unfortunately not in the position to be giving every customer a free flash drive to overcome the issue.
To get back to my main objective,
I know I am probably asking the question the wrong way here, but if I compile my driver, do I have to rebuild the kernel to put it in the initrd.img file? Or can I just run mkinitrd?
Kind regards Chadley
Pinnacle Technology Holdings E-Mail Disclaimer:
This e-mail is confidential and intended solely for the use of the individual(s) to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Pinnacle Technology Holdings any of it's divisions or affiliates. If you are not the intended recipient, be advised that you have this e-mail in error and that any use, dissemination, forwarding, printing, or copying of it is strictly prohibited.
Chadley Wilson wrote:
Thanks for the links Filipe, much appreciated.
to Tim, I had another thread where the scenario is that the centos boot disk does not include a critical ATA driver. We (the company where I work) are planning to distribute the discs with the computers we sell. So I need the driver included in the disc in the same fashion we do with our OEM Windows. The problem is that I can get the driver into the initrd.img and you can select it from the list when prompted for installation sources / load driver(select or disc). But this means we can't run the kickstart files from CD because before you can select your CD drivers, you must locate your ks.cfg file or cancel kickstart and load the driver. And I am unfortunately not in the position to be giving every customer a free flash drive to overcome the issue.
To get back to my main objective,
I know I am probably asking the question the wrong way here, but if I compile my driver, do I have to rebuild the kernel to put it in the initrd.img file? Or can I just run mkinitrd?
I frequently rebuild the kernel/installer - mainly to support NICs that are newer than the current CentOS release - as we do NFS installs - which require a working NIC driver to do the install :-)
Rebuilding a CentOS 5 install image is not hard - it basically involves having a copy of the whole distro on disk (with your updated RPMS), installing the anaconda-runtime RPM (plus a few other RPMS associated RPMS) and running /usr/lib/anaconda-runtime/buildinstall with various options to create the installer images.
I've never re-created a set of distro CDs/DVD - but I think that is also quite straight forward once you have an updated disto tree.
The difficult part is getting the additional and/or updated/patched drivers into the kernel you want to use - but the page at http://wiki.centos.org/HowTos/Custom_Kernel seems to cover that - but you really do need some spec file hacking and SRPM re-building knowledge ...
Feel free to contact me off list if you need further pointers
James Pearson