QEMU and Grub.
I've asked this question in the past and just havn't been able to get an answer with a solution, or if I can even do what I want to do so I'm going to throw it out here again.
I have a QEMU/KVM environment with flat disk images, no partitioning, no MBR, just a ext filesystem. These instances are not all the same and are running different OS's (RHEL, Ubuntu, etc). I'm wanting to boot these instances using grub, it's configs, and modules from the disk just the way it would if grub was installed onto the disk. So far I've been building grub images using grub-mkimage -O i386-pc -o grub.img biosdisk ext2 normal -p '(hd0)/boot/grub' and using the -kernel option with QEMU.
This does work but not always. There are some situations where i'm
seeing errors like this.
unaligned pointer 0x684355af
Aborted. Press any key to exit.
The reason I want to load grub, it's modules, and config from the disk is that distributions like redhat have decided to create modules like blscfg that are not part of grubs core and I need my grub image to load those from the disk so that the instance boots correctly.
Can I do what I'm wanting to do? If so, how? I don't want to have to build a bunch of grub versions to match each OS.
--
Shaun Reitan
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
GRUB kernel doesn't have a stable interface. So it's not supported to mix kernel and modules from different sources. What I do in your case is that I use upstream kernel and modules with few patches to add blscfg. Those patches are currently in review upstream
Regards
Vladimir 'phcoder' Serbinenko
Le sam. 7 juin 2025, 03:00, Shaun Reitan <[email protected]> a écrit :
Quoted 30 lines
I've asked this question in the past and just havn't been able to get an answer with a solution, or if I can even do what I want to do so I'm going to throw it out here again.
I have a QEMU/KVM environment with flat disk images, no partitioning, no MBR, just a ext filesystem. These instances are not all the same and are running different OS's (RHEL, Ubuntu, etc). I'm wanting to boot these instances using grub, it's configs, and modules from the disk just the way it would if grub was installed onto the disk. So far I've been building grub images using grub-mkimage -O i386-pc -o grub.img biosdisk ext2 normal -p '(hd0)/boot/grub' and using the -kernel option with QEMU. This does work but not always. There are some situations where i'm seeing errors like this.
unaligned pointer
0x684355af
Aborted. Press any key to exit.The reason I want to load grub, it's modules, and config from the disk is that distributions like redhat have decided to create modules like blscfg that are not part of grubs core and I need my grub image to load those from the disk so that the instance boots correctly.
Can I do what I'm wanting to do? If so, how? I don't want to have to build a bunch of grub versions to match each OS.
--
Shaun Reitan
Quoted 5 lines
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel