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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...