LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 02-17-2005, 12:31 AM   #1
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Rep: Reputation: 88
How to compile a new kernel *without* installing LILO


Hi,

Most of the newbie guides for kernel compiles say that LILO must be installed for it to work. Well I don't have LILO.

I already have GRUB installed on my system.

What steps should I take to install a new 2.6 kernel from source without the LILO updates? I just want a new kernel with a boot image and everything else properly configured. Nothing more. I know how to add this to GRUB.

Please help me because the instructions are rather confusing. I don't know which steps to perform and which to avoid, especially the bzimage part?

I request your indulgence and patience.
 
Old 02-17-2005, 12:40 AM   #2
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 2,612

Rep: Reputation: 228Reputation: 228Reputation: 228
it should work without too much problem
for linux 2.6 kernels, the sequence is
make menuconfig (or Xconfig in X11)
make
make modules
make install
make modules_install
 
Old 02-17-2005, 12:47 AM   #3
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Original Poster
Rep: Reputation: 88
I read somewhere that "make install" will overwrite the MBR with LILO?
 
Old 02-17-2005, 12:51 AM   #4
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Original Poster
Rep: Reputation: 88
What does
Code:
make bzimage
do?

I am really confused here? Should it be make install or make bzimage?

I think I should use make bzimage, copy it to /boot. Then I think I must edit the grub configuration file from my Debian installation to add the new boot image.

RIght?
 
Old 02-17-2005, 01:13 AM   #5
coffeedrinker
Member
 
Registered: Sep 2003
Posts: 173

Rep: Reputation: 30
I use LILO but compile my kernel with

make bzImage

then copy bzImage to /boot/bzImage-2.6.x
and copy SystemMap to /boot/SystemMap

then run lilo after configuring it for the name change.

I do not use make install
 
Old 02-17-2005, 01:16 AM   #6
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Original Poster
Rep: Reputation: 88
So for me the steps would be same but without running /sbin/lilo at the end and also editing the grub config file to include my new kernel image, right? All other steps are the same?
 
Old 02-17-2005, 01:54 AM   #7
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Original Poster
Rep: Reputation: 88
I tried the precompiled kernel 2.6.7 from my testing folder and now I get a kernel panic when I boot:

Something similar to:
Code:
Kernel panic: cannot mount filesystem on /dev/hdb1
 
Old 02-17-2005, 02:00 AM   #8
carboncopy
Senior Member
 
Registered: Jan 2003
Location: Malaysia
Distribution: Fedora Core, Slackware, Mac OS X, Debian, OpenSUSE
Posts: 1,210
Blog Entries: 4

Rep: Reputation: 45
Quote:
Originally posted by Harishankar
I tried the precompiled kernel 2.6.7 from my testing folder and now I get a kernel panic when I boot:

Something similar to:
Code:
Kernel panic: cannot mount filesystem on /dev/hdb1
That is because you didn't compile the filesystem you are using INTO the kernel. Maybe you compiled it as module. That will not work. You need to recompile the kernel and bring in the filesystem your root partition (/ ) is using into the kernel.
 
Old 02-17-2005, 02:03 AM   #9
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Original Poster
Rep: Reputation: 88
How do I get back to my 2.4.26 kernel? And then do the compile from scratch.

Can I mount my Slackware partition from Debian and change the files? I have to change the links from vmlinuz -> vmlinuz-2.6 to vmlinuz -> vmlinuz-2.4.26

Can I mount the partition from my Debian configuration?
 
Old 02-17-2005, 02:21 AM   #10
carboncopy
Senior Member
 
Registered: Jan 2003
Location: Malaysia
Distribution: Fedora Core, Slackware, Mac OS X, Debian, OpenSUSE
Posts: 1,210
Blog Entries: 4

Rep: Reputation: 45
Yes you can do that.

I assume you are using the stock 2.6.* kernel. Read the README.initrd file here:ftp://ftp.slackware.com/pub/slackwar.../README.initrd

It will tell you how to do fix your currently problem without recompiling your kernel.
 
Old 02-17-2005, 02:22 AM   #11
isis
LQ Newbie
 
Registered: Oct 2003
Location: Saarland, Germany
Distribution: Slackware
Posts: 22

Rep: Reputation: 15
sure you can, but you can as well boot your system with the second slackware cd, which contains a rescue system.
 
Old 02-17-2005, 02:24 AM   #12
mcd
Member
 
Registered: Aug 2003
Location: Boulder, CO
Distribution: Slackware, RHEL, CentOS
Posts: 825

Rep: Reputation: 33
basically you just have multiple kernels lying around (usually in /boot), and you can create as many entries in your boot loader for as many kernels as you like. when you run make install a kernel image is created in /arch/1386/kernel/bzImage (read INSTALL, it'll be much more accurate about this than me). so you copy that to /boot, and hopefully name it something descriptive like vmlinuz-2.6.10, then you have to make a new entry in your boot loader (lilo or grub, either one) so next time you reboot, you get to choose between them.

whatever you decide to build as a module gets created and installed during make modules and make modules_install into /lib/modules/2.6.10/xxxx/xxxx/xxxx, pick a module that's listed when you type lsmod. slocate the module, and you should see module.o in your original kernel source directory (for me, 2.4.26) as well as a module.ko in /lib/modules/2.6.10/xxxxx. any of these modules that are executable can be inserted with modprobe.

now, these are not instructions. this is just to give you a general outline of what has to happen. make sure you read INSTALL and README in the kernel build directory, as well as the sticky threads on compiling kernels. those will tell you exactly which commands to type and all that.

Last edited by mcd; 02-17-2005 at 02:26 AM.
 
Old 02-17-2005, 02:25 AM   #13
vharishankar
Senior Member
 
Registered: Dec 2003
Distribution: Debian wheezy/sid, PC-BSD
Posts: 3,000
Blog Entries: 4

Original Poster
Rep: Reputation: 88
Thanks a lot. I'll look into both options.
 
Old 02-17-2005, 01:36 PM   #14
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 49
It looks like this is pretty well covered. Just wanted to show how I compile 2.6.x kernels, which is slightly different than some, but works great. I'll assume that you already have the source and have cd into the source directory:

Code:
make xconfig
Optionally, replace xconfig with menuconfig, config, gconfig, etc. This is of course where you choose all the options for your kernel, like what goes in, what stays out, what is compiled as a module. When you are done, a file called .config is created in your source directory. You can further tune your .config file manually with a text editor, but I don't recommend that method. Just something handy to know.
Code:
make bzImage
Creates a kernel based on your .config file and places it in arch/1386/kernel/bzImage .
Code:
cp arch/1386/kernel/bzImage /boot/vmlinuz-2.6.x
Copies your newly created kernel to /boot/vmlinuz-2.6.x

2.6.x is the name of the kernel I just compiled. Actually, any name will work. I just find that it is easiest to name a 2.6.10 kernel vmlinuz-2.6.10. Use any naming convention you like, just be consistent in naming the kernel, System.map, and config.
Code:
make modules
Creates all the modules that were specified in your .config file.
Code:
make modules_install
Moves all of the modules that you created over to /lib/modules/kernel_name where kernel_name is specified in your Makefile. kernel_name is actually $VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION . This can be handy to know, since $EXTRAVERSION can be used to make sure that you leave another compile of the same version kernel alone.
Code:
cp System.map /boot/System.map-2.6.x
Copies your System.map file to /boot/System.map-2.6.x. Again, this naming can be arbitrary, but should be the same convention that you used for the kernel.
Code:
cp .config /boot/config-2.6.x
Copies your .config file to /boot/config-2.6.x. Again, this naming can be arbitrary, but should be the same convention that you used for the kernel. This is not a required step, but it does put your config file somewhere easy to rememder in case you want to compile the same kernel again in the future. Some people even place a copy in their home directory with a more descriptive name. A handy use of this is the ability to quickly compile a custom kernel on a fresh install. You can always copy the config file over to your kernel source directory as .config and skip the first step.

If you like, at this point you are free to make symbolic links in /boot. It isn't necessary, and if it is done, care should be taken to make sure that your boot loader is configured properly, i.e. the stock kernel may have been pointing to symlinks, so make sure that the boot loader still points to valid kernel images.

All that is left at this point is to configure your boot loader. For LILO, that would mean editing /etc/lilo.conf and running /sbin/lilo. For GRUB, ????. That's the part I figure you know, right?
 
Old 02-17-2005, 02:43 PM   #15
Shagrath239
Member
 
Registered: Jan 2005
Location: Santiago, Chile
Distribution: Looking towards LFS
Posts: 67

Rep: Reputation: 15
Quote:
Originally posted by frieza
it should work without too much problem
for linux 2.6 kernels, the sequence is
make menuconfig (or Xconfig in X11)
make
make modules
make install
make modules_install
What do you mean?

The sequence was:

make menuconfig
make
make modules_install
make install


Im starting to get a little bit confused right 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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel compile on Mandriva. lilo.conf only shows Windows listing for boot? Kramer Mandriva 2 08-20-2005 06:03 PM
Kernel Compile Lilo Question megadeth Slackware 2 04-09-2005 05:00 PM
compile kernel when lilo.conf doesn't locate /etc... sirpelidor Linux - Software 2 01-31-2005 09:38 PM
Upgraded kernel, lilo.conf, didn't run /sbin/lilo dtashima Linux - Newbie 4 10-18-2004 11:21 AM
new kernel causes lilo crash; /sbin/lilo = Warning: device 0x0305 exceeds 1024 cylind dandysf Linux - Software 0 08-26-2003 04:50 PM


All times are GMT -5. The time now is 10:58 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
Open Source Consulting | Domain Registration