Skip to contentSkip to conversation

arm64: Remove "loaded" checking in the grub_cmd_devicetree of linux.c

PATCH Superseded Fu Wei 2 participants 2 messages Dec 18, 2014 – May 7, 2015

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Fu Wei

author
#0 lore raw

PATCH 3/5 arm64: Remove "loaded" checking in the grub_cmd_devicetree of linux.c

Reason: (1)we don't need the check, actually
(2)it is a prerequisite for multiboot support

---
 grub-core/loader/arm64/linux.c | 7 -------
 1 file changed, 7 deletions(-)
grub-core/loader/arm64/linux.c +0 -7
index 987f5b9..e9e9a29 100644
@@ -185,13 +185,6 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)),
   void *blob = NULL;
   int size;
 
-  if (!loaded)
-    {
-      grub_error (GRUB_ERR_BAD_ARGUMENT,
-		  N_("you need to load the kernel first"));
-      return GRUB_ERR_BAD_OS;
-    }
-
   if (argc != 1)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 3 lines · Fu Wei

Reason: (1)we don't need the check, actually
(2)it is a prerequisite for multiboot support

That one is problematic. Normally execution of any kernel-loading commands like linux resets the boot context. Exceptions are drivemap, sendkey, acpi and memory map commands, somewhat unfortunately. I'm on the edge as to whether we should extend this behaviour to other commands.

Quoted 25 lines
---
 grub-core/loader/arm64/linux.c | 7 -------
 1 file changed, 7 deletions(-)
grub-core/loader/arm64/linux.c +0 -7
index 987f5b9..e9e9a29 100644
@@ -185,13 +185,6 @@ grub_cmd_devicetree (grub_command_t cmd __attribute__ ((unused)),
   void *blob = NULL;
   int size;
 
-  if (!loaded)
-    {
-      grub_error (GRUB_ERR_BAD_ARGUMENT,
-		  N_("you need to load the kernel first"));
-      return GRUB_ERR_BAD_OS;
-    }
-
   if (argc != 1)
     return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));