Jump to content

Tutorial for multimedia kernel srpm athlon rebuilding


wrc1944
 Share

Recommended Posts

Since I started the rebuilding the multimedia kernel srpm for athlon thread in the kernel forum, and it evolved into a more general discussion, I guess I'm responsible for doing a brief summary, and placing it here(as requested by a moderator).

 

Recompiling the kernel srpm (or any srpm) is pretty straight-foward, with no real "tricks" to it. I'll describe the steps I used as root, which is safe, as the kernel srpm is a trusted source. There are other and probably better ways, like doing it as user (more involved setup procedure), but this seems like the simplest for a basic generic Mandrake 9.1 installation. Make sure you have the rpm and development packages installed. (I don't think I left out anything- aru, will you please check this, and add anything you feel I missed?)

 

1. Edit (as root) your /usr/lib/rpm/rpmrc file "athlon optflag line" to include the optflags you desire. You can use the given athlon flags, but if you have a different version of the Athlon cpu, use the appropriate flag (athlon-tbird, athlon-4, athlon-xp athlon-mp). I used the following flags in my rpmrc file, and it worked for me, but admittedly these might be considered pretty reckless for the kernel. I'm no real expert, and I think the kernel rebuild might override (or eliminate) some of these anyway. I did notice some -O2 flags during the rebuilding, after specifying -O3. Next time I rebuild some athlon-xp optimized srpms, I'm going to try a few other flags, and eliminate others which may be redundant. Anyway, make sure all the flags are on ONE line.

 

optflags: athlon -O3 -march=athlon-xp -mcpu=athlon-xp -mmmx -msse -m3dnow -funroll-loops -fomit-frame-pointer -pipe -ffast-math -fforce-addr -fno-strength-reduce

 

2. Download the multimedia kernel srpm to a directory in /home.

 

3. Go to a console, su to root, and cd to the directory where you put the kernel srpm.

 

4. Type:

 

rpm --rebuild --target athlon kernel-multimedia-2.4.21.0.16mdk-1-1mdk.src.rpm

 

then hit enter, and it should start compiling. When it's done, you'll find the new athlon optimized kernel rpm, an smp optimized kernel rpm (for multi-cpu systems), and the kernel source rpm in /usr/src/RPM/RPMS/athlon. I usually copy the new kernel and kernel source rpms to their own directory in /home, and then cd to that directory, su to root, and install with rpm -ivh *.rpm

 

That should do it. Look at your lilo.conf file to see if it's OK before trying to boot the new kernel. As I recall, I had to edit my old kernel stanza to explicitly refer to the old kernel image to be able to boot it. I thought the Mandrake install script was supposed to rewrite lilo correctly so the old kernel could be booted, but apparently it didn't. When I did the edit myself, the old kernel was then available.

 

wrc1944

Link to comment
Share on other sites

For those who may want to read the original thread, for interest or just because you're insane, here is a link to said thread:

 

http://mandrakeusers.org/viewtopic.php?t=4117

 

I doubt anyone will want that since this thread seems to sum things up somewhat, but I figured just in case.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...