LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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

Reply
 
Search this Thread
Old 08-28-2005, 12:43 PM   #316
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,378

Rep: Reputation: 1107Reputation: 1107Reputation: 1107Reputation: 1107Reputation: 1107Reputation: 1107Reputation: 1107Reputation: 1107Reputation: 1107

I did this upgrade not too long ago .. still fiddling with it in fact, since I did it from-source with no packages. A few observations...

(1) You don't need an initrd, by any name, and you really don't want one. Red Hat uses one, partly so that it can give pre-boot messages and partly to allow their system to "boot up and run on basically anything." Important for a distro-vendor, but not for you. Compile the features you require, and only those features, directly into the kernel.

(2) A red-hat file /etc/sysconfig/hwconf will tell you quickly what Kudzu thinks that your hardware looks like. A modprobe will tell you what modules are loaded, presumably to support the hardware you have (and other things). Use this to select the hardware-support you actually need, and exclude all the others.

(3) There is a lot of stuff that red hat puts around ... their support network, their "friendly files" and so-on, which you'll spend quite a bit of time just cleaning up (removing).

(4) Probably the most important thing is the patches to rc.sysinit, which is the initial startup-script. First of all, make sure that it runs... no syntax-errors mainly... before you reboot.

(5) If you are getting your system from 2.4 to 2.6 "from source," you have to get a 2.6 kernel underneath your system before you can do things like recompile glibc. So you'll wind up rebuilding your kernel twice.

(6) If you like red-hat and want to continue to "be red-hat," obviously the easiest way to go about all of this is to get a very-current Fedora-or-whatever distro and simply "install that." Le question se voulez vous, viz: do you want to "understand what's happening" or do you simply want to "get 'er done?"

(7) My network-card was recognized as tulip. There are boatloads of other device-drivers, all of which are unnecessary; the same is true for video cards. All went bye-bye.

(8) When doing the initial setup, I didn't make oldconfig. Instead, I started with make defconfig, then edited that.

(9) What seemed to work best was baby-steps:
  • First, get something that will boot and stay up.
  • Constantly copy the .config file to "somewhere else" and identify each and every one by date.
  • Make one small step at a time, then remake everything, with make mrproper being done first (then copy ".config" back from where you squirreled it away).
  • Change the kernel-name, with a new tag, after you get your initial 2.6 "up," so that you won't overwrite it.
  • Keep a legal-pad handy. Write down everything that's not working properly, then check it off.
  • Study those makefiles. Get to know how the various scripts actually work and what they do. Some "convenient scripts" you'll find in /sbin in a Red Hat system are dependent upon things that you probably don't need, particularly "mkinitrd." These will pop up in the "make install" step. They're not necessarily "errors," since your environment has changed, but simply things that you must address.

Last edited by sundialsvcs; 08-28-2005 at 02:30 PM.
 
Old 08-08-2007, 02:02 AM   #317
rs15
LQ Newbie
 
Registered: Aug 2007
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by DrOzz
first and foremost, THIS may pertain to you so read that first and then you can proceed
and here is a similiar site

www.kernel.org
**"Go get the kernel source"**

cd /usr/src
**"Change Directory To /usr/src"**

ls -alc
**"check for symlink (ex. /usr/src/linux->/usr/src/linux-2.4.18)"**
**"also note since its being ask recently, that if there is no symlink"**
**"then move on to the untarring of the kernel"**

file linux
**"double check with this command (output ex.) linux: symbolic link to linux-2.4.18-14"**

rm linux
**"remove symlink"**

tar -zxvf linux-x.x.x.tar.gz
**"unpack the tarball (new kernel)"**

ln -s /usr/src/linux-x.x.x /usr/src/linux
**"make a new link to the new kernel"**

cd linux
**"type this to change to the directory"**

----------------------------
Now Comes The Fun Part~!
----------------------------
make mrproper
**"this removes the current .config and other files"**

cp /usr/src/linux-2.4.x/.config /usr/src/linux
***this is if you want to use your old config***

<-->Your Choice<-->
make config
**"basic config from terminal"**
make menuconfig
**"for ncurses GUI in the terminal"**
make xconfig
**"for X-based GUI with modular explanations"** (QT Based)
make gconfig
**"same as above, but for 2.6.x kernel only"** (GTK Based, and might be still buggy)

/**********
Note:
Don't forget to add module support and kernel support for future hardware.
Do not compile your harddrive and filesystem type as a module.
The configure program enables you to specify an enormous number of features. It is advisable to skim through all the sections to get a feel for the different things you can do. Most options are about specifying whether you want a feature[*] compiled into the kernel image, [M] compiled as a module, or [ ] not compiled at all. You can also turn off module support altogether from Loadable module support -->. The kernel configuration is one LINUX program that offers lots of help--select < Help > on any feature. The raw help file is /usr/src/linux/Documentation/Configure.help can be also worth reading.
When your done the config click exit and save current configuration. Your file is now known as .config .
**********/
SKIP THE FOLLOWING IF DOING A 2.6.x KERNEL
make dep
**"ensures dependancies such as include files are in place"**

(vi, pico, emacs) Makefile
**"Want A Unique Kernel Name? Edit /usr/src/linux/Makefile and change EXTRAVERSION"

