LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Errors compiling 2.6.0 (https://www.linuxquestions.org/questions/linux-general-1/errors-compiling-2-6-0-a-102248/)

plisken 10-09-2003 06:03 PM

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 AFLAGS_vmlinux..lds.o

Has anybody got the slightest idea what is going on here?

plisken 10-10-2003 11:53 AM

Noticed that the kernel still compiles and does indeed boot.

I am curious as to what this is though...

demmylls 10-10-2003 01:43 PM

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.

/usr/src/linux*/arch/i386/boot/bzImage
/usr/src/linux*/vmlinux
/usr/src/linux*/system.map
/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
/usr/src/linux-*

# 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)

then

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
now.

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

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
/boot

Instaling newly compiled kernel
-------------------------------

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

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

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

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

prompt
timeout=50
default=linux
boot=/dev/hda5
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear

image=/boot/vmlinuz-2.4.20-8
label=linux
initrd=/boot/initrd-2.4.20-8.img
read-only
append="root=LABEL=/"
image=/boot/vmlinuz-2.4.22-custom
label=linux kernel-2.4.22-custom
initrd=/boot/initrd-2.4.22-custom.img
read-only
append="root=LABEL=/"
other=/dev/hda1
optional
label=DOS
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
file
# 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
#boot=/dev/hda5
default=1
timeout=10
splashimage=(hd0,4)/grub/splash.xpm.gz
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 XtreamLinux.cjb.net. Fro now on you can upgrade kernel on any linux machine.

plisken 10-10-2003 05:12 PM

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.


All times are GMT -5. The time now is 12:35 PM.