LinuxQuestions.org
Review your favorite Linux distribution.
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 09-20-2003, 07:47 PM   #1
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1/13.37/14/14.2 RH 6.2/7/EL6.5 SuSE 8.2/11.1
Posts: 478

Rep: Reputation: 30
Post Just built my first kernel, but...


Ok here's the deal...

I'm running RH7, previously with 2.2.16-22 and now with 2.4.22(I think), here is what I done:

(1) I downloaded the source file linux-2.4.22.tar.gz
(2) I created a folder @ /usr/src/linux-2.4.22
(3) Created a link from the above folder to /usr/src/linux
(4) unpaged the source in the /usr/src/linux-2.4.22 folder.
# I assume that for the next build, I link /usr/src/linux to the new build folder, allowing me to keep several versions on disk

This is where I started to get a little lost...

(5) I then went cd /usr/src/linux and done make xconfig
Guessed a little, realising now that I made at least a few bad choices.
(6) Once complete, chose "Save and Exit".
Didn't really have a clue what to do next, done some surfing and reading for answers before proceeding...
(7)Basically a file appeared @ /usr/src/linux/.config
This as far as I am led to believe contains the results/selections of the make xconfig script, and as such is used to build the custom kernel.
(8) Run the command: make dep clean
The screen filled with what seemed to be error after error.
Now I was really stuck, all my books and printouts seemed to go inot super technical mode now, and I was seriously lost, and concerned that my system would not boot, as I did not take any prequations prior to starting the build, hoping that if things went wrong, that I would be able to boot inot my newly installed SuSE installation on hdb.
(9)make bzImage (got this one straight from a book)
(10) From the same book as above, also done: make modules_install but nothing really much happened here apart from errors, or "nothing to do" messages. Was this step required?

At this point, I really didn't know if I had actually compiled/built anything yet, was unsure if perhaps I had comiled some source, that could perhaps at some point become part of this kernel. But anyway, I ventured on...

With referance to steps 9 and 10 above, they were both from a chapter in a book, dealing with kernel compilation, there was mention of a few other options/methods, one of which included "installing" the kernel and modifying the boot loader, I was not too keen on this, as I wanted to ensure that I could still boot into SuSe on the other drive.

(11) copied the file /usr/src/linux/arch/i386/boot/bzImage to /boot/vmlinuz-2.4.22
Thought it strange that it resided under an i386 folder, considering that I build it with options to suit an AMD K7 Athlon, perhaps someone here has an explination for this...
(12) I now modified Lilo, booted and to my surprise it actually did boot into 2.4.22

What I did notice during boo though, was a message stating that it would not locate or find module dependancies, also prior to rebooting the system, I noted that there was no /lib/modules/2.4.22 folder, however after the initial boot, this folder was created and resides alongside 2.2.16-22
On rebooting again, there was no such dependancy messages.
Is this normal, some info on this would be great.

Back to the mistakes that I know I made, the first one being that at some point during the building of the kernel, there was a warning messag stating that the kernel image was too large to fit on a boot floppy, I trust that this is a bad thing meaning that I have failed miserably in my attempts to configure a minimal build. the other bad thing, was during the selection for Hot Swap support, to which I chose no. Well I have a mouse/keyboard switch, to switch between two machines, and now when I switch to the other machine and back, I have no mouse control, something I'll fix at my next attempt.

The one good thing, and possibly the main reason for trying to build an updated kernel in the first place, was that I can now mount a reiserfs partition on my other drive, which I could not previously do.

So there you have it, 12 steps to build an updated and somewhat customised kernel, much of the work was indeed guess work, and I do admit to that, but I am pretty pleased with myself

What I am looking for from you Guru's are comments and indeed possibly explinations for the various steps above, possibly even suggestions for improvement etc.

Please don't flame me for giving what you may consider to be inaccurate information, this was not intended to be a step by step guid to building a kernel, but rather my account, of how I achieved it, with the hope that you guys/gals can clear up the mass of confusion that came with it.

Thanks for your time...
 
Old 09-20-2003, 07:56 PM   #2
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1/13.37/14/14.2 RH 6.2/7/EL6.5 SuSE 8.2/11.1
Posts: 478

