On Mon, Jul 07, 2008 at 01:18:22AM -0700, David Barrett wrote: > Andrei Popescu wrote: >> On Sun, Jul 06, 2008 at 11:34:52PM -0700, David Barrett wrote: >>> Carl Fink wrote: >>>> On Sun, Jul 06, 2008 at 09:00:38PM -0700, David Barrett wrote: >>>>> David Barrett wrote: >>>>>> What's the best way to create a raw disk image using >>>>>> debootstrap that can be booted with qemu? >>>>> Following up on my previous post: I've figured out some of the >>>>> steps, but I'm stuck on installing Grub. Do you know how to >>>>> install grub on a raw device file? >>>> Forgive a silly question, but why do you want to install grub on >>>> the image? Are you planning to dd it onto a physical disk? >>> No, I'm just going to use it as a QEMU image. It'll stay virtual, >>> but it'll need to boot all the same. Unless there's some way to get >>> it to boot without grub? >> >> If I recall correctly, qemu can boot a linux kernel directly so you >> *probably* don't need grub. > > Aha! I completely forgot about those options. This works great: > > sudo qemu -kernel-kqemu -kernel newtest.mount/boot/vmlinuz-2.6.18-6-486 > -append "root=/dev/hda1 ro" -initrd > newtest.mount/boot/initrd.img-2.6.18-6-486 newtest.raw > > It makes the command line a bit awkward, but does the trick. This is > great workaround, thanks! > > That said, if possible, I'd still like to get grub installed to make it > self-contained and boot up like normal (else I need to update all the > startup scripts to be aware of the exact kernel version).
can you not use the grub floppy disk image and just cat it into the boot sector? Another idea: write a script to install grub from a chroot, copy that script into the image, and then chroot in and run that script from your other script. or: make a barebones image with grub installed by some other non-automated method and then use that bare image as the starting point for your script, eliminating the dd step. just .02 A
signature.asc
Description: Digital signature