Closed zacksiri closed 2 years ago
This script supports only Syslinux and images without partitions for simplicity.
What cloud providers require specific bootloader to be used? Did you verified that image with Syslinux really doesn't work here?
I tried it on google compute engine, they seem to need grub. Yes I can verify syslinux doesn’t work, I created an image by hand using the iso and qemu, set it up to use grub / mbr and it worked great.
I encountered a problem with using these disk images with my libvirt+qemu installation. It seems that the hypervisor's SeaBIOS can only boot from a harddrive image if there is an MBR partition table. It does work if I configure my VM to use the disk image as a "cdrom", which is still somehow writable but not intuitive.
I added support with PR #11 to build an MBR partition, which seems to work for me but I am welcome to review and feedback!
@jirutka so what is your decission? Will MBR + Grub supported to be accepted to this tool if someone comes with PR or are we forced to start maintaining fork with those features? (I can see that #11 have been there for a while waiting for review).
Also nowadays Google Cloud, Azure and Amazon EC2 supports UEFI + Grub combination which why I think that this tool should have support for three modes: Syslinux without partitions (current/default), BIOS + MBR + GRUB and UEFI + GPT + GRUB.
I'm planning to start utilize this tool and can also contribute to it as it after all quite good baseline but honestly I'm bit disappointed to see that this issue have been open here already three year without any decission...
EDIT: Alternative solution would be move all functions to separate file which would allow people to create customized version of alpine-make-vm-image but still use most of the logic from here. I opened #24 for that discussion.
Partitions are completely unnecessary in VMs, it doesn’t make any sense to use them in this environment (maybe except UEFI?). I know that there are some cloud providers with a broken setup that foolishly require a partition table – the users should first complain there, not require adding an unnecessary feature into this script.
However, I’m a realist, so I’m not against adding support for GPT (MBR is obsolete) but only as an alternative to the current approach (i.e. a new CLI option), not as a replacement.
About UEFI – I’d like to add support for UEFI, but preferably using Syslinux, not bloated GRUB. However, I don’t have enough experience with UEFI in VMs environment and don’t have a good enough motivation to invest my time into it right now. However, if you prepare a pull request that will respect the spirit of this project (simplicity), I’ll gladly accept it.
Partitions are completely unnecessary in VMs, it doesn’t make any sense to use them in this environment (maybe except UEFI?).
Yes, UEFI needs partitions (or maybe it would be possible to have UEFI firmware on separate disk).
About UEFI – I’d like to add support for UEFI, but preferably using Syslinux, not bloated GRUB.
As far I know Syslinux UEFI support it very limited and have a lof ot drawbacks. That is probably reason why also alpine-virt iso file uses GRUB when VM is booted on UEFI mode.
Alternatively it should be possible boot Linux kernel directly from UEFI by using EFI Stub feature.
However, I don’t have enough experience with UEFI in VMs environment and don’t have a good enough motivation to invest my time into it right now. However, if you prepare a pull request that will respect the spirit of this project (simplicity), I’ll gladly accept it.
Ok. Good to know but it started to feel that scope of this tool is too narrow for my needs (I want to be able to create disk images which works on both VMs and bare metal) and as both my proposals (#24 and #26) about how to make possible to use those functions on other tools was rejected then I probably will just copy useful part of this code and create my own version it.
That is probably reason why also alpine-virt iso file uses GRUB when VM is booted on UEFI mode.
I think that it’s mainly for historical reasons (but not sure) – Syslinux added support for UEFI quite late.
Alternatively it should be possible boot Linux kernel directly from UEFI by using EFI Stub feature.
:+1:
…as both my proposals (#24 and #26) about how to make possible to use those functions on other tools was rejected…
The first proposal completely ignored the preferred way of using this script described in the Readme, so it would introduce an unwanted breaking change for the users. The second proposal would break the script on some shells (e.g. Bash); moreover, it even didn’t make sense.
Maybe it will be better if you just describe what exactly do you need and write some examples of how to deal with UEFI, and if it will make sense and wouldn’t add too much complexity to the script, I will implement it.
Hey as the title says, some cloud providers require that grub be setup with the disk image.