View Full Version : How to add executable files to kernel package?
27th June 2011, 05:54 PM
Dear forum members,
I'm having some fun playing with building and using custom Kernel for Fedora 15. I can successfully download and build custom kernels following the instructions at:
But I want to add two executable files on /usr/bin that are related to kernel modifications I made.
How can I add source files to the BUILD tree, compile it, and have the executable files added to custom kernel RPM package I generate when:
# rpmbuild -bb --with baseonly --without debuginfo --target=`uname -m` kernel.spec
1st July 2011, 12:56 AM
That comes off as a really strange post. If you are a good enough developer to be hacking the kernel you wouldn't need to ask the question. If you need to ask the question you can't bee good enough to be hacking the kernel. Maybe if you gave some more info on what the application does it could help.
The best way to communicate with the kernel is to write a driver to allow you to do it. The O'Rielly device drivers book shows you how to write a bare bones driver in 10 lines of code. You just do an insmod to load it then. Then it shows up as a node in the /sys tree that you can read. To read and write takes more work but the book can help you out.
Have a look at chapter 2 over here.
1st July 2011, 02:53 AM
Thanks for the reply.
My question is about Makefiles and RPM spec file. It is not related to Kernel development...
I want to follow the instructions:
But I want to add two user land application that will be installed by the resulting kernel-*.rpm package.
I can compile my aplications by hand. And I'm quite sure that I can do another RPM package just for my two binary files, but I need some help on doing it on existing RPM.
1st July 2011, 03:55 PM
I'm not happy with english skills, so I'll try to give an example of what I want to achieve.
When I install the Kernel source RPM the files are placed at:
I'll make an folder inside that directory:
Then I'll place two source code there:
I want to know how to tell rpmbuild to compile those sources, put the resulting binary inside the Kernel RPM in a way that the binaries will be installed in /usr/bin.
4th July 2011, 05:01 PM
OK. That makes more sense. You should start with reading the Maximum RPM site. You can do almost any thing via the spec file. I would consider adding to your files to a separate source RPM then you can upgrade the kernel and just run rpmrebuild on your source RPM with out having to endlessly repackage.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.