LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-07-2004, 10:26 PM   #1
plisken
Member
 
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
kernel compilation question


I'm trying to recompile my kernel under Slack 9.1, using the following method:

make menuconfig (make your changes here...when done, save your new configuration)
make dep (sets all the kernel dependencies)
make clean (removes un-needed files)
make bzImage (builds the kernel)
make
make install (installs, moves and renames all the needed files and updates lilo)
make modules (builds all the kernel modules)
make modules_install (installs the modules)

Taken from the following thread:
http://www.linuxquestions.org/questi...threadid=49035

However, I'm having a few problems and have a couple of questions also...

Basically, I am running a scsi only system, as such I'm thinking that I don't really need IDE support. I'm also runing 2 processors, the main reason for wishing to recompile the kernel.

I tried the steps above and then found the system would not boot, can't quite remember the error, though I seem to remember that it had something to do with not finding a root image at /dev/scb1 or whatever, I then simply booted to my old kernel but found that I no longer had network support...hmmm strange.

Anyway, do I need to do anything special, since I am running a scsi only system, I seem to remember reading somewhere that I do?

When using the steps detailed above, do I still need to copy the new kernel from the arch/i386/boot directory to my /boot directory?
The reason I asked the last question, was that after performing the steps as detailed above, my vmlinuz file in /boot/ had not changed.

Almost finished... If I compile an option as modular, then is it loaded automatically, or do I need to use insmod etc? I always thought of modular selections as being loaded on demand, is this correct?

One final fine detail, should I compile the likes of scsi support etc as modules?

All advice and feedback would be greatly appreciated...
 
Old 12-07-2004, 11:08 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
When using the steps detailed above, do I still need to copy the new kernel from the arch/i386/boot directory to my /boot directory?
The reason I asked the last question, was that after performing the steps as detailed above, my vmlinuz file in /boot/ had not changed.
When you use make install it should run a bashscript that moves the kernel etal to boot, but I don't recommend using it. First of all it overwrites your old kernel, thus rendering your system useless if the new one doesn't work, and also as you have stated here, it seems to be a little flaky. Maybe it didn't work because you ran it before make modules and make modules_install, I don't know.

In any event you only really need to move the kernel. You should move System.map to boot as well though. Update grub or lilo.conf and reboot.

Quote:
Almost finished... If I compile an option as modular, then is it loaded automatically, or do I need to use insmod etc? I always thought of modular selections as being loaded on demand, is this correct?
Not neccesarily. If you enabled kernel autoloading then most will load automatically, but not all. Usually modules.conf is used for specifying modules to load at boot. This may be named different in slackware.

Quote:
One final fine detail, should I compile the likes of scsi support etc as modules?
Very bad idea. Why? Because the hard disc that these modules live on need the modules to read the disc, to load themselves. Obviously this is rediculous and will just result in kernel panic. You can load them from modules if you create an initrd but there is really no point.

I look at it this way, if it is a driver that will be loaded 24/7 I build it in, ie disk controllers, ethernet drivers on servers, parallel port for printers etc, but if it is for something used variably, then make it a module, ie: soundcard, firewire, usb etc...
 
Old 12-08-2004, 04:08 AM   #3
plisken
Member
 
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
Manged to get a new compiled kernel to boot but...

The was no text/graphics at all on the monitor, though I could telnet in from another pc.

lspci shows:

VGA compatable controller: ATI Technologies Inc 3D Rage Pro AGP 1X (rev 5c)

Any ideas what should and shouldn't be included in the configuration?
It's for 2.4.22

One good thing though was that dual processor support was now working, as could be seen from running top.

Would it help if I listed the entire .config file?
 
Old 12-08-2004, 05:04 AM   #4
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,513

Rep: Reputation: 58
To get a display, make sure that these paramters are set:
Code:
CONFIG_INPUT=y
CONFIG_VT=y
CONFIG_VGA_CONSOLE=y
CONFIG_VT_CONSOLE=y
As far as I know, the command make alone includes the commands make bzImage and make modules, so this is redundant in your protocol. I would also recommend to copy the kernel and System.map to it's location rather than use make install.

BTW: it may help, but I wouldn't recommend to post all of .config (too much data).
 
Old 12-08-2004, 01:50 PM   #5
plisken
Member
 
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
I'll double check these options before compiling again.

Is there any way to view the config file options that was used for installation? Would the settings already selected in /usr/src/linux/.config be the ones used in installed kernel?

ie. So that the only options I change are for the processor type and multi-processor capability...
 
Old 12-08-2004, 01:57 PM   #6
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
The .config file is created after running make *config. The settings of .config are those of the last kernel you compiled using that source.
 
Old 12-08-2004, 03:33 PM   #7
plisken
Member
 
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
So that would not necessarily be that of the kernel which was installed at time of clean install?????

ie. If I do a full clean install of slack 9.1, will the .config file be that which options are used in the kernel as installed?
 
Old 12-08-2004, 06:42 PM   #8
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
No. With a clean install there won't be a .config file. You will start with the defaults and create a .config file by running one of 'make config' 'make menuconfig' 'make xconfig'

So if you want to do a fresh install but keep your config you need to copy it to a floppy or somewhere else safe.
 
Old 12-08-2004, 11:05 PM   #9
plisken
Member
 
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
What I'm really meaning is that I don't want to change too many options, ie. I wish to keep all of the options that got my system installed and running and then only change a couple, as such I'll then know if any boot problems arrise, roughly where they came from.

From the Slack 9.1 CD, I made a boot disk from adaptec.s (I think), so if I then copy the .config from the adaptec.s kernel, then would I be right in assuming that this would be the .config file from which my current kernel was compiled?
This being the case, then if I simply add dual processor support and change the processor type to suit my machine, then all other options/features would remain the same...
 
Old 12-08-2004, 11:35 PM   #10
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Quote:
I made a boot disk from adaptec.s (I think),
I'm really not too sure what you mean by this. If you want to use the .config file from a different linux source, then you can just copy the file into the top-level of your new source, and run "make oldconfig". This will change the default configuration to the one specified by the new .config file. Now you can run "make menuconfig" or "make xconfig" to make your customizations, then build as usual.
 
Old 12-09-2004, 02:29 AM   #11
plisken
Member
 
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
Basically, I'm just trying to get back to the .config that the default installed kernel was built using, so that I can make my minor changes and know that I'm not selecting or de-selecting things that I shouldn't be.

I tried copying the bzImage file from the install cd to /boot/vmlinuz but that didn't boot either.

I suppose I can always reinstall...
 
Old 12-09-2004, 02:36 AM   #12
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,513

Rep: Reputation: 58
In some kernels you can recover the config of the running kernel with
Code:
zcat /proc/config.gz > .config
 
Old 12-09-2004, 02:04 PM   #13
plisken
Member
 
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
Must have been doing something wrong or similar...

Got it going, by copying tyhe .config file from the CD. I used the one within the folder of the kernel that I used to make the boot disk for installation which for it's worth was adaptec.s

I then ran make menuconfig
make dep
make clean
make bzImage

I then copied the bzImage file from /usr/src/linux/arch/i386/boot/bzImage to /boot/vmlinuz

Tried rebooting, but still nothing, no kernel panic, just a black screen and a non-responsive keyboard.

I then tried make modules
make modules_install

And it booted....Yipee, however...

I noticed that quite a lot of modules failed to load on first boot, 2nd time though all seemed well, any ideas on this?

Thanks
P.S: I think I'll keep this kernel for a while now
 
  


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 Compilation Question yougene Slackware 9 11-24-2005 12:29 AM
Quick question about kernel compilation and nvidia... audibel Linux - Software 5 03-12-2005 06:20 PM
does kernel-source installs with the compilation cum installtion of a new kernel? luqman Linux - General 18 03-04-2005 07:33 AM
Some question about the Kernel 2.6.10 compilation Shagrath239 Slackware 5 02-20-2005 12:01 PM
Kernel compilation question spotz78 Linux - Newbie 2 10-07-2004 08:47 AM

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

All times are GMT -5. The time now is 01:43 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