How can I support other distros in LILO with its Kernel ?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
su -
mkdir /mnt/hda2
mount -t ext3 /dev/hda2 /mnt/hda2
mcedit /etc/lilo.conf
lilo
Then what ?
It will still use Slackware kernel at boot time.
And what is "proper entry" ?
Thank you.
Do
Code:
man lilo.conf
The man file for lilo.conf has an example of how to use lilo to boot OS2, DOS and Windows 98 as well as Linux.
The paragraph "Per-Image Section" describes how to boot a Linux kernel. You must supply a pathname to the kernel image. It doesn't have to be a Slackware kernel, it can be any kind of Linux kernel.
Another thought. Each of your distros needs to have its kernel started with a different root partition (you know, the partition that contains the / directory for that distro). Look closely at the examples in the lilo.conf man page. One of them shows how to use the root= kernel boot option to start up kernels with different root partitions.
Try installing the grub boot loader, it works great either by direct or by chainload, other Linuxes and Windows. I have one main grub installed on the master boot record, and other Linux have grub installed on their boot sector of their root partitions, which then allows chainload booting to the other grubs. Then just edit your grub menu.lst file to add or to update other Linux installed, (or the grub.conf file in Fedora) And here is the main site link: http://www.gnu.org/software/grub/grub.en.html
Ok, I'll do like this:
...It will still use Slackware kernel at boot time.
And what is "proper entry" ?
As DavidHindman pointed out, the lilo man page is the best reference for you.
But I'll try to fill in some blanks for you quickly here.
First, the reason for mounting the other partition is this: At boot time there is no concept of a filesystem and therefore no way to express the path to any kernel other than absolute location on the disk media (ie, head, cylinder, sector). Lilo 'calculates' this position and writes this to the boot record based on the path specified in lilo.conf. But to do that the partition on which the kernel is stored must be mounted when you run lilo to write the boot record.
So, using your own example, mount hda2 at /mnt/hda2, then add something like this to your lilo.conf:
Be sure 'vmlinuz' in the example is the actual filename of the kernel you want to run.
Then, when you run lilo it will be able to find the other kernel, figure out it's physical location on disk and write that to the boot sector with the label 'OtherLinux'.
Then when you boot and choose 'OtherLinux' it will load the other kernel which will (presumably) mount the filesystem at /dev/hda2 as it's root filesystem - ie, a running Linux system.
...because he will end up booting the Slackware kernel using his other Linux's root filesystem - which is the very problem he is trying to solve.
He must first mount the other filesystem then provide the path to the target kernel through the mount point, that is, the path when lilo is run - not the expected boot time path as that cannot exist until after the kernel is running. That is the essence of what boot, ie 'bootstrap', means.
You can set lilo to boot more than one distro/version each with its own kernel but you need to provide the correct path from the partition/file system on which your /etc/lilo.conf is which also the filesystem/partition from which you run the command lilo.
For example in the two stanzas below I am running lilo from slackware 12.2 on /dev/hda3 and lilo will look for the slackware-12.1 kernel where it is mounted from in 12.2, i.e. /mnt/hda1/boot/vmlinux and the root (directory) for 12.1 is located on /dev/hda1
If your other linux's bootloader (grub or lilo) is in its root partition, and Slackware's lilo is in the MBR, just add this to Slackware's /etc/lilo.conf:
Code:
other = /dev/hda2
label = other
Replace "other" with the distro name. Then run lilo as root.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.