Jump to content

make a new kernel rpm


Recommended Posts

thanks to Randall for assistance with this

 

here's how,

 

verify that you have the following installed in your distro (if it supports it)

 

rpm-devel, curses, ncurses-devel and gcc and required deps.

 

Once done, download the latest stable kernel from http://www.kernel.org

 

currently that is 2.6.23.9

 

 

once downloaded, unzip the file

 

bunzip2  kernel

then cd to the new kernel directory

 

then untar it with

 

tar xvpf kernel

 

then prepare it for compiling...

 

make clean && make mrproper

 

now we want to copy over default settings from a shipped kernel to the new one we will compile

 

cp /boot/config-`uname -r` ./.config

 

where uname -r is the value from your current kernel eg:

 

[root@localhost ~]# uname -r

2.6.23.1-49.fc8

 

now that you have copied over the 'default settings' from the shipped kernel lets configure the new one by

 

make menuconfig

 

then do a

 

make rpm

 

the above will only make an RPM file of the new kernel for you, if you wanted to test that kernel you'd have to install the rpm as normal.

 

If you want to make the kernel the 'normal' way then do as follows

 

make
make modules_install
make install

 

below is a sample of me actually going through all the steps on a SLED 10sp1 machine.

wget http://www.kernel.org/pub/linux/kernel/v2.....6.23.9.tar.bz2

 

43.4 MB

 

in yast, i searched for rpm-devel and then isntalled it.

 

next in yast i searched for curses and isntalled ncurses-devel and the 32bit version of same. (ncurses-devel-32bit)

 

then

 

bunzip2 linux-2.6.23.9.tar.bz2

 

then

 

tar xvpf linux-2.6.23.9.tar

 

then once uncompressed

 

cd linux-2.6.23.9/

 

 

 

 

installed gcc and libmudflap for compiling... in yast.

 

make clean && make mrproper

 

cp /boot/config-2.6.16.53-0.16-smp ./.config

 

 

(copies the current sled10 settings in the kernel to the new kernel)

 

make menuconfig

 

make

make modules_install

make install

make rpm

 

 

Wrote: /usr/src/packages/SRPMS/kernel-2.6.23.9smp-2.src.rpm

Wrote: /usr/src/packages/RPMS/x86_64/kernel-2.6.23.9smp-2.x86_64.rpm

Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.97342

+ umask 022

+ cd /usr/src/packages/BUILD

+ cd kernel-2.6.23.9smp

+ exit 0

rm ../kernel-2.6.23.9smp.tar.gz

linux-hiz9:/kernel_update/linux-2.6.23.9 #

Link to post
Share on other sites

sure is

 

 

however i reinstalled the same box and then when done, installed the rpm i had created in the process above, it installed just fine

 

but, when I rebooted to test it, it wasnt listed in grub, so by hand i tried to add it, but that didnt work either as it was missing some initrd specific stuff

 

so, how can i make an rpm that contains everything thats needed to install a new kernel+update grub etc ?

Link to post
Share on other sites
  • 3 weeks later...
so, how can i make an rpm that contains everything thats needed to install a new kernel+update grub etc ?

 

is this even possible ?

Link to post
Share on other sites

It is possible, but you would need to write your own spec file with a post install script to tamper the grub/lilo setups

Link to post
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.

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.

×
×
  • Create New...