1828346 Members
3254 Online
109976 Solutions
New Discussion

Re: Compile Kernel

 
Jairo Campana
Trusted Contributor

Compile Kernel

Hello , I need compile the kernel linux redhat 7.2:
I have the following error:

#cd /usr/src
#make menuconfig

make: *** Not exist rule to construct the objective `menuconfig'. Stop.


legionx
8 REPLIES 8
Josh Owings
Frequent Advisor

Re: Compile Kernel

Are you sure that your kernal source is in "/usr/src/"? My kernel sources are usually one directory deeper.
Ex. "/usr/src/linux-2.4.2"

That would be my first guess.
Sachin Patel
Honored Contributor

Re: Compile Kernel

Hi Jairo,
I think it is just menuconfig or
make xconfig will bring up x windows and some configuration parameters.
Then
make dep
make clean
make bzImage

Sachin
Is photography a hobby or another way to spend $
Jairo Campana
Trusted Contributor

Re: Compile Kernel

the same error

[root@]# cd /usr/src/linux-2.4.7-10/

[root@ linux-2.4.7-10]# make menuconfig
make: *** No rule to construc the objetcive `include/linux/autoconf.h', necessary
for `include/linux/version.h'. Stop.

[root@linux-2.4.7-10]#

legionx
Jeffrey Wong
Advisor

Re: Compile Kernel

Try checking to see if you installed the kernel source code. If you are working with the stock kernel for a RedHat setup, the command "rpm -q kernel-source" should return a version number. If it says package not installed then you will have to install the package first. If you want to use the stock kernel source, the rpm for it should be on 2nd install cd as RedHat/RPMS/kernel-source-. You will probably also need the kernel-headers rpm on the 1st cd.
I_M
Honored Contributor

Re: Compile Kernel

Hi,

kernel-2.4.7-10 rpm pkg doesn't include
/usr/src/linux/include/linux/autoconf.h

your choice is
use 2.4.9 rpm pkg which include autoconf.h
or
ln -s /usr/include/linux/autoconf.h /usr/src/linux/include/linux/autoconf.h

regards,
Josh Owings
Frequent Advisor
Kodjo Agbenu
Honored Contributor

Re: Compile Kernel

Hello Jairo,

The problem is that kernel build utilities expect a directory name "/usr/src/linux", not "/usr/src/linux-2.4.7-10"


Try the following :

cd /usr/src
ln -s linux-2.4.7-10 linux
cd linux
make menuconfig


Good luck.

Kodjo
Learn and explain...
Martin Burnett_2
Trusted Contributor

Re: Compile Kernel

Hello Jairo,

Let's start from the beginning, shall we:

# cd /usr/src/linux-2.4

This should be a link to your current source directory (i.e. linux-2.4.7-10)

# make mrproper

This will cleanup any "old kernel compile) files.

# ls -la .config

This is checking to see if you have a .config file which is required for make menuconfig, make xconfig to work on. If you do not have a .config file you have a couple of options:

# make oldconfig

This will create a .config file from the currently running kernel and is a good choice.
Alternatives you can change directory into /usr/src/linux-2.4/configs and use one of the configuration files listed here.

# cd /usr/src/linux-2.4/configs
# ls
kernel-2.4.9-athlon.config kernel-2.4.9-i586-smp.config
kernel-2.4.9-athlon-smp.config kernel-2.4.9-i686.config
kernel-2.4.9-i386-BOOT.config kernel-2.4.9-i686-debug.config
kernel-2.4.9-i386.config kernel-2.4.9-i686-enterprise.config
kernel-2.4.9-i386-smp.config kernel-2.4.9-i686-smp.config
kernel-2.4.9-i586.config

To use the kernel-2.4.9-i686-smp.config simply copy it into the higher directory:

# cp kernel-2.4.9-i686-smp.config /usr/src/linux-2.4/.config

Now run your make menuconfig command

# cd /usr/src/linux-2.4
# make menuconfig
# make dep
# make modules
# make modules_install
# make install

Edit /etc/lilo.conf to tell your system about the new kernel and then verify the lilo.conf file with:

# lilo -v

If you need ram image use:

# mkinitrd
# reboot

Just out of curiosity, are you upgrading kernels or trying to change a paramter in the kernel?

Thanks for participating in the forums,

Martin
Chaos reigns within. Reflect, repent, and reboot. Order shall return.