Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 10-09-2003, 07:03 PM   #1
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1/13.37/14 RedHat 6.2/7/EL6.5 SuSE 8.2/11.1
Posts: 471

Rep: Reputation: 30
Errors compiling 2.6.0

I'm getting the following errors while compiling kernel 2.6.0

/bin/sh: invalid charicter 46 in exportstr for

Has anybody got the slightest idea what is going on here?
Old 10-10-2003, 12:53 PM   #2
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1/13.37/14 RedHat 6.2/7/EL6.5 SuSE 8.2/11.1
Posts: 471

Original Poster
Rep: Reputation: 30
Noticed that the kernel still compiles and does indeed boot.

I am curious as to what this is though...
Old 10-10-2003, 02:43 PM   #3
Registered: Aug 2003
Location: AT
Distribution: Fedora Core 3
Posts: 404

Rep: Reputation: 30
Compiling or recompiling kernel

to compile a new kernel we need 4 files that after compilation and needed to be coppied

in to /boot directory.

/boot/initrd*.img (this file must be create using this command after all make
xconfig,make bzImage, make modules, and make modules_install)

Step to be taken to compile a new kernel

NOTE: i'm using an example of compiling kernel-2.4.22

Decompress linux-2.4.22.tar.bz2 or linux-2.4.22.tar.gz into

# cd /usr/src/linux-2.4.22

For precaution do this,

copy /boot/config-2.4.20-8 to /usr/src/linux-2.4.22
(where config-2.4.20-8 is the old kernel config)


linux-2.4.22]# make xconfig

a window will popup and this window is the window that you can turn on or off devices
you wants to use or devices that u don't need.

Click on button "Load Configuration from File" keyin the file name in the "Enter
filename" textbox. this file name is the file name that is the same with config-* that
you have copied it from /boot

after that you can make changes you like to what devices you want of you don't want but
remember this, must turn on this things

Loadable modules support->Enable loadable module support = say yes (recommended)

after you are satisfied select "Save & Exit"

then usr this command to set all the dependencies needed to compile selected devices.

linux-2.4.22]# make dep

after that solving the dependencies you can compile the kernel now using this command

linux-2.4.22]#make bzImage

After kernel compilation finnish do this step that are very important so that you wont
messup you current kernel modules if you are recompiling the same version of kernel you
are running now. Do this below (you can use any text editor to do this in this case i'm
using kwrite to edit "Makefile" that is located in /usr/src/linux-*)

open /usr/src/linux-*/Makefile and im using this command to open that file

linux-2.4.22]# kwrite Makefile

At "EXTRAVERSION = " change it to "EXTRAVERSION = -custom" where custom is the name you
like to put it like 123 or blabla".

You newly compiled modules will be installed in /lib/modules/(kernel version)
So the step above will make the newly compiled modules to install itself into
/lib/modules/2.4.22-custom (in this case i'm using example of kernel-2.4.22)
instead of /lib/modules/2.4.22 which is the current kernel version that i'm running

After safety precaution above you can now do the command below to compile you kernel

linux-2.4.22]# make modules

This will take a long time in my case i'm compiling kernel-2.4.22 and it takes me
30 minutes just to "make modules" under my Pentium 4 1.5 GHz Processor and in this time
you can take a shower or dinner or lunch or anything you like just leave it there
till it finished compiled. then do the command below to install the kernel

linux-2.4.22]# make modules_install

Ok at this point you are done and now you can copy those file just compiled into

Instaling newly compiled kernel

copy /usr/src/linux-2.4.22/arch/i386/boot/bzImage
/boot and rename bzImage to vmlinuz-2.4.22

copy /usr/src/linux-2.4.22/vmlinux
/boot and rename vmlinux to vmlinux-2.4.22

copy /usr/src/linux-2.4.22/
/boot and rename it to

After all above you can now make initrd.img file using this command

linux-2.4.22]# mkinitrd /boot/initrd-2.4.22-custom.img 2.4.22-custom
(the command above means make initrd image from /lib/modules/2.4.22-custom and
store the image file in /boot)

NOTE: the 2.4.22-custom is the folder in /lib/modules and if you named the
EXTRAVERSION in /usr/src/linux-2.4.22/Makefile to any other else for example
"blabla" then your make initrd image command will be like this
linux-2.4.22]# mkinitrd-2.4.22-custom.img 2.4.22blabla. this is because when
EXTRAVERSION = blabla modules folder will be /lib/modules/2.4.22blabla and if
EXTRAVERSION = -customXYZ the modules folder will be
/lib/modules/2.4.22-customXYZ. so no matter what is the modules folder name is
you mkinitrd command must be the same with the modules folder name

Configure GRUB or LILO to comply with new kernel

Boot new kernel using LILO

open /etc/lilo.conf


label=linux kernel-2.4.22-custom
save this text file

Boot new kernel using GRUB

# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,4)
# kernel /vmlinuz-version ro root=/dev/hda7
# initrd /initrd-version.img
title Red Hat Linux 9 (kernel-2.4.22-custom)
root (hd0,4)
kernel /vmlinuz-2.4.22-custom ro root=LABEL=/
initrd /initrd-2.4.22-custom.img
title Red Hat Linux 9 (kernel-2.4.20-8)
root (hd0,4)
kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /initrd-2.4.20-8.img
title Microsoft Windows XP Professional
rootnoverify (hd0,0)
chainloader +1

save this text file

Congratulation you have successfully finnished your course on compiling linux kernel. If your new kernel runs fine that means, you are nowCcertified Linux Kernel Compiler (CLKCXL) from Fro now on you can upgrade kernel on any linux machine.
Old 10-10-2003, 06:12 PM   #4
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1/13.37/14 RedHat 6.2/7/EL6.5 SuSE 8.2/11.1
Posts: 471

Original Poster
Rep: Reputation: 30
One of the best step-by-step guides I've read so far...

Almost identical to what I have been doing, which is possibly why I like it

Have found that doing a make install however, will copy the compressed kernel image etc to the /boot directory, I had previously done this manually.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 06:03 AM
Errors compiling boombastic Linux - Newbie 7 08-04-2004 04:09 PM
Compiling 2.6.7 gets errors !! td0l2 Linux - Newbie 4 06-29-2004 11:59 PM
Errors when compiling anything! adizzle Linux - Newbie 4 06-16-2004 06:27 PM
QT compiling errors slackwarefan Slackware 1 03-01-2004 08:45 PM

All times are GMT -5. The time now is 10:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration