LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-24-2004, 07:43 PM   #1
netstv
Member
 
Registered: May 2004
Location: Martinez, CA
Distribution: Ubuntu
Posts: 38

Rep: Reputation: 15
LILO question (I hope this is a little advanced)


Hello all.

I have a problem that I need to solve. Here is the problem. We have an embedded Linux system that needs to support multiple linux kernel images.

My system boots using a Compaq Flash disk and currently only holds 1 image. This image is my complete linux kernel. However, being the great programmer that I am, I just screwed up my last kernel build and so it no longer works. Thank god for testing!

Here is how I currently upgrade my system.

1. I remount the boot partition for read/write.
2. cd to the root directory.
3. untar my new image
4. run lilo with all the right options
5. reboot.

This all works great for my one Linux operating system. However, I want to be able to have a fallback in case I totaly flub it like I just did.

So what I don't get is how can I get two fully functional systems and have LILO pick the right one. That is, if the "default" one fails, I want to have the fallback. Is it just having two different mount points in my lilo.conf file? What about having the run LILO for each new kernel version?

I hope I made this clear enough.
Any help is greatly appreciated!

-stv
 
Old 05-25-2004, 06:39 AM   #2
uveraser
Member
 
Registered: Dec 2003
Location: Tavistock, Devon, England
Distribution: Slackware 9.1, LFS 5.0, Mandrake 9.0/9.1/10.0, Knoppix 3.1, Windows 98SE, Windows XP Pro
Posts: 37

Rep: Reputation: 15
My knowledge is quite limited in this area, but hopefully this should get you started. I already dual boot Windows and Linux and am planning to boot other operating systems as well (in the very near future). Thinking about it, I was using Mandrake until recently, and that booted different kernels from the same drive. I don't get exactly how your boot setup works with the flashdisk and all, but I'll tell you how I have it set up.

My hard drive is partitioned into four parts.
1. hda1- Windows XP (NTFS)
2. hda5- Slackware root partition (ext3)
3. hda6- Linux SWAP drive
4. hda7- Currently unused. Will eventually be used for a second linux distro (LFS or Mandrake or something) or possibly BSD.

The bootloader (LILO) is installed in the master boot record of the hard disk. This means that it overwrites the windows bootloader, which is very helpful! My lilo.conf file currently has two boot images defined (in addition to all the global stuff). Here is a sample lilo.conf file on found on the internet (it isn't mine).

boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=firewall
image=/boot/vmlinuz-2.2.14-5.0
label=ker2214
read-only
root=/dev/hda9
image=/boot/vmlinuz-2.2.17-14
label=ker2217
read-only
root=/dev/hda9
#image=/usr/src/linux/arch/i386/boot/bzImage
# label=myker
# root=/dev/hda7
# read-only
image=/boot/bzImage.myker.11feb2001
label=myker11feb
root=/dev/hda9
read-only
image=/boot/bzImage.myker.01jan2001
label=myker01jan
root=/dev/hda9
read-only
image=/boot/bzImage.myker-firewall.16mar2001
label=firewall
root=/dev/hda9
read-only

Notice that there a several kernel images all in the same directory on the same drive. If you want to run two very different systems (i.e. Slackware and Mandrake) it is much easier to use different partitions (or even different drives), but it sounds like you just want to have different kernel images, as above. Because lilo is stored in the boot sector of the hard drive, it does not matter which partition you use to run lilo (as it is only copying it).

I hope this helps- best of luck
Simon
 
  


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
Simple Question (I hope) jon3k Linux - General 3 04-13-2005 02:51 PM
Advanced Lilo dual boot help Ruzhyo Linux - General 4 05-15-2004 12:37 AM
advanced LILO question ridesideways Linux - General 8 03-26-2004 07:20 PM
I hope this is not such a stupid question! angmaya Linux - Newbie 3 10-17-2003 11:59 PM
LILO (Advanced).. concoran Linux - General 2 08-14-2002 01:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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