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. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-09-2003, 06:03 PM
|
#1
|
Member
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 518
Rep:
|
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?
|
|
|
10-10-2003, 11:53 AM
|
#2
|
Member
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 518
Original Poster
Rep:
|
Noticed that the kernel still compiles and does indeed boot.
I am curious as to what this is though...
|
|
|
10-10-2003, 01:43 PM
|
#3
|
Member
Registered: Aug 2003
Location: AT
Distribution: Fedora Core 3
Posts: 404
Rep:
|
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.
|
|
|
10-10-2003, 05:12 PM
|
#4
|
Member
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 518
Original Poster
Rep:
|
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 01:08 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|