Index of /kvm

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[   ]shaun-reitan-grub.tar.xz2023-01-23 20:39 532K 
[TXT]README.shaun2023-02-21 14:59 2.1K 
[IMG]kchm_al8_apr22.png2022-04-03 13:41 551K 
[   ]grub-shaun-qemu.img2022-03-29 11:08 265K 
[   ]grub-i386-pc.bin2022-03-26 14:50 425K 

About
---
qrub-shaun-qemu.img

this is a grub2 kernel for use in qemu-kvm, especially where your filesys has no
partition and you don't want to install grub2 in the MBR.

The scheme is due to Shaun Reitan and was posted to the GNU help-grub ML:
https://lists.gnu.org/archive/html/help-grub/2017-02/msg00008.html

It supports the grub2 legacycfg driver (legacy_configfile) and I use it when the
qemu VM has legacy grub in /boot/grub/menu.lst.

Author
---
PryMar56
Apr 20222

Hi Andrei,

OK, i got it to work but it was a process and i'm still not sure it's 100% right. Here's what I did....

# Created grub-bootstrap.cfg
normal (memdisk)/grub.cfg
# Created grub.cfg
for grubcfg in /boot/grub2/grub.cfg /boot/grub2/grub2.cfg /boot/grub/grub2.cfg /boot/grub/grub.cfg /grub2/grub2.cfg /grub/grub.cfg /etc/grub2.cfg /etc/grub.cfg ; do

       if search -s -f $grubcfg ; then
               echo "Reading (${root})$grubcfg"
               sleep 1
               source $grubcfg
               break
       fi
done

# Created a memdisk
mkfs.msdos -C memdisk.fat 64

# Copied grub.cfg into the memdisk
mcopy -i memdisk.fat grub.cfg ::grub.cfg

# Built grub2 as a kernel image

./bin/grub-mkimage -O i386-pc -o grub.img -c grub-bootstrap.cfg -m memdisk.fat -p /boot/grub all_video boot btrfs cat chain configfile echo ext2 fat font gettext gfxmenu gfxterm gfxterm_background gzio halt hfsplus iso9660 jpeg keystatus loadenv loopback linux memdisk minicmd normal part_apple part_msdos part_gpt password_pbkdf2 png reboot search search_fs_uuid search_fs_file search_label sleep squash4 test true video zfs zfscrypt zfsinfo biosdisk echo linux linux16


# Started QEMU

qemu-system-x86_64 -vnc 0.0.0.0:0 -drive file=/dev/mapper/storage1-vm1,if=none,id=hd,format=raw -device virtio-scsi-pci,id=scsi -device scsi-hd,drive=hd -kernel ./grub.img



So far it boots, searches for a grub config in multiple locations and loads the first one it finds. Everything here look good/ok to you? Any advice or recommendations? I know you originally wanted me to use grub-mkstandalone, not sure if there's any difference, advantage, disadvantage to the way i did this...


Thanks for your help!

--
Shaun R