How To - Lilo!

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

How To - Lilo!

#1 Post by 01micko »

pizzasgood first (as far as I know) did a how to use Lilo to boot puppy frugally here. That info is still basically relevant but some things are obsolete. I will attempt to update that info here.

Why?

This guide is only useful if you have lilo already installed.

On one of my machines, Slackware is the main OS, it also has XP and Puppy, Currently, I have Slackware current installed and it is undergoing heavy development with the imminent release of Slackware-14.0. To keep up with the changes through the betas and RCs one has to run a series of commands using a slackware tool named slackpkg. This allows updating of the system and often Lilo needs to be reinstalled, wiping out the MBR and to boot puppy I need to either reinstate the MBR or run grub/grub4dos. It's a pain. So I decided to add Puppy to Lilo, that way Puppy boots after Lilo has done it's thing.

It doesn't have to be slackware, any distro that uses lilo as the boot loader will work the same.

Begin

WARNING: Proceed at own risk. If you make a mistake you may do damage to your other Linux install. TIP: Backup before you begin

First, we will assume that you are happy with the partitioning of your drive and that Puppy will be on a separate partition to your other Linux. If you already have a frugal you want to boot with lilo then skip the parts where you have to mount a CD/iso image. Instead copy from the frugal subdirectory vmlinuz and initrd.gz (see step 6 Appendix).
  • 1.Boot into the other Linux install. For demonstration's sake we will say this is on sda1 (hda if you have an old kernel). You do not have to be running GUI as I am going to run all the commands in terminal.

    2. At the console become root (superuser). If you don't know how to do this please do not attempt this because you can make your system unbootable if you are not careful. Typo's are no excuse.

    3. Insert a puppy CD into the CD drive and mount it. You can use just an iso image too. Just replace /dev/sr0 with /path/to/puppy.iso

    Code: Select all

    mkdir -p /mnt/pupcd #creates mount point
    mount -t iso9660 /dev/sr0 /mnt/pupcd -o loop #sr0 is the drive, may also be cdrom, sr1 etc
    You may get a warning about it being read only, ignore it.

    4. Mount the target partition and make a directory for the puppy files. For this example we assume sda2.

    Code: Select all

    mkdir -p /mnt/target #makes mount point
    mount -t ext4 /dev/sda2 /mnt/target #you will have to specify your own fs, ext2, 3, 4 etc 
    5. Make a target directory on the target partition for the puppy files, name it what you will, I'll call mine pupfrugal.

    Code: Select all

    mkdir /mnt/target/pupfrugal
    6. Copy the files from the CD to the target directory. At this point we can make a choice. Copy the lot or copy what's needed. Easy, copy the lot:

    Code: Select all

    cp -a /mnt/pupcd/* /mnt/target/pupfrugal  #takes a minute or so
    or copy what's needed. Strictly, vmlinuz and initrd.gz shouldn't need to be copied, but if you get tired of lilo you can easily revert to grub by copying them.

    Code: Select all

    ls /mnt/pupcd #just so you know what filenames to copy
    cp -a /mnt/pupcd/vmlinuz /mnt/target/pupfrugal
    cp -a /mnt/pupcd/initrd.gz /mnt/target/pupfrugal
    cp -a /mnt/pupcd/puppy_main_XXX.sfs /mnt/target/pupfrugal #this is what ever the main sfs is
    #optional if you have a zdrive
    cp -a /mnt/pupcd/zdrv_main_XXX.sfs /mnt/target/pupfrugal 
    # make the marker file
    touch /mnt/target/pupfrugal/ATAHD 
    We also have to put some files where lilo can find them. They need to be on the main Linux OS partition. We will make a directory to put them in. It can be whatever you want, even on the top level but I think that's untidy. We'll put the files in /boot in a subdirectory.

    Code: Select all

    mkdir -p /boot/puppy
    cp -a /mnt/pupcd/vmlinuz /boot/puppy
    cp -a /mnt/pupcd/initrd.gz /boot/puppy
    DO NOT install them directly to /boot!

    Appendix 6. If you have already a frugal you want to add to Lilo you can mount it and add the vmlinuz and initrd.gz to /boot/puppy

    Code: Select all

    mkdir /mnt/frugal #make mount point
    mount -t ext4 /sda2/myfrugalpup /mnt/frugal #replace sda2 and myfrugalpup with your partition number and frugal subdirectory
    cp -a /mnt/frugal/vmlinuz /boot/puppy 
    cp -a /mnt/frugal/initrd.gz /boot/puppy
    umount /mnt/frugal #cleanup
    rm -r /mnt/frugal
    7, Puppy is now installed, we just have to tell Lilo where it is. At this point we cleanup by unmounting everything and deleting mount points.

    Code: Select all

    umount /mnt/pupcd
    umount /mnt/target
    rm -r /mnt/pupcd
    rm -r /mnt/target
    eject #ejects CD, may need -t option, depends on HW, version of eject etc
    8. Open /etc/lilo.conf in a text editor. I'll use nano but you could use vi, emacs, whatever. We are going to append the details for booting puppy. At the bottom of the file put a comment:

    Code: Select all

    #Puppy install -start
    Then you need to point to the kernel image

    Code: Select all

    image = /boot/puppy/vmlinuz
    then point to initrd.gz

    Code: Select all

      initrd = /boot/puppy/initrd.gz
    then the label that appears in Lilo at first boot

    Code: Select all

      label = PuppyLinux
    then the target partition where you installed all the puppy files

    Code: Select all

      root = /dev/sda2
    now the kernel line, with the quotes, and you can add other stuff if you need to, but the psubdir is absolutely necessary

    Code: Select all

      append = "psubdir=pupfrugal"
    then lastly

    Code: Select all

      read-only
    and close out with a comment

    Code: Select all

    #Puppy install -end
    All up it should look like this:

    Code: Select all

    #Puppy install -start
    image = /boot/puppy/vmlinuz
      initrd = /boot/puppy/initrd.gz
      label = PuppyLinux
      root = /dev/sda2
      append = "psubdir=pupfrugal"
      read-only
    #Puppy install -end
    Save it!
    NOTE: of course if you already have a frugal and are just adding it use your directory and partition names!

    9. Update Lilo! We're almost ready. We just need to run lilo to update it. We'll use the -v (verbose) option.

    Code: Select all

    lilo -v
    10. That's it! Reboot.
End

Puppy will be in the menu at reboot and will hopefully boot. Just check everything is ok with the other OS on boot and you should be all good.

Changes

V2: added extra info for existing frugal install
Attachments
lilo_howto-V2.rtf.tar.gz
Printable document in Rich Text Format, 4 pages
(4.07 KiB) Downloaded 422 times
Puppy Linux Blog - contact me for access

User avatar
Griot
Posts: 131
Joined: Fri 12 Sep 2014, 18:10
Location: Serbia

#2 Post by Griot »

Hi, 01micko & folks.

Does this HOWTO still applies for installing, e.g. Slacko64 or Fatdog64-701?
Cheers!

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#3 Post by 01micko »

Griot wrote:Hi, 01micko & folks.

Does this HOWTO still applies for installing, e.g. Slacko64 or Fatdog64-701?
Cheers!
Yup!

I even scripted it.. I'll attach it when I find it, tested by a noted Slacker - Ryan McQuen.
Puppy Linux Blog - contact me for access

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#4 Post by rufwoof »

I seem to recall installing LILO many many years ago - and then having great difficulty 'uninstalling' it. Think I installed it into the MBR or something like that and in those 9600 baud modem dial up days it took a lot of time (and a big phone bill) to get the answer off the bulletin boards.

User avatar
ttuuxxx
Posts: 11171
Joined: Sat 05 May 2007, 10:00
Location: Ontario Canada,Sydney Australia
Contact:

#5 Post by ttuuxxx »

Hi guys I just deleted a bunch of "Off Topic post on this thread do to a request from micko" Please stay on topic, this is a Lilo thread not a grub2, grub4dos, pxe, etc thread.
ttuuxxx
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games :)

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#6 Post by 01micko »

As promised, here is my script to install lilo.

NOTE: this is designed for single boot only of a slacko/slacko64 full install system. It is ideal for a VM.

It will clobber any other boot loader that you have installed.

Have fun :)

UPDATE: BTW, this script is designed to work from the live CD where you just made a full install (it chroot's into the full install and installs lilo).
Attachments
lilo-install.sh.gz
# gunzip lilo*
# chmod 755 lilo*
# ./lilo-install.sh
(1.43 KiB) Downloaded 156 times
Puppy Linux Blog - contact me for access

User avatar
Griot
Posts: 131
Joined: Fri 12 Sep 2014, 18:10
Location: Serbia

#7 Post by Griot »

Nice. Thanks, Mick.
I'll probably try it someday.
At the moment, frugal works just fine. :cheers:

Post Reply