LeRoy Cressy on Mon, 18 Mar 2002 22:00:14 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] mkinitrd


I've given several talks on kernel compilation when we were still
meeting on Walnut Street.  

Here it is in a nutshell

get a source kernel from ftp.kernel.org
The latest one that I'm using is 2.4.28

make a source directory tree:
	/usr/src/linux
	/usr/local/src/linux
	~/src/linux

	or whereever you want to compile your kernel at.  It is up to you :-)

copy the kernel source tar file to whatever src directory you are using.
	Since I maintain several systems with different kernels
	I use /usr/local/src/linux/v2.x/ as the kernel base. The tailing `x'
	is the kernel version you are using.  And cd to the same directory

Unpack the kernel tarball
	
cd linux
make menuconfig | make xconfig  (If you are running X use the make
xconfig)
	Pick the options that you want your kernel to have and read the
	help files on each option.

	I believe that any hardware that is physically on the machine that
	you are compiling the kernel for should not be compiled as a module.
	Also there has been talk that a firewall should not have modual support
	at all.

make dep; make clean; make bzImage; make modules
	While this is working have some lunch

As a super User
	make modules_install
	cp System.map /boot/System.map-2.4.x
	cp arch/i386/boot/bzImage /boot/bzImage-2.4.x
		(The trailing x in the above 2 lines is the patch level of
		the kernel)

	cd /

	You should have 3 symbolic links pointing to different kernels in
	/boot.

		/vmlinuz -> boot/bzImage-2.4.x	    (new Kernel)
		/vmlinuz.old -> boot/bzImage-2.4.x  (old kernel)
		/vmlinuz.dist -> boot/vmlinuz       (distribution kernel)

	Edit /etc/lilo.conf to reflect the symbolic links like:

image=/vmlinuz
        label=Linux
        read-only

image=/vmlinuz.old
        label=Linux.old
        read-only

image=/vmlinuz.dist
        label=Linux.dist
        read-only

Finally run lilo

If you are using grub then configure the grub stuff as needed in stead
of the lilo stuff.

That is all there is to it.
	
Fred K Ollinger wrote:
> 
> Did anyone ever give a talk on how to compile kernels for rh? I'd love to
> see that. I'm having lots of trouble, and I've been assured that
> 'everything works great'. I really believe this, but I'd like to have a
> tutorial on it where someone compiles a kernel step by step and tell us
> why.
> 
> I did mkinitrd and all the other things the tutorial said to do and I
> couldn't get a kernel to load on rh 7.2. I have had good luck (yes it's
> luck to me) w/ rh 6.2 and the 2.2 stock kernels.
> 
> Stock kernels are great, but I really believe that one should compile
> one's systems kernel. Probably a religious belief by now. :)
> 
> Fred Ollinger (follinge@sas.upenn.edu)
> CCN sysadmin
> 
> ______________________________________________________________________
> Philadelphia Linux Users Group       -      http://www.phillylinux.org
> Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
> General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug

-- 
Rev. LeRoy D. Cressy   mailto:lcressy@telocity.com   /\_/\
                       http://www.netaxs.com/~ldc   ( o.o )
                       Phone:  215-535-4037          > ^ <

Jesus saith unto him, I am the way, the truth, and the life: 
no man cometh unto the Father, but by me. (John 14:6)

______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug


  • References: