From c9b3c530be18ea16e0ac3c9a2db74c4d903323a5 Mon Sep 17 00:00:00 2001 From: "K.B.Dharun Krishna" Date: Wed, 20 Sep 2023 05:46:51 +0530 Subject: [PATCH 1/2] feat: ci - bump actions/checkout to v4 --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e10855e3..68fa7ca5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -13,7 +13,7 @@ jobs: container: ghcr.io/vanilla-os/pico:main steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v4 From 87b1f63dc8f7000552e18eef0150def6474af940 Mon Sep 17 00:00:00 2001 From: Mateus Melchiades Date: Fri, 13 Oct 2023 19:10:51 -0300 Subject: [PATCH 2/2] fix:[close #27] Set Grub loader EFI path --- core/grub.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/core/grub.go b/core/grub.go index cea91d58..39505a04 100644 --- a/core/grub.go +++ b/core/grub.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "path/filepath" + "regexp" "strings" ) @@ -107,7 +108,7 @@ func RunGrubInstall(targetRoot, bootDirectory, diskPath string, target FirmwareT } } - grubInstallCmd := "grub-install --boot-directory %s --target=%s --uefi-secure-boot %s" + grubInstallCmd := "grub-install --bootloader-id=debian --boot-directory %s --target=%s --uefi-secure-boot %s" var err error if targetRoot != "" { @@ -119,6 +120,22 @@ func RunGrubInstall(targetRoot, bootDirectory, diskPath string, target FirmwareT return fmt.Errorf("Failed to run grub-install: %s", err) } + if targetRoot != "" { + return nil + } + + // FIXME: This is needed on Vanilla due to some recent GRUB change. If you're using Debian sid as + // base, consider keeping it. + efibootmgrCmd := "efibootmgr --create --disk=%s --part=%s --label=vanilla --loader=\"\\EFI\\debian\\shimx64.efi\"" + diskExpr := regexp.MustCompile("^/dev/[a-zA-Z]+([0-9]+[a-z][0-9]+)?") + partExpr := regexp.MustCompile("[0-9]+$") + diskName := diskExpr.FindString(diskPath) + part := partExpr.FindString(diskPath) + err = RunCommand(fmt.Sprintf(efibootmgrCmd, diskName, part)) + if err != nil { + return fmt.Errorf("Failed to run grub-install: %s", err) + } + return nil }