Skip to contentSkip to conversation

bli module inclusion gives me just black screen on real hardware

DISCUSSION Tobias Powalowski 4 participants 13 messages Jul 18, 2023 – Oct 4, 2023

lore
Share & tools
lore
#0 lore raw

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Used grub version is 2.12rc1.

Any ideas?

thanks.

greetings

tpowa

Signature · 13 lines
Tobias Powalowski
Arch Linux Developer (tpowa)
https://www.archlinux.org
[email protected]

Archboot Developer
https://archboot.com

St. Martin-Apotheke
Herzog-Georg-Str. 25
89415 Lauingen
https://www.st-martin-apo.de
[email protected]
#1 lore raw

Hi,

Sorry for late reply but I was on vacation...

Quoted 9 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Used grub version is 2.12rc1.

Any ideas?

Adding Oliver who is original author of this module. Please always CC original authors of the patches which make regressions.

Oliver, could you help with that?

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 4 lines
Quoted 4 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

  sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
 grub-core/commands/bli.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +3 -1
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
   grub_err_t status = GRUB_ERR_NONE;
   char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
   image = grub_efi_get_loaded_image (grub_efi_image_handle);
   if (image == NULL)
     return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
   device_name = grub_efidisk_get_device_name (image->device_handle);
   if (device_name == NULL)
     return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
   status = get_part_uuid (device_name, &part_uuid);
 
   if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",

