2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2025-12-14 15:03:12 +00:00

arm64 support with grub-efi

* build / convert: add `--platform` flag to support linux/amd64 &
linux/arm64
* build: add `--pull` flag
* run/hetzner: add `--type` flag to select server type
* run/hetzner: add `--location` flag to select server location

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2023-09-13 15:37:29 +02:00
parent f8fc729486
commit d54b3f9a2c
29 changed files with 197 additions and 83 deletions

View File

@@ -23,6 +23,7 @@ import (
type grubEFI struct {
*grubCommon
arch string
}
func (g grubEFI) Validate(fs BootFS) error {
@@ -41,7 +42,7 @@ func (g grubEFI) Setup(ctx context.Context, dev, root string, cmdline string) er
return err
}
defer clean()
if err := g.install(ctx, "--target=x86_64-efi", "--efi-directory=/boot", "--no-nvram", "--removable", "--no-floppy"); err != nil {
if err := g.install(ctx, "--target="+g.arch+"-efi", "--efi-directory=/boot", "--no-nvram", "--removable", "--no-floppy"); err != nil {
return err
}
if err := g.mkconfig(ctx); err != nil {
@@ -54,11 +55,11 @@ type grubEFIProvider struct {
config Config
}
func (g grubEFIProvider) New(c Config, r OSRelease) (Bootloader, error) {
func (g grubEFIProvider) New(c Config, r OSRelease, arch string) (Bootloader, error) {
if r.ID == ReleaseCentOS {
return nil, fmt.Errorf("grub-efi is not supported for CentOS, use grub-bios instead")
}
return grubEFI{grubCommon: newGrubCommon(c, r)}, nil
return grubEFI{grubCommon: newGrubCommon(c, r), arch: arch}, nil
}
func (g grubEFIProvider) Name() string {