From: Werner Almesberger (almesber@nessie.cs.id.ethz.ch)
Date: 10/14/92


From: almesber@nessie.cs.id.ethz.ch (Werner Almesberger)
Subject: Re: Booting off hard drive
Date: Wed, 14 Oct 1992 18:06:36 GMT

In article <1992Oct10.231956.7917@cs.tulane.edu> kranz@cs.tulane.edu (Barry Kranz) writes:
> cd /mnt/etc/lilo

> rm map boot.????

I wouldn't do that. LILO overwrites old files automatically if needed and
boot sectors are small enough that you can afford to have some obsolete
ones sitting around.

Deleting an existing and valid map file before running the map installer
may also make your system unbootable if you reboot after the map
creation has begun but before it has been successfully completed,
because the map installer may overwrite blocks of the (deleted) old map
file in the process.

> ./lilo -r /mnt -b /dev/hdxx -i boot.b -v -v -v /vmlinux
>
> That was the end of the instructions. It was now supposed to boot from hdxx.

I think your problem is caused by "-i boot.b" in conjunction with "-r".
-r does a chroot system call, which changes LILO's view of the entire
file system. Unfortunately, -i boot.b uses a relative path, which is
unaffected by chroot. LILO therefore picks boot.b from the floppy disk.
(It should boot if you insert the floppy you were using at that time,
though.)

  ./lilo -r /mnt -b /dev/hdxx -i /etc/lilo/boot.b -v -v -v /vmlinux
                                 ^^^^^^^^^^
... should have the desired effect.

I'll add a chdir("/") or chdir(LILO_DIR) in the next version of LILO so
that one will at least get an error in this situation.

Just as a general reminder: putting the invocation of the map installer
(/etc/lilo/lilo) into a file /etc/lilo/install may save you some grief
at the next kernel update, because you then only have to run
/etc/lilo/install instead of remembering what options and parameters
you were using. Example:

#!/bin/sh
$ROOT/etc/lilo/lilo -b /dev/hdxx -i /etc/lilo/boot.b -v -v -v $* \
  /vmlinux

($ROOT to make it easier to run /etc/lilo/install from a boot floppy
and $* to pass additional options if needed.)

- Werner

-- 
   _________________________________________________________________________
  / Werner Almesberger, ETH Zuerich, CH      almesber@nessie.cs.id.ethz.ch /
 / IFW A44  Tel. +41 1 254 7213                 almesberger@rzvax.ethz.ch /
/_BITNET:_ALMESBER@CZHETH5A__HEPNET/CHADNET:_[20579::]57414::ALMESBERGER_/