Original Poster
Rep: Reputation: 30
I have also noticed that in my new /lib/modules/2.4.22 folder, the file modules.dep is empty, but the corresponding file for the older kernel contains many referances to files, why could this be?
 
Old 09-20-2003, 08:53 PM   #3
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
I would start with the kernel howto,

basically you will need to run

make mrproper xconfig dep clean bzImage modules modules_install

Maybe you can also run `make install` after that, depends on your distros ability to use the installkernel script.

failures usually mean problems in the second step xconfig.


at this point you might just try to run


make modules modules_install

then try it
 
Old 09-21-2003, 05:57 AM   #4
bongski55
Member
 
Registered: May 2003
Location: Somewhere in Asia
Distribution: ubuntu on Dell, Vista,XP triple boot
Posts: 276
Blog Entries: 1

Rep: Reputation: 30
Hi Plisken,
1. Before you do make xconfig it is advisable to copy the previous config file(usually found in /boot ,I don't know where in suse) and rename it ".config" inside the linux kernel folder. After this,use make oldconfig and you will only be prompted for changes between the old and the new kernel. You have to be careful in creating the config file as this is crucial in the compile process.
2. After the config file is created,all commands (make dep,make bzImage,etc) should have NO ERRORS otherwise you should not continue with the compile as it surely will fail. You can do the following:
#make dep && make bzImage && make modules && make modules_install

The "&&" will ensure that the next command will be executed if the succeeding one is successful.

Good luck!
 
Old 09-25-2003, 12:20 PM   #5
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1/13.37/14/14.2 RH 6.2/7/EL6.5 SuSE 8.2/11.1
Posts: 478

Original Poster
Rep: Reputation: 30
OK, got a new kernel working 2.4.22 but what I notice is that is is larger than the original kernel, 960kb in total, compared to 630kb (if I remember correctly)

What I do notice though, and this is really annoying, is that when I switch my keyboard and mouse (ps2) to control my other machine and then switch back, that I have no control over the mouse, and I either have to restart x or reboot.

This did not happen with my other kerner, any ideas?
 
Old 09-25-2003, 08:34 PM   #6
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Generally ps/2 is not meant to be hotplugged, I hope your using a switching device designed to do so. I have seen motherboards killed by plugging in a ps/2 device while the power was on.

Try looking at /var/log/messages and also lsmod to see what's going on with the modules and kernel when the switch is made.

The size of the kernel is probably due to the amount of modules and builtin support you have. More modules usually make a smaller kernel.
 
Old 10-01-2003, 07:44 AM   #7
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1/13.37/14/14.2 RH 6.2/7/EL6.5 SuSE 8.2/11.1
Posts: 478

Original Poster
Rep: Reputation: 30
There is no change to the /var/messages file after unplugging the PS/2 mouse, which is really what the switch is doing.

I also run the lsmod command and found it to contain nothing, is this down to the fact that I probably compiled the kernel with no modules, is this possible? Or am I being silly?

I did notice that during make xconfig there were 3 options (y)(m)(n) for each, and of the ones I selected, I chose (y) as opposed to (m).

Matters not, what is really annoying though, is that when I switch the mouse to control my other machine, I lose control of my Linux box, this never happened on the old kernel. If however, I restart X [ctrl/back_sp] or indeed switch to another console [ctrl/alt-F1] and then switch back to graphical mode, then the mouse responds again.

Any ideas?
 
Old 10-01-2003, 09:03 AM   #8
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1/13.37/14/14.2 RH 6.2/7/EL6.5 SuSE 8.2/11.1
Posts: 478

Original Poster
Rep: Reputation: 30
for the record, SuSE 8.2 Pro does the same, out for the box...
 
  


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
kernel: modules or built in? sh4d0w13 Linux - Newbie 1 10-31-2005 07:00 PM
How to backup new built kernel intmail Slackware 1 08-01-2005 07:53 AM
new kernel built....no modules linuxhippy Slackware 11 03-10-2005 03:54 PM
Kernel 2.6.0 (PPPoE built in) on Gentoo sLiCeR\ Linux - Networking 0 12-22-2003 07:34 AM
iptables - module, or built into kernel? dunkyb Linux - General 3 02-16-2003 06:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:06 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration