LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 02-28-2007, 09:02 AM   #1
coldbeer
Member
 
Registered: May 2006
Location: Orion–Cygnus Arm, MWG
Distribution: Slackware, Ubuntu
Posts: 249

Rep: Reputation: 130Reputation: 130
Kernel compile and LILO question


I have lilo.conf all setup for my new compiled kernel and I have run /sbin/lilo to install it. I am trying to get my new compiled kernel to work so after I create the bzImage and System.map and copy them to /boot; do I need to rerun lilo?

I keep reading statements like this on the web:

"You must re-run lilo even if entry 'mykernel' exists, everytime you create a new bzImage."

Question: What is /sbin/lilo doing such that I need to re-run it even though my lilo is already setup up correctly and I just copy in a new bzImage to /boot??
 
Old 02-28-2007, 10:01 AM   #2
fourchannel
Member
 
Registered: Jul 2006
Location: Tuscaloosa, AL - USA
Distribution: Gentoo
Posts: 30

Rep: Reputation: 15
When you run lilo, it builds a new boot image for the computer to use when it starts. As long as the kernel you replace has the exact same name, you should be able to simply overwrite the file.

Unlike Grub, lilo needs to be rebuilt after each modification to the configuration or filenames, but not to data within the files.

With grub, instead of rebuilding the image everytime, you build the boot loader and tell it to read a file for configuration. From that point on, you simply edit the file with a text editor.
 
Old 02-28-2007, 10:12 AM   #3
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
LILO needs to know the cyl/head/sector address of the kernel and initrd (if used) on the drive. This can change when you generate a new image. The reason it needs to know is because it does its setup at LILO time, not at boot time. It doesn't use ext2/reiser/whathaveyou when booting.

Conversely, GRUB accesses the file system through the ext2/reiser/whathaveyou at boot time, so as long as he knows the path he can find your new kernel, etc. This means that GRUB has to support your filesystem or he can't boot your system directly.

Both of these methods have their plusses and minuses. I personally prefer LILO and rerunning it is so trivial it doesn't bother me.
 
Old 02-28-2007, 10:14 AM   #4
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Quote:
Originally Posted by fourchannel
When you run lilo, it builds a new boot image for the computer to use when it starts. As long as the kernel you replace has the exact same name, you should be able to simply overwrite the file.
If the new image gets saved at a different c/h/s LILO won't be able to boot it. The name is really not the issue, it's the location on the drive.
 
Old 02-28-2007, 10:16 AM   #5
PeterPhilpott
LQ Newbie
 
Registered: Nov 2005
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by coldbeer
Question: What is /sbin/lilo doing such that I need to re-run it even though my lilo is already setup up correctly and I just copy in a new bzImage to /boot??
When the computer boots up it doesn't know which filing system or operating system is in use. So there are no directories or filenames at this time only a disk with sectors.
All it knows it to look at a small area of disk, load the data into memory and attempt to run the program. This program is the boot loader and in this case it is the lilo boot loader.
In the same way, when the lilo boot loader runs it doesn't know which filing system or operating system is in use so it can't find lilo.conf. It can't find the kernel image either by file name but it has information on where the kernel file is on the disk. This information is given to it when /sbin/lilo is run.
So if you create a new kernel image and copy it to /boot with the same name as the old image it might not be in exactly the same place on the disk as before nor might it be the same size.
But when you run /sbin/lilo it looks at lilo.conf and then recreates the boot loader with the location of every kernel image referenced in lilo.conf.

Last edited by PeterPhilpott; 02-28-2007 at 10:17 AM.
 
Old 02-28-2007, 12:57 PM   #6
coldbeer
Member
 
Registered: May 2006
Location: Orion–Cygnus Arm, MWG
Distribution: Slackware, Ubuntu
Posts: 249

Original Poster
Rep: Reputation: 130Reputation: 130
Talking

Excellent! Thank you all for helping me understand this.
 
  


Reply



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



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
How to compile a new kernel *without* installing LILO vharishankar Slackware 20 02-19-2005 03:17 AM
compile kernel when lilo.conf doesn't locate /etc... sirpelidor Linux - Software 2 01-31-2005 09:38 PM
Lilo/kernel question & font question phek Linux - General 9 09-18-2001 12:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:54 AM.

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
Open Source Consulting | Domain Registration