Linux-Noob Forums

Full Version: make a new kernel rpm
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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

 



Code:
bunzip2  kernel


then cd to the new kernel directory

 

then untar it with

 



Code:
tar xvpf kernel




 

then prepare it for compiling...

 



Code:
make clean && make mrproper




 

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

 



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




 

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

 

Quote:[root@localhost ~]# uname -r2.6.23.1-49.fc8
 

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

 



Code:
make menuconfig




 

then do a

 



Code:
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

 



Code:
make
make modules_install
make install




 

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

Quote: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 #
make rpm is an ace addition to the kernel build :)

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 ?


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

is this even possible ?

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