Skip to contentSkip to conversation

[2338] 2009-06-17 Felix Zielcke <[email protected]>

DISCUSSION Robert Millan 2 participants 4 messages Jun 20, 2009 – Jun 28, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi Felix,

This commit looks wrong. grub_file_open is already supposed to set grub_errno and grub_errmsg appropiately.

Is there a specific problem you wanted to fix here?

Quoted 70 lines · Felix Zielcke

Revision: 2338

          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2338
Author:   fzielcke
Date:     2009-06-17 17:19:23 +0000 (Wed, 17 Jun 2009)

Log Message:
-----------
2009-06-17 Felix Zielcke <[email protected]>

* loader/i386/linux.c (grub_cmd_linux): Set grub_error if the file can't be found.
* loader/i386/pc/linux.c (grub_cmd_linux): Likewise.

Modified Paths:
--------------

    trunk/grub2/ChangeLog
    trunk/grub2/loader/i386/linux.c
    trunk/grub2/loader/i386/pc/linux.c

Modified: trunk/grub2/ChangeLog
===================================================================

grub2/ChangeLog +6 -0
@@ -1,3 +1,9 @@
+2009-06-17  Felix Zielcke  <[email protected]>
+
+	* loader/i386/linux.c (grub_cmd_linux): Set grub_error if the
+	file can't be found.
+	* loader/i386/pc/linux.c (grub_cmd_linux): Likewise.
+
 2009-06-17  Vladimir Serbinenko  <[email protected]>
 
 	Fix newline handling

Modified: trunk/grub2/loader/i386/linux.c
===================================================================

grub2/loader/i386/linux.c +4 -1
@@ -600,7 +600,10 @@
 
   file = grub_file_open (argv[0]);
   if (! file)
-    goto fail;
+    {
+      grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
+      goto fail;
+    }
 
   if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
     {

Modified: trunk/grub2/loader/i386/pc/linux.c
===================================================================

grub2/loader/i386/pc/linux.c +4 -1
@@ -69,7 +69,10 @@
 
   file = grub_file_open (argv[0]);
   if (! file)
-    goto fail;
+    {
+      grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
+      goto fail;
+    }
 
   if ((grub_size_t) grub_file_size (file) > grub_os_area_size)
     {
Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#2 lore raw
Quoted 7 lines · Robert Millan

Hi Felix,

This commit looks wrong. grub_file_open is already supposed to set grub_errno and grub_errmsg appropiately.

Is there a specific problem you wanted to fix here?

Hi,

I reverted this. If there's something that needs fixing here, let us know about it! :-)

Thanks

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#3 lore raw
In reply to Robert Millan

Am Samstag, den 20.06.2009, 15:43 +0200 schrieb Robert Millan:

Quoted 6 lines

Hi Felix,

This commit looks wrong. grub_file_open is already supposed to set grub_errno and grub_errmsg appropiately.

Is there a specific problem you wanted to fix here?

If the loaded file can't be found, the menuentry code just continuesa and initrd then complains that you must load the kernel first.

Quoted 72 lines · Felix Zielcke
Quoted 70 lines

Revision: 2338

          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2338
Author:   fzielcke
Date:     2009-06-17 17:19:23 +0000 (Wed, 17 Jun 2009)

Log Message:
-----------
2009-06-17 Felix Zielcke <[email protected]>

* loader/i386/linux.c (grub_cmd_linux): Set grub_error if the file can't be found.
* loader/i386/pc/linux.c (grub_cmd_linux): Likewise.

Modified Paths:
--------------

    trunk/grub2/ChangeLog
    trunk/grub2/loader/i386/linux.c
    trunk/grub2/loader/i386/pc/linux.c

Modified: trunk/grub2/ChangeLog
===================================================================

grub2/ChangeLog +6 -0
@@ -1,3 +1,9 @@
+2009-06-17  Felix Zielcke  <[email protected]>
+
+	* loader/i386/linux.c (grub_cmd_linux): Set grub_error if the
+	file can't be found.
+	* loader/i386/pc/linux.c (grub_cmd_linux): Likewise.
+
 2009-06-17  Vladimir Serbinenko  <[email protected]>
 
 	Fix newline handling

Modified: trunk/grub2/loader/i386/linux.c
===================================================================

grub2/loader/i386/linux.c +4 -1
@@ -600,7 +600,10 @@
 
   file = grub_file_open (argv[0]);
   if (! file)
-    goto fail;
+    {
+      grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
+      goto fail;
+    }
 
   if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
     {

Modified: trunk/grub2/loader/i386/pc/linux.c
===================================================================

grub2/loader/i386/pc/linux.c +4 -1
@@ -69,7 +69,10 @@
 
   file = grub_file_open (argv[0]);
   if (! file)
-    goto fail;
+    {
+      grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
+      goto fail;
+    }
 
   if ((grub_size_t) grub_file_size (file) > grub_os_area_size)
     {
Signature · 1 line
Felix Zielcke
#4 lore raw
Quoted 10 lines · Felix Zielcke

Am Samstag, den 20.06.2009, 15:43 +0200 schrieb Robert Millan:

Quoted 6 lines

Hi Felix,

This commit looks wrong. grub_file_open is already supposed to set grub_errno and grub_errmsg appropiately.

Is there a specific problem you wanted to fix here?

If the loaded file can't be found, the menuentry code just continuesa and initrd then complains that you must load the kernel first.

Thanks. Looking at the patch, the only possible explanation for this is that grub_file_open() returned 0 but didn't set grub_errno.

I'll try to find a moment to debug this.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."