- How to use lilo on a file
- Posted by Frank Fox on July 16th, 2003
I want lilo to install itself on a filesystem in a file.
Example:
dd if=/dev/fd0 of=boot.img bs=10k count=144
mkfs.minix boot.img
mount boot.img /mnt -o loop
cp -p -R bootdisk/* /mnt
At this point I want lilo to install itself in boot.img.
I've tried:
lilo -v -C bdlilo.conf -r /mnt
But that does,nt work.
But if I:
dd if=boot.img of=/dev/fd0
mount /dev/fd0 /mnt
lilo -v -C bdlilo.conf -r /mnt
umount /mnt
dd if=/dev/fd0 of=/boot.img
Now I've got what I want. Lilo is installed on boot.img.
How do you get lilo to install itself on to loopback filesystem.
Frank Fox
- Posted by Eric Moors on July 16th, 2003
On Wed, 16 Jul 2003 08:58:19 +0200, Frank Fox wrote:
Where is bdlilo.conf located?
I'd try `lilo -v -b boot.img`
or fix your bdlilo.conf.
(untested)
Eric
- Posted by Peter T. Breuer on July 16th, 2003
Frank Fox <ffox@optusnet.com.au> wrote:
Well, I understand what you mean, but your dicourse below itself is
unclear ...
Example of what? You haven't explained anything yet, so how can it be
an example? Are you expecting me to reverse engineer your implementation
below back into a design specification? If so, I normally require pay!
you copy a floppy to a file
errr .. and now you format it. Why? What was the point of copying it if
you are now going to write all over it!
you mount it loopback and copy some files to the root of the FS you made.
What's that an example of? Be clear, man! Unplug your expressive
orifices.
It could, but there wouldn't be any point, since the bios couldn't boot
it. Why not install it on the floppy instead? Then copy the result to
the image.
lilo doesn't know what to do with loopback devices, unsurprisingly.
You'd surprise me if you told me what boot code it was supposed to use
to boot off the files you placed inside it. This might work if your
bdlilo.conf had enough sophistication inside, so that lilo didn't have
to know anything about the loopback device.
What "that"? You didn't show the bdlilo.conf!!!
Learn to express yourself. You mean "I copy the FS I just made to the
floppy". And then I suppose you run lilo ...
yes.
No, it isn't. You have written some nonsense to boot.img that happens
to make sense in the context of a floppy, but without the bdlilo.conf
we can't even SEE if it makes sense in the context of a loopback
device. The answer is probably NOT, since the bootloaders and maps will
probably be defined by your bdlilo.conf to be on the current device,
which is the loopback device, which the bios cannot boot.
You MIGHT have a chance if you specifically set the map file and
the kernel to be on the floppy. You might also have some success
if you choose the bios codes (0x80, etc.) explicitly, thus fixing
lilos doubts about what boot code to make.
Experiment and tell us.
The statement is nonsensical. Where is the kernel, lilo map, lilo
boot sector, etc located? Those are what you want to install!
Peter
- Posted by Frank Fox on July 16th, 2003
Frank Fox wrote:
OK so made a mistake, line above should be:
dd if=/dev/zero of=boot.img bs=10k count=144
I want to install lilo on a floppy image, so so that I can write the
image to a floppy and make a bootdisk. Yes I know that you can write the
image first and then install lilo on /dev/fd0. But I don,t want that.
I want to create a bootable floppy image on my harddrive.
Frank Fox
- Posted by Peter T. Breuer on July 16th, 2003
Frank Fox <ffox@optusnet.com.au> wrote:
Then you'll have to show us the lilo.conf. I don't know offhand how you
can do it, but if you show me yours I can at least tell you what's
obviously wrong with it, and then you can go and research how to correct
that.
Peter
- Posted by Frank Fox on July 16th, 2003
This is the lilo.conf that I use for my bootdisks.
boot=/dev/fd0
append="root=/dev/hda1 hdc=ide-scsi video=vesa:mtrr"
vga=0xf07
root=/dev/fd0
backup=/dev/null
compact
image=/boot/bzImage
read-only
Frank Fox
- Posted by Peter T. Breuer on July 16th, 2003
Frank Fox <ffox@optusnet.com.au> wrote:
That's wrong. The target for the boot sector is /dev/loop0.
Unfortunately for you, /dev/loop0 is not an inherantly partitionable
device, so I don't know where that would be written. I'd make sure that
your FS started at an offset leaving the first sector clear.
Well, that's wrong for a start, since the image is on your loop device,
and so the address of the loop device would be placed in the boot
sector. But the bios can't boot the loop device, and lilo doesn't know
what bios code to use for it either!
You want to tell lilo that the image is on the floppy device.
You are missing the same kind of treatment for the map file.
And then you will have to find some way of specifying the bios
code by hand. I'd try something like
disk=/dev/loop0
bios=0x80
which may well cure things on its own.
Peter
- Posted by johninsd at san dot rr dot com on July 20th, 2003
The "mkrescue" script, part of the LILO distribution, does exactly that when
you use the "--fast" option. I suggest you take a look at this script.
If it did not come with your Linux distro, you can get it from the LILO source
distribution available through the links at http://freshmeat.net/projects/lilo
--John
On Wed, 16 Jul 2003 16:58:19 +1000, Frank Fox <ffox@optusnet.com.au> wrote:
LILO version 22++ links at:
http://freshmeat.net/projects/lilo