Hi,
I've built customs kernels from the SRPMs with the following:
rpmbuild -bp --target=i686 /path/to/spec cd /usr/src ln -s /usr/src/redhat/BUILD/kernel-x.y.z/linux-x.y.z linux cd linux make oldconfig make menuconfig make all make modules make modules_install
And it works just fine. The problem now is that I think installing that way isn't "cool": I wan to build my own custom kernel RPM/SRPM.
I thought about doing a "rpmbuild -bp" and change the options. Then a "rpmbuild -bc --short-circuit" and a "rpmbuild -bi --short-circuit".
What's the correct way of doing this?
Thanks in advance,
can you explain more in details the methos to do the sourcecode to then compiling a custom kernel. i get the kernel-2.6.9.22xxx.src.rpm from centos mirrors, i'd installed then edit spec (1 to build) then rpmbuild -ba --target=i686 /path/to/spec ( i want to know whay i have to do this if the only thing that i want its the source kernel) OK, at this time my pc was compiling 10 hours ( i dont know what are compiling and what for ?, i dont need any binary i need the kernel sources) 10 hours later i had a lot of rpm, one sources, same devel, an other , so i only want the sources so i did: rpm -ivh kernel-sourcecodexxxx.rpm , succesfully, but i dont get a "usr/src/linux-xxx" folder, why? , instead i get a folder in /usr/src/kernels/ with the number of the kernels sources ok, so i open this folder and did: mrproper , at the end its say that dont have the rule "xx" and if i do : make help, the list of rules broke at the rpm-pkg rule, and say the same : no rule "xx" what means that? somebody knows? or somebody have an explain method to do an correct kernel compilation from the x.src.rpm package , i would like that explain what for are each command and argument. thanks, i will wainting for some response.
lucho from argentina
----- Original Message ----- From: "Giovanni P. Tirloni" gpt@tirloni.org To: "CentOS mailing list" centos@centos.org Sent: Thursday, November 17, 2005 9:03 AM Subject: [CentOS] Custom kernel RPM/SRPM
Hi,
I've built customs kernels from the SRPMs with the following:
rpmbuild -bp --target=i686 /path/to/spec cd /usr/src ln -s /usr/src/redhat/BUILD/kernel-x.y.z/linux-x.y.z linux cd linux make oldconfig make menuconfig make all make modules make modules_install
And it works just fine. The problem now is that I think installing that way isn't "cool": I wan to build my own custom kernel RPM/SRPM.
I thought about doing a "rpmbuild -bp" and change the options. Then a "rpmbuild -bc --short-circuit" and a "rpmbuild -bi --short-circuit".
What's the correct way of doing this?
Thanks in advance,
-- Giovanni P. Tirloni http://blog.tirloni.org
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Luis Alejandro Cazzola wrote:
can you explain more in details the methos to do the sourcecode to then compiling a custom kernel.
You just want the source code ? Doing a rpm -ivh on the SRPM is enough.
You can symlink it from /usr/src/kernel/2.6.9-22 to /usr/src/linux. That simple or I didn't understand your question (or I'm wrong).
ok, i want the sourcescode with all the rhel pacths, i want to recompile the kernel to add reiserfs and ntfs support so? ----- Original Message ----- From: "Giovanni P. Tirloni" gpt@tirloni.org To: "CentOS mailing list" centos@centos.org Sent: Thursday, November 17, 2005 10:00 AM Subject: Re: [CentOS] Custom kernel RPM/SRPM
Luis Alejandro Cazzola wrote:
can you explain more in details the methos to do the sourcecode to then compiling a custom kernel.
You just want the source code ? Doing a rpm -ivh on the SRPM is enough.
You can symlink it from /usr/src/kernel/2.6.9-22 to /usr/src/linux. That simple or I didn't understand your question (or I'm wrong).
-- Giovanni P. Tirloni http://blog.tirloni.org
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On 11/17/05, Luis Alejandro Cazzola cazzola_luis@yahoo.com.ar wrote:
ok, i want the sourcescode with all the rhel pacths, i want to recompile the kernel to add reiserfs and ntfs support so?
So install kernel-unsupported from the centosplus repository where all that stuff is built in already.
-- Jim Perrin System Architect - UIT Ft Gordon & US Army Signal Center
Luis Alejandro Cazzola cazzola_luis@yahoo.com.ar wrote:
ok, i want the sourcescode with all the rhel pacths, i want to recompile the kernel to add reiserfs and ntfs support so?
May the force be with you. ;->
On 11/17/05, Giovanni P. Tirloni gpt@tirloni.org wrote:
Hi,
I've built customs kernels from the SRPMs with the following:
rpmbuild -bp --target=i686 /path/to/spec cd /usr/src ln -s /usr/src/redhat/BUILD/kernel-x.y.z/linux-x.y.z linux cd linux make oldconfig make menuconfig make all make modules make modules_install
And it works just fine. The problem now is that I think installing that way isn't "cool": I wan to build my own custom kernel RPM/SRPM.
I thought about doing a "rpmbuild -bp" and change the options. Then a "rpmbuild -bc --short-circuit" and a "rpmbuild -bi --short-circuit".
What's the correct way of doing this?
Thanks in advance,
Pardon me while I pull out Bryan J Smith's soap box for a minute (I'm SORRY... I couldn't resist. It's nothing personal Bryan.. just felt like some pre-coffee humor this morning) and preach about NOT REBUILDING your own enterprise kernel. I won't preach too much though, as you're on the right track with it. The best how-to that I'm aware of so far is currently here -> http://crab-lab.zool.ohiou.edu/kevin/kernel-compilation-tutorial-en/ and details the basic steps you should take.
/BJS flamesuit ON!
-- Jim Perrin System Architect - UIT Ft Gordon & US Army Signal Center
On Thu, 2005-11-17 at 08:22 -0500, Jim Perrin wrote:
Pardon me while I pull out Bryan J Smith's soap box for a minute (I'm SORRY... I couldn't resist. It's nothing personal Bryan..
No! It's my soapbox and you can't play with it! @-P
just felt like some pre-coffee humor this morning) and preach about NOT REBUILDING your own enterprise kernel. I won't preach too much though, as you're on the right track with it. The best how-to that I'm aware of so far is currently here -> http://crab-lab.zool.ohiou.edu/kevin/kernel-compilation-tutorial-en/ and details the basic steps you should take.
As Jim pointed out, at this point, it's better:
A) to the "prep" (-bp) B) change what you want directly in the ./BUILD/kernel-* dir C) finish off the "build" (-bb)
You don't want to run arbitrary commands in any order. I've seen the SPEC files _differ_ in command order both before and after the prep. You should also _avoid_ building on the "root" filesystem. It's best to stay in the chroot environment.
I've put up my own Blog on this: http://thebs413.blogspot.com/2005/10/kernel-26-on-fedora-based-systems.html
Select commentary ..
"This addresses many issues, including:
1. Include all components to complete a build 2. Ensure exact steps to complete a build 3. Avoid negative affects to files in the production system (chroot) 4. Force documented changes with source, SPEC, etc...
[ #4 is, of course, optional -- only if you modify the SPEC with your changes / patch files ]
As of Red Hat Linux 7, I personally and professionally stopped building kernels from kernel-source[code] ... The exact order and requirements in not only building but even "prepping" the kernel source tree for 3rd party kernel modules is extremely important. But beyond that, the "mrproper" target can do some particularly nasty things to your systems' /usr/include and other directories. In the kernel.src.rpm build under the chroot, the system's /usr/include and other directories are not touched, and they have their own, self-contained support. ... That will safely prep the kernel in the RPM chroot environment into a mode that is "ready to use" under /usr/src/redhat/BUILD/kernel-2.6*/linux-2.6*/, although you should consult the kernel-2.6.spec file to see what Makefile targets have and have not been run. You may wish to create a symbolic linke to /usr/src/linux-`uname -r` but be careful when executing any Makefile targets in the unprotected, root filesystem of the system."
/BJS flamesuit ON!
A flamesuit won't protect you from my thermonuclear blasts. ;->
Quoting "Bryan J. Smith" thebs413@earthlink.net:
On Thu, 2005-11-17 at 08:22 -0500, Jim Perrin wrote:
Pardon me while I pull out Bryan J Smith's soap box for a minute (I'm SORRY... I couldn't resist. It's nothing personal Bryan..
No! It's my soapbox and you can't play with it! @-P
Hmmmm... My registrar says "-p.com" is invalid domain name. Whatever. I already own 8-P.biz
8-P
---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Bryan J. Smith wrote:
As Jim pointed out, at this point, it's better:
A) to the "prep" (-bp) B) change what you want directly in the ./BUILD/kernel-* dir C) finish off the "build" (-bb)
I believe a -bb first removes ./BUILD/kernel-.... You can modify config files and such in the SOURCE directory, but the ./BUILD/kernel-* stuff get's removed and recreated when you do a build (-bb) so any changes you make there will disappear.
I usually do a -bp, use the BUILD directory to create new patches and such, put them in the SOURCES directory, add the patches to my SPEC file, then do the rpmbuild -bb. I always follow up with a (-bs) to generate a new src.rpm for next time.
I currently have about 6 patches in the Enterprise kernel that are absolutely necessary, else I couldn't use it, so I disagree with the idea of "Don't do it"
-Jay
On Thu, 17 Nov 2005, Hilliard, Jay wrote:
Bryan J. Smith wrote:
As Jim pointed out, at this point, it's better:
A) to the "prep" (-bp) B) change what you want directly in the ./BUILD/kernel-* dir C) finish off the "build" (-bb)
I believe a -bb first removes ./BUILD/kernel-.... You can modify config files and such in the SOURCE directory, but the ./BUILD/kernel-* stuff get's removed and recreated when you do a build (-bb) so any changes you make there will disappear.
I usually do a -bp, use the BUILD directory to create new patches and such, put them in the SOURCES directory, add the patches to my SPEC file, then do the rpmbuild -bb. I always follow up with a (-bs) to generate a new src.rpm for next time.
I currently have about 6 patches in the Enterprise kernel that are absolutely necessary, else I couldn't use it, so I disagree with the idea of "Don't do it"
So what do you think needs to be patched. Are your patches available?
-Connie Sieh Fermi National Accelerator Laboratory
Connie Sieh wrote:
I currently have about 6 patches in the Enterprise kernel that are absolutely necessary, else I couldn't use it, so I disagree with the idea of "Don't do it"
The big one fixes an fcntl bug which makes the SMP kernel perform worse than a UP kernel on an SMP system. It's a serious bug and I believe it will be included in future kernels.
Another resolves the prio_tree bug which can hang a system under heavy load.
Others, that may not be that important to others:
- upgraded pwc camera driver - upgraded wacom driver - fix "make xconfig" on x86_64 - fix incorrect number of siblings reported in /proc/cpuinfo
I've applied these on kernels 2.6.9-11 up through 2.6.9-22.3
You may e-mail me directly if you're interested.
-Jay
On Thu, 2005-11-17 at 12:17 -0500, Hilliard, Jay wrote:
Bryan J. Smith wrote:
As Jim pointed out, at this point, it's better:
A) to the "prep" (-bp) B) change what you want directly in the ./BUILD/kernel-* dir C) finish off the "build" (-bb)
I believe a -bb first removes ./BUILD/kernel-.... You can modify config files and such in the SOURCE directory, but the ./BUILD/kernel-* stuff get's removed and recreated when you do a build (-bb) so any changes you make there will disappear.
I usually do a -bp, use the BUILD directory to create new patches and such, put them in the SOURCES directory, add the patches to my SPEC file, then do the rpmbuild -bb. I always follow up with a (-bs) to generate a new src.rpm for next time.
I currently have about 6 patches in the Enterprise kernel that are absolutely necessary, else I couldn't use it, so I disagree with the idea of "Don't do it"
I think the "Don't do it" should be expounded a little bit to this:
CentOS is not gentoo or lfs ... it is a integrated solution in which all the parts fit together. They are built and tested that way.
As much as possible, one should probably stay within the distributed packages and not build their own items or use any external programs.
If that is not possible, then one should only change items that are required.
AND ... you should only do that IF you know what you are doing :)
In your case, it seems that you know exactly what you are doing ... In which case, CentOS makes a great base to build on.
Just remember though, if you break it ... you get to keep both halves :)
"Hilliard, Jay" Jay.Hilliard@disney.com wrote:
I believe a -bb first removes ./BUILD/kernel-....
Actually, you're correct. The "-bb" will redo the "-bp" step as well. I can't remember the command to start after where "-bp" left off -- I think it's an option to "-bb".
I don't do this myself, because I _always_ do what you describe next -- I add patch files and change the SPEC file so I have _all_ changes documented/repeatable.
I currently have about 6 patches in the Enterprise kernel that are absolutely necessary, else I couldn't use it, so I
disagree with the idea of "Don't do it"
Patching is one thing. If you take the time to modify the SPEC and integrate your patches, where required, that's proper.
It's just to be avoided if you can help it -- if you aren't merely adding drivers, but changing subsystem code.
On Thu, 2005-11-17 at 10:03 -0200, Giovanni P. Tirloni wrote:
Hi,
I've built customs kernels from the SRPMs with the following:
rpmbuild -bp --target=i686 /path/to/spec cd /usr/src ln -s /usr/src/redhat/BUILD/kernel-x.y.z/linux-x.y.z linux cd linux make oldconfig make menuconfig make all make modules make modules_install
And it works just fine. The problem now is that I think installing that way isn't "cool": I wan to build my own custom kernel RPM/SRPM.
I thought about doing a "rpmbuild -bp" and change the options. Then a "rpmbuild -bc --short-circuit" and a "rpmbuild -bi --short-circuit".
What's the correct way of doing this?
I would just copy the modified config files and replace the kenrel config files in SOURCES/
then do:
(after you modify the spec, if you want)
you might want to do xxxxx.EL.yourname for the kernel name, maybe not. Also might want to NOT build kernels youi don't care about (like highmem) by changing the required variables.
rpmbuild -bs --target xxxx kernel-2.6.spec
(gives you new SRPM (run from SPECS/ dir)
Then you can rebuild the binary kernel with:
rpmbuild -bb --target xxxx kernel-2.6.spec
OR
rpmbuild --rebuild --target xxxx new_kernel_name.src.rpm