How to install grub into an .img file?
- by Francesco Turco
I did the following:
created an empty .img file with dd
associated it to /dev/loop0 with losetup
created a partition in it with fdisk
formatted such partition with mke2fs
copied a custom GNU/Linux system into that partition
Now I'd like to make the .img file bootable by installing grub into its MBR and /boot directory. My goal is to load the .img file with qemu. It would be better if grub2 is used instead of grub legacy.
Thanks.