make clean
**"to clean your sources for they compile correctly"**

START HERE IF COMPILING A 2.6.x KERNEL

make bzImage
**"to make the kernel image (compile and creates compressed image of kernel)"**

make modules
**"compile your selected modules"**

make modules_install
**"to install newly compile modules (installs to /lib/modules/linux.x.x.x)"**


--------------------------------------------
Now Its Time To Install Your New Kernel~!
--------------------------------------------

Remove the following links:
rm -rf /boot/System.map
rm -rf /boot/vmlinuz

Then copy the newly created kernel and system.map to /boot
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-x.x.x
cp /usr/src/linux/System.map /boot/System.map-x.x.x

Make the new links:
ln -s /boot/vmlinuz-x.x.x /boot/vmlinuz
ln -s /boot/System.map-x.x.x /boot/System.map

<-> NOTE: <->
Before doing the next step, read this [1] and this [2] about the initrd.img and see if you even need to do this step ... there is alot of posts
about this step, so i am adding this section ...
<-> END NOTE <->

Next remove existing initrd.img file:
rm -rf /boot/initrd.x.x.x.img

..And create the new one:
/sbin/mkinitrd /boot/initrd-x.x.x.img x.x.x
(Note: )
The last set of x.x.x is the eqivalent to your new kernel version and it looks to /lib/modules for that version.

--------------------------------------------------------------------
Use The Steps That Pertain To You
If You Use Grub Then Edit grub.conf
If You Use Lilo Then Edit lilo.conf
--------------------------------------------------------------------
remember to leave the entry to your old kernel image just in case,
so modify what is in the config originally to point to the old image
and make a new entry for you new image you just made ....

--------------------------------------------------------------------

<-> And Finally Edit Your /etc/grub.conf file <->
<-> Note some distros now use menu.lst, so if you can't find grub or lilo, then you know what to look for <->

title New Kernel
kernel /vmlinuz-x.x.x ro root=LABEL=/
initrd /initrd-x.x.x.img
(Note: )
look at the previous parameters in the grub.conf file and note what "root=" and use what is existing.

Exit and Save grub.conf
type "/sbin/grub-install"

AND REBOOT!!!

<-> And Finally Edit Your /etc/lilo.conf file <->
image = /boot/vmlinuz-x.x.x
label = New Kernel
root = /dev/hdx
read-only

(Note: )
look at the previous parameters in the lilo.conf file and note what "root =" and use what is existing.

Exit and Save lilo.conf
type "/sbin/lilo"

AND REBOOT!!!



/******EDIT*******
as requested there was wanting the instructions on how to apply patches to your kernel.
****END EDIT*****/

read this or look below ..

This step comes after untaring your kernel source.
When you download the patch place it in the folder that you untarred you new kernel.
Then type:
patch -E -p1 < sound_patch
Purely an example and you would type whatever the file name is in replace of sound_patch.


As of having alternative boot options, well this is no problem.. The stuff above that i tell you to add to your lilo or grub file above could just append the file, and just add ".old" to the title of your oringinal kernel name for you will know the difference. and whether its grub or lilo add "read-only", to the end of the oringinal entries in the lilo.conf, or grub.conf file.
Yeh, this document was looking very helpful for me. But I am unable to find the location /usr/src/linux/arch/boot/bzImage and /usr/src/linux/System.map Can you help me to find them?
 
Old 09-26-2007, 08:12 AM   #318
Janneman
Member
 
Registered: May 2004
Distribution: Fedora Core 6
Posts: 36

Rep: Reputation: 15
Hi,

I want to recompile my kernel with CONFIG_4KSTACKS=n in my configuration file.
I made all the necessary backups and an extra entry in my grub.conf to be able to boot the old kernel.

Now I am in the /usr/src/kernels/2.6.18-1.2798.fc6-i686 directory.

When I type 'make' or 'make bzImage' I get the following error message:

make[1]: *** no rule to make target 'init/main.o', needed by 'init/built-in.o'. Stop.
make: *** [init] Error 2

What's going on?

Janneman.
 
Old 08-20-2008, 05:21 AM   #319
roders22
Member
 
Registered: Feb 2007
Posts: 34

Rep: Reputation: 15
arch/i386/crypto/aes-i586.ko Error 1

arch/i386/crypto/aes-i586.ko Error 1
The above is the error message i get when i type the command make modules_install
It seems that all the file that should be name *.ko is named *.o
Can anyone help me out to fix this. Thank you.
 
  


Reply


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
I'm interested in compiling a 2.6.x kernel, is this is a decent guide? Erik_the_Red Linux - Newbie 7 08-14-2005 06:03 AM
Kernel compiling guide for newbies... DaOne Slackware 127 04-17-2005 04:20 AM
Acid Guide to compiling Kernel 2.6.10 on Slack 10.1 acidjuice Slackware 54 03-11-2005 05:16 PM
Quick newbie guide to rebuild kernel in FC3 borgware Fedora 0 12-29-2004 01:38 PM
: Kernel compiling guide for newbies Question Anibal Slackware 6 08-01-2003 07:06 AM


All times are GMT -5. The time now is 09:44 PM.

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