I'm interested to learn more about the process of building the kernel. I am admittedly relatively new to the kernel build process. I used to do it occasionally years ago when it was more commonly done, but the need seems to come up less often these days. I've read through the instructions included on the wiki (Re-building a RHEL 5 kernel for Power) and wanted to approach this the way a typical customer might. I've run into an error almost immediately:
error: cannot create %sourcedir /usr/src/redhat/SOURCES
when trying to install the kernel sources rpm. I'd like to flesh out the process with a bit more detail for my own records. I'm sure I'm missing a fairly basic step, but a search of the Internet didn't turn up anything obvious. I know we indicate throughout the documents that these steps are really meant for people who already know what they are doing, but I can't help but think that a potential Power customer might try this in the same manner I have and be left wondering what to do next.
I'd appreciate any feedback,
SystemAdmin 110000D4XK706 Posts
Re: Building a RHEL 5 kernel on Power2010-09-16T12:24:16ZThis is the accepted answer. This is the accepted answer.Interesting.
I agree, this should be fairly easy to do. We have evolved to the point where we over-do the warnings a bit on the page, since we've had a couple of unfortunate experiences where a new user tried the steps on a system which was not a victim (play-around) system. That said, all of the steps are meant to be there.
So you're trying to re-build the distro kernel, which is a little different. Can you give a few more details? You're "root" right? Which version of RHEL5?
ps: feel free to update the wiki page as you learn more..
gambs 06000141GU5 Posts
Re: Building a RHEL 5 kernel on Power2010-09-16T15:22:57ZThis is the accepted answer. This is the accepted answer.Hello,
Well, I'm happy to say that I got all the way through it and booted successfully off the newly built kernel just fine. This was RHEL5.4 with no other patches and I am root. The instructions, save for maybe a typo here and there, are completely correct. The only thing that threw me was that there was nothing at the top indicating some basic assumptions. Here's what I had to do that wasn't in the list:
1) I had to create the following directory:
- mkdir /usr/src/redhat
Based on what I've read, that directory should have been there, but doesn't get created by default in RHEL 5.4 ppc. I can't prove it yet, but experience tells me that modifying the default software package configuration at install time would have fixed this. I just don't know which package or bundle to add.
2) I had to manually install rpm-build. This, in turn, required elfutils, which in turn required something else....
Setting up YUM and a DVD repository (importing the GPG key) fixed this, but I suspect the REAL answer is similar to the directory issue from 1.
I had never used rpm-build to create a kernel package, but found it quite enjoyable and mostly idiot-proof. I have no problem with the warnings since it is completely likely that someone will, sooner or later, hose a production machine. It is important to emphasize that this needs to be done slowly and with a great amount of care. I was also pleasantly surprised that the process automatically updated yaboot.conf, which seems to be one of the biggest issues. Again, everything should be carefully checked with a watchful eye, but a really great set of instructions, nonetheless.