&bli_vendor_guid, part_uuid,
- GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
- GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+ {
+ grub_dprintf ("bli", "setting var\n");
+ status = grub_efi_set_variable_to_string
("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+ GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+ GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+ }
else
grub_error (status, N_("unable to determine partition UUID of
boot device"));

+ grub_dprintf ("bli", "cleanup\n"); grub_free (part_uuid);
grub_free (device_name);
return status;
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)

GRUB_MOD_INIT (bli)
{
+ grub_dprintf ("bli", "init start\n"); grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
PACKAGE_STRING,
GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS | GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
set_loader_device_part_uuid ();
+ grub_dprintf ("bli", "init end\n");
}

Signature · 6 lines
2.41.0



Thanks,
 Oliver
Quoted 8 lines

Adding Oliver who is original author of this module. Please always CC original authors of the patches which make regressions.

Oliver, could you help with that?

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#3 lore raw

Am 12.08.23 um 14:52 schrieb Oliver Steffen:

Quoted 95 lines

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 3 lines
Quoted 3 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

   sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
  grub-core/commands/bli.c | 15 ++++++++++++---
  1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +10 -3
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
    grub_err_t status = GRUB_ERR_NONE;
    char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
    image = grub_efi_get_loaded_image (grub_efi_image_handle);
    if (image == NULL)
      return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
    device_name = grub_efidisk_get_device_name (image->device_handle);
    if (device_name == NULL)
      return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
    status = get_part_uuid (device_name, &part_uuid);
 
    if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",
 &bli_vendor_guid, part_uuid,
-					      GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
-					      GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    {
+      grub_dprintf ("bli", "setting var\n");
+      status = grub_efi_set_variable_to_string
 ("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+						GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+						GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    }
    else
      grub_error (status, N_("unable to determine partition UUID of
 boot device"));
 
+  grub_dprintf ("bli", "cleanup\n");
    grub_free (part_uuid);
    grub_free (device_name);
    return status;
grub-core/commands/bli.c +2 -0
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)
 
  GRUB_MOD_INIT (bli)
  {
+  grub_dprintf ("bli", "init start\n");
    grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
 PACKAGE_STRING,
  				   GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
  				   GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
    set_loader_device_part_uuid ();
+  grub_dprintf ("bli", "init end\n");
Quoted 1 line
  }

Hi I'll try after my vaccation, give me 2 weeks and I report back.

Thanks.

Best regards

Tobias

Signature · 13 lines
Tobias Powalowski
Arch Linux Developer (tpowa)
https://www.archlinux.org
[email protected]

Archboot Developer
https://archboot.com


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#4 lore raw
Quoted 87 lines · Tobias Powalowski via Grub-devel

Am 12.08.23 um 14:52 schrieb Oliver Steffen:

Quoted 86 lines

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 3 lines
Quoted 3 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

   sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
  grub-core/commands/bli.c | 15 ++++++++++++---
  1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +10 -3
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
    grub_err_t status = GRUB_ERR_NONE;
    char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
    image = grub_efi_get_loaded_image (grub_efi_image_handle);
    if (image == NULL)
      return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
    device_name = grub_efidisk_get_device_name (image->device_handle);
    if (device_name == NULL)
      return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
    status = get_part_uuid (device_name, &part_uuid);
 
    if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",
 &bli_vendor_guid, part_uuid,
-					      GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
-					      GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    {
+      grub_dprintf ("bli", "setting var\n");
+      status = grub_efi_set_variable_to_string
 ("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+						GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+						GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    }
    else
      grub_error (status, N_("unable to determine partition UUID of
 boot device"));
 
+  grub_dprintf ("bli", "cleanup\n");
    grub_free (part_uuid);
    grub_free (device_name);
    return status;
grub-core/commands/bli.c +0 -0
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)
 
Quoted 12 lines
Quoted 10 lines
grub-core/commands/bli.c +2 -0
  GRUB_MOD_INIT (bli)
  {
+  grub_dprintf ("bli", "init start\n");
    grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
 PACKAGE_STRING,
  				   GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
  				   GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
    set_loader_device_part_uuid ();
+  grub_dprintf ("bli", "init end\n");
  }

Hi I'll try after my vaccation, give me 2 weeks and I report back.

Are you back? Could you check the patch from Oliver?

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#5 lore raw

Quoting Daniel Kiper (2023-09-26 17:57:05)

Quoted 101 lines · Tobias Powalowski via Grub-devel
Quoted 87 lines

Am 12.08.23 um 14:52 schrieb Oliver Steffen:

Quoted 86 lines

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 3 lines
Quoted 3 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

   sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
  grub-core/commands/bli.c | 15 ++++++++++++---
  1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +10 -3
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
    grub_err_t status = GRUB_ERR_NONE;
    char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
    image = grub_efi_get_loaded_image (grub_efi_image_handle);
    if (image == NULL)
      return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
    device_name = grub_efidisk_get_device_name (image->device_handle);
    if (device_name == NULL)
      return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
    status = get_part_uuid (device_name, &part_uuid);
 
    if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",
 &bli_vendor_guid, part_uuid,
-                                         GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                                         GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    {
+      grub_dprintf ("bli", "setting var\n");
+      status = grub_efi_set_variable_to_string
 ("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+                                           GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                           GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    }
    else
      grub_error (status, N_("unable to determine partition UUID of
 boot device"));
 
+  grub_dprintf ("bli", "cleanup\n");
    grub_free (part_uuid);
    grub_free (device_name);
    return status;
grub-core/commands/bli.c +0 -0
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)
 
Quoted 12 lines
Quoted 10 lines
grub-core/commands/bli.c +2 -0
  GRUB_MOD_INIT (bli)
  {
+  grub_dprintf ("bli", "init start\n");
    grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
 PACKAGE_STRING,
                               GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
                               GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
    set_loader_device_part_uuid ();
+  grub_dprintf ("bli", "init end\n");
  }

Hi I'll try after my vaccation, give me 2 weeks and I report back.

Quoted 4 lines

Are you back? Could you check the patch from Oliver?

Daniel

I think it is worth also trying the GUID patches discussed in this thread:
https://mail.gnu.org/archive/html/grub-devel/2023-09/msg00045.html

Oliver

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#6 lore raw

Am 27.09.23 um 09:43 schrieb Oliver Steffen:

Quoted 100 lines

Quoting Daniel Kiper (2023-09-26 17:57:05)

Quoted 99 lines · Tobias Powalowski via Grub-devel
Quoted 98 lines

Am 12.08.23 um 14:52 schrieb Oliver Steffen:

Quoted 95 lines

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 3 lines
Quoted 3 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

    sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
   grub-core/commands/bli.c | 15 ++++++++++++---
   1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +10 -3
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
     grub_err_t status = GRUB_ERR_NONE;
     char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
     image = grub_efi_get_loaded_image (grub_efi_image_handle);
     if (image == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
     device_name = grub_efidisk_get_device_name (image->device_handle);
     if (device_name == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
     status = get_part_uuid (device_name, &part_uuid);
 
     if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",
 &bli_vendor_guid, part_uuid,
-                                         GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                                         GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    {
+      grub_dprintf ("bli", "setting var\n");
+      status = grub_efi_set_variable_to_string
 ("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+                                           GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                           GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    }
     else
       grub_error (status, N_("unable to determine partition UUID of
 boot device"));
 
+  grub_dprintf ("bli", "cleanup\n");
     grub_free (part_uuid);
     grub_free (device_name);
     return status;
grub-core/commands/bli.c +2 -0
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)
 
   GRUB_MOD_INIT (bli)
   {
+  grub_dprintf ("bli", "init start\n");
     grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
 PACKAGE_STRING,
                                GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
     set_loader_device_part_uuid ();
+  grub_dprintf ("bli", "init end\n");
Quoted 1 line
   }

Hi I'll try after my vaccation, give me 2 weeks and I report back.

Quoted 9 lines
Quoted 4 lines

Are you back? Could you check the patch from Oliver?

Daniel

I think it is worth also trying the GUID patches discussed in this thread:
https://mail.gnu.org/archive/html/grub-devel/2023-09/msg00045.html

Oliver

Hi,

i'm a bit further now, on pure windows systems it works. My dual boot machine and pure linux system show the hang. I guess it has something to do with the GUID or GPT partitioning. On windows only systems it shows a message about GUIDs first before the sleep countdown comes.

Let's see if I get more info out of my not working machines.

greetings

tpowa

Signature · 13 lines
Tobias Powalowski
Arch Linux Developer (tpowa)
https://www.archlinux.org
[email protected]

Archboot Developer
https://archboot.com


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#7 lore raw
In reply to Oliver Steffen

Am 27.09.23 um 09:43 schrieb Oliver Steffen:

Quoted 100 lines

Quoting Daniel Kiper (2023-09-26 17:57:05)

Quoted 99 lines · Tobias Powalowski via Grub-devel
Quoted 98 lines

Am 12.08.23 um 14:52 schrieb Oliver Steffen:

Quoted 95 lines

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 3 lines
Quoted 3 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

    sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
   grub-core/commands/bli.c | 15 ++++++++++++---
   1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +10 -3
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
     grub_err_t status = GRUB_ERR_NONE;
     char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
     image = grub_efi_get_loaded_image (grub_efi_image_handle);
     if (image == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
     device_name = grub_efidisk_get_device_name (image->device_handle);
     if (device_name == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
     status = get_part_uuid (device_name, &part_uuid);
 
     if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",
 &bli_vendor_guid, part_uuid,
-                                         GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                                         GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    {
+      grub_dprintf ("bli", "setting var\n");
+      status = grub_efi_set_variable_to_string
 ("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+                                           GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                           GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    }
     else
       grub_error (status, N_("unable to determine partition UUID of
 boot device"));
 
+  grub_dprintf ("bli", "cleanup\n");
     grub_free (part_uuid);
     grub_free (device_name);
     return status;
grub-core/commands/bli.c +2 -0
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)
 
   GRUB_MOD_INIT (bli)
   {
+  grub_dprintf ("bli", "init start\n");
     grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
 PACKAGE_STRING,
                                GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
     set_loader_device_part_uuid ();
+  grub_dprintf ("bli", "init end\n");
Quoted 1 line
   }

Hi I'll try after my vaccation, give me 2 weeks and I report back.

Quoted 9 lines
Quoted 4 lines

Are you back? Could you check the patch from Oliver?

Daniel

I think it is worth also trying the GUID patches discussed in this thread:
https://mail.gnu.org/archive/html/grub-devel/2023-09/msg00045.html

Oliver

Hi,

ok I think I just missconfigured the standalone --modules="" array that triggers the hard hang. I changed that and now the bli module loads without issues on my systems. I wasn't able to get any pager information.

Maybe it's a race condition if all available modules are put into --modules="" in alphabetical order to the array.

Anyway now it works.

greetings

tpowa

Signature · 13 lines
Tobias Powalowski
Arch Linux Developer (tpowa)
https://www.archlinux.org
[email protected]

Archboot Developer
https://archboot.com


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#8 lore raw
Quoted 111 lines · Tobias Powalowski

Am 27.09.23 um 09:43 schrieb Oliver Steffen:

Quoted 100 lines

Quoting Daniel Kiper (2023-09-26 17:57:05)

Quoted 99 lines · Tobias Powalowski via Grub-devel
Quoted 98 lines

Am 12.08.23 um 14:52 schrieb Oliver Steffen:

Quoted 95 lines

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 3 lines
Quoted 3 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

    sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
   grub-core/commands/bli.c | 15 ++++++++++++---
   1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +10 -3
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
     grub_err_t status = GRUB_ERR_NONE;
     char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
     image = grub_efi_get_loaded_image (grub_efi_image_handle);
     if (image == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
     device_name = grub_efidisk_get_device_name (image->device_handle);
     if (device_name == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
     status = get_part_uuid (device_name, &part_uuid);
 
     if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",
 &bli_vendor_guid, part_uuid,
-                                         GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                                         GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    {
+      grub_dprintf ("bli", "setting var\n");
+      status = grub_efi_set_variable_to_string
 ("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+                                           GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                           GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    }
     else
       grub_error (status, N_("unable to determine partition UUID of
 boot device"));
 
+  grub_dprintf ("bli", "cleanup\n");
     grub_free (part_uuid);
     grub_free (device_name);
     return status;
grub-core/commands/bli.c +2 -0
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)
 
   GRUB_MOD_INIT (bli)
   {
+  grub_dprintf ("bli", "init start\n");
     grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
 PACKAGE_STRING,
                                GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
     set_loader_device_part_uuid ();
+  grub_dprintf ("bli", "init end\n");
Quoted 1 line
   }

Hi I'll try after my vaccation, give me 2 weeks and I report back.

Quoted 9 lines
Quoted 4 lines

Are you back? Could you check the patch from Oliver?

Daniel

I think it is worth also trying the GUID patches discussed in this thread:
https://mail.gnu.org/archive/html/grub-devel/2023-09/msg00045.html

Oliver

Quoted 8 lines

Hi,

ok I think I just missconfigured the standalone --modules="" array that triggers the hard hang. I changed that and now the bli module loads without issues on my systems. I wasn't able to get any pager information.

Maybe it's a race condition if all available modules are put into --modules="" in alphabetical order to the array.

Module load order matters, because bli does its magic in the module init function. It requires the gpt module to be present at that time to read the partition table and get the GUID. This is the downside of doing stuff in the init function instead of having the module provide a separate 'bli' command that needs to get called later.

This was introduced in v6 of the patch series, see
- https://mail.gnu.org/archive/html/grub-devel/2023-04/msg00009.html
- https://mail.gnu.org/archive/html/grub-devel/2023-04/msg00068.html

I get that this constraint on the module load order can be confusing, but it saves the need to call another command.
Daniel, any thoughts on this? Is it worth reintroducing the bli command?

-Oliver

Quoted 7 lines

Anyway now it works.

greetings

tpowa

Quoted 9 lines

--
Tobias Powalowski
Arch Linux Developer (tpowa)
https://www.archlinux.org
[email protected]

Archboot Developer
https://archboot.com

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#9 lore raw

Quoting Oliver Steffen (2023-10-02 10:28:08)

Quoted 128 lines
Quoted 111 lines · Tobias Powalowski

Am 27.09.23 um 09:43 schrieb Oliver Steffen:

Quoted 100 lines

Quoting Daniel Kiper (2023-09-26 17:57:05)

Quoted 99 lines · Tobias Powalowski via Grub-devel
Quoted 98 lines

Am 12.08.23 um 14:52 schrieb Oliver Steffen:

Quoted 95 lines

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 3 lines
Quoted 3 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

    sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
   grub-core/commands/bli.c | 15 ++++++++++++---
   1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +10 -3
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
     grub_err_t status = GRUB_ERR_NONE;
     char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
     image = grub_efi_get_loaded_image (grub_efi_image_handle);
     if (image == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
     device_name = grub_efidisk_get_device_name (image->device_handle);
     if (device_name == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
     status = get_part_uuid (device_name, &part_uuid);
 
     if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",
 &bli_vendor_guid, part_uuid,
-                                         GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                                         GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    {
+      grub_dprintf ("bli", "setting var\n");
+      status = grub_efi_set_variable_to_string
 ("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+                                           GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                           GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    }
     else
       grub_error (status, N_("unable to determine partition UUID of
 boot device"));
 
+  grub_dprintf ("bli", "cleanup\n");
     grub_free (part_uuid);
     grub_free (device_name);
     return status;
grub-core/commands/bli.c +2 -0
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)
 
   GRUB_MOD_INIT (bli)
   {
+  grub_dprintf ("bli", "init start\n");
     grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
 PACKAGE_STRING,
                                GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
     set_loader_device_part_uuid ();
+  grub_dprintf ("bli", "init end\n");
Quoted 1 line
   }

Hi I'll try after my vaccation, give me 2 weeks and I report back.

Quoted 9 lines
Quoted 4 lines

Are you back? Could you check the patch from Oliver?

Daniel

I think it is worth also trying the GUID patches discussed in this thread:
https://mail.gnu.org/archive/html/grub-devel/2023-09/msg00045.html

Oliver

Quoted 8 lines

Hi,

ok I think I just missconfigured the standalone --modules="" array that triggers the hard hang. I changed that and now the bli module loads without issues on my systems. I wasn't able to get any pager information.

Maybe it's a race condition if all available modules are put into --modules="" in alphabetical order to the array.

Module load order matters, because bli does its magic in the module init function. It requires the gpt module to be present at that time to read the partition table and get the GUID. This is the downside of doing stuff in the init function instead of having the module provide a separate 'bli' command that needs to get called later.

Quoted 7 lines

This was introduced in v6 of the patch series, see
- https://mail.gnu.org/archive/html/grub-devel/2023-04/msg00009.html
- https://mail.gnu.org/archive/html/grub-devel/2023-04/msg00068.html

I get that this constraint on the module load order can be confusing, but it saves the need to call another command.
Daniel, any thoughts on this? Is it worth reintroducing the bli command?

I thnik it should be possible to specify a dependency on the part_gpt module, which would be much more elegant.
But I can't get it to work somehow.

Quoted 19 lines

-Oliver

Quoted 16 lines

Anyway now it works.

greetings

tpowa

--
Tobias Powalowski
Arch Linux Developer (tpowa)
https://www.archlinux.org
[email protected]

Archboot Developer
https://archboot.com

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#10 lore raw
In reply to Oliver Steffen

Am 27.09.23 um 09:43 schrieb Oliver Steffen:

Quoted 100 lines

Quoting Daniel Kiper (2023-09-26 17:57:05)

Quoted 99 lines · Tobias Powalowski via Grub-devel
Quoted 98 lines

Am 12.08.23 um 14:52 schrieb Oliver Steffen:

Quoted 95 lines

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 3 lines
Quoted 3 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

    sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
   grub-core/commands/bli.c | 15 ++++++++++++---
   1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +10 -3
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
     grub_err_t status = GRUB_ERR_NONE;
     char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
     image = grub_efi_get_loaded_image (grub_efi_image_handle);
     if (image == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
     device_name = grub_efidisk_get_device_name (image->device_handle);
     if (device_name == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
     status = get_part_uuid (device_name, &part_uuid);
 
     if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",
 &bli_vendor_guid, part_uuid,
-                                         GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                                         GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    {
+      grub_dprintf ("bli", "setting var\n");
+      status = grub_efi_set_variable_to_string
 ("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+                                           GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                           GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    }
     else
       grub_error (status, N_("unable to determine partition UUID of
 boot device"));
 
+  grub_dprintf ("bli", "cleanup\n");
     grub_free (part_uuid);
     grub_free (device_name);
     return status;
grub-core/commands/bli.c +2 -0
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)
 
   GRUB_MOD_INIT (bli)
   {
+  grub_dprintf ("bli", "init start\n");
     grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
 PACKAGE_STRING,
                                GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
     set_loader_device_part_uuid ();
+  grub_dprintf ("bli", "init end\n");
Quoted 1 line
   }

Hi I'll try after my vaccation, give me 2 weeks and I report back.

Quoted 9 lines
Quoted 4 lines

Are you back? Could you check the patch from Oliver?

Daniel

I think it is worth also trying the GUID patches discussed in this thread:
https://mail.gnu.org/archive/html/grub-devel/2023-09/msg00045.html

Oliver

Hi,

on aarch64 the bli module causes a hard grub crash. Reproducable on UTM and Parallels. I try to get debugging info with pager and debug soon.

Tobias

Signature · 13 lines
Tobias Powalowski
Arch Linux Developer (tpowa)
https://www.archlinux.org
[email protected]

Archboot Developer
https://archboot.com


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
#11 lore raw
Quoted 109 lines · Tobias Powalowski

Am 27.09.23 um 09:43 schrieb Oliver Steffen:

Quoted 107 lines

Quoting Daniel Kiper (2023-09-26 17:57:05)

Quoted 99 lines · Tobias Powalowski via Grub-devel
Quoted 87 lines

Am 12.08.23 um 14:52 schrieb Oliver Steffen:

Quoted 86 lines

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 3 lines
Quoted 3 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

    sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001
From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
   grub-core/commands/bli.c | 15 ++++++++++++---
   1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +10 -3
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
     grub_err_t status = GRUB_ERR_NONE;
     char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
     image = grub_efi_get_loaded_image (grub_efi_image_handle);
     if (image == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
     device_name = grub_efidisk_get_device_name (image->device_handle);
     if (device_name == NULL)
       return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
     status = get_part_uuid (device_name, &part_uuid);
 
     if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",
 &bli_vendor_guid, part_uuid,
-                                         GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                                         GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    {
+      grub_dprintf ("bli", "setting var\n");
+      status = grub_efi_set_variable_to_string
 ("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+                                           GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                           GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    }
     else
       grub_error (status, N_("unable to determine partition UUID of
 boot device"));
 
+  grub_dprintf ("bli", "cleanup\n");
     grub_free (part_uuid);
     grub_free (device_name);
     return status;
grub-core/commands/bli.c +0 -0
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)
 
Quoted 11 lines
Quoted 10 lines
grub-core/commands/bli.c +2 -0
   GRUB_MOD_INIT (bli)
   {
+  grub_dprintf ("bli", "init start\n");
     grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
 PACKAGE_STRING,
                                GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
     set_loader_device_part_uuid ();
+  grub_dprintf ("bli", "init end\n");
   }

Hi I'll try after my vaccation, give me 2 weeks and I report back.

Quoted 4 lines

Are you back? Could you check the patch from Oliver?

Daniel

I think it is worth also trying the GUID patches discussed in this thread:
https://mail.gnu.org/archive/html/grub-devel/2023-09/msg00045.html

Quoted 6 lines
Quoted 2 lines

Oliver

Hi,

on aarch64 the bli module causes a hard grub crash. Reproducable on UTM and Parallels. I try to get debugging info with pager and debug soon.

Is this with Vladimir's patches and the 32bit alignment for GUIDs, see
https://mail.gnu.org/archive/html/grub-devel/2023-09/msg00045.html ? If not, please try those, this problem might very likely be an alignment issue.

Oliver

Quoted 11 lines

Tobias

--
Tobias Powalowski
Arch Linux Developer (tpowa)
https://www.archlinux.org
[email protected]

Archboot Developer
https://archboot.com

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#12 lore raw

Am 02.10.23 um 11:04 schrieb Oliver Steffen:

Quoted 114 lines
Quoted 112 lines · Tobias Powalowski

Am 27.09.23 um 09:43 schrieb Oliver Steffen:

Quoted 100 lines

Quoting Daniel Kiper (2023-09-26 17:57:05)

Quoted 99 lines · Tobias Powalowski via Grub-devel
Quoted 98 lines

Am 12.08.23 um 14:52 schrieb Oliver Steffen:

Quoted 95 lines

Quoting Daniel Kiper (2023-08-11 18:13:57)

Quoted 10 lines

Hi,

Sorry for late reply but I was on vacation...

Quoted 5 lines · Tobias Powalowski via Grub-devel

Hi,

I tried to add the bli module to my standalone grub for my project. In qemu testing all is fine, if trying to boot it on real hardware gives me just a blank screen and game over.

Sorry to hear that.
I just tried it again on a Lenovo T14s (x86_64) and I can reach the menu and the grub shell without problems. What hardware are you using?

Quoted 3 lines
Quoted 3 lines

Used grub version is 2.12rc1.

Any ideas?

You could apply following patch. It adds debug prints to the bli modue. Then enable debug output in your grub.cfg by setting

set debug=bli
set pager=1

I recommend adding

     sleep 10 --verbose --interruptible

just after the line loading the bli module. This is to keep the messages visible for a moment before the menu clears the screen (should it get to there).
This might give us a hint where it goes wrong.

   From cda95baaf0a3c0f277a5e37aff399574627b2263 Mon Sep 17 00:00:00 2001

From: Oliver Steffen <[email protected]>
Date: Sat, 12 Aug 2023 14:23:31 +0200
Subject: [PATCH] bli dprint

---
    grub-core/commands/bli.c | 15 ++++++++++++---
    1 file changed, 12 insertions(+), 3 deletions(-)
grub-core/commands/bli.c +10 -3
index e0d8a54f7..95caa4feb 100644
@@ -89,23 +89,30 @@ set_loader_device_part_uuid (void)
      grub_err_t status = GRUB_ERR_NONE;
      char *part_uuid = NULL;
 
+  grub_dprintf ("bli", "getting loaded image\n");
      image = grub_efi_get_loaded_image (grub_efi_image_handle);
      if (image == NULL)
        return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting boot disk\n");
      device_name = grub_efidisk_get_device_name (image->device_handle);
      if (device_name == NULL)
        return grub_error (GRUB_ERR_BAD_DEVICE, N_("unable to find boot device"));
 
+  grub_dprintf ("bli", "getting uuid\n");
      status = get_part_uuid (device_name, &part_uuid);
 
      if (status == GRUB_ERR_NONE)
-    status = grub_efi_set_variable_to_string ("LoaderDevicePartUUID",
 &bli_vendor_guid, part_uuid,
-                                         GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
-                                         GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    {
+      grub_dprintf ("bli", "setting var\n");
+      status = grub_efi_set_variable_to_string
 ("LoaderDevicePartUUID", &bli_vendor_guid, part_uuid,
+                                           GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                           GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
+    }
      else
        grub_error (status, N_("unable to determine partition UUID of
 boot device"));
 
+  grub_dprintf ("bli", "cleanup\n");
      grub_free (part_uuid);
      grub_free (device_name);
      return status;
grub-core/commands/bli.c +2 -0
@@ -113,8 +120,10 @@ set_loader_device_part_uuid (void)
 
    GRUB_MOD_INIT (bli)
    {
+  grub_dprintf ("bli", "init start\n");
      grub_efi_set_variable_to_string ("LoaderInfo", &bli_vendor_guid,
 PACKAGE_STRING,
                                 GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS |
                                 GRUB_EFI_VARIABLE_RUNTIME_ACCESS);
      set_loader_device_part_uuid ();
+  grub_dprintf ("bli", "init end\n");
Quoted 1 line
    }

Hi I'll try after my vaccation, give me 2 weeks and I report back.

Quoted 9 lines
Quoted 4 lines

Are you back? Could you check the patch from Oliver?

Daniel

I think it is worth also trying the GUID patches discussed in this thread:
https://mail.gnu.org/archive/html/grub-devel/2023-09/msg00045.html

Oliver

Hi,

Quoted 9 lines
Quoted 2 lines

on aarch64 the bli module causes a hard grub crash. Reproducable on UTM and Parallels. I try to get debugging info with pager and debug soon.

Is this with Vladimir's patches and the 32bit alignment for GUIDs, see
https://mail.gnu.org/archive/html/grub-devel/2023-09/msg00045.html ? If not, please try those, this problem might very likely be an alignment issue.

Oliver

Hi Oliver,

ok built grub on aarch64 with your debug and Vladimir's patches.

Here the result and the used iso image. Test run on UTM but Parallels also fails.

https://pkgbuild.com/~tpowa/aarch64-grub-bli-debug/

greetings

Tobias

Signature · 19 lines
Tobias Powalowski
Arch Linux Developer (tpowa)
https://www.archlinux.org
[email protected]

Archboot Developer
https://archboot.com

St. Martin-Apotheke
Herzog-Georg-Str. 25
89415 Lauingen
https://www.st-martin-apo.de
[email protected]


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel