Skip to contentSkip to conversation

r2558 made another use case for make_relative_to_its_root visible (else SEGFAULT)

DISCUSSION Felix Zielcke 3 participants 5 messages Sep 4, 2009 – Sep 5, 2009

lore
Share & tools
lore
#0 lore raw

r2558 actually enabled this code path which was (almost) never executed before in probe():

      if (S_ISREG (st.st_mode))
        {
          /* Regular file.  Verify that we can read it properly.  */

          grub_file_t file;
          grub_util_info ("reading %s via OS facilities", path);
          filebuf_via_sys = grub_util_read_image (path);

          grub_util_info ("reading %s via GRUB facilities", path);
          asprintf (&grub_path, "(%s)%s", drive_name, path);
          file = grub_file_open (grub_path);
          filebuf_via_grub = xmalloc (file->size);
          grub_file_read (file, filebuf_via_grub, file->size);

          grub_util_info ("comparing");

          if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size))
            grub_util_error ("files differ");
        }
      printf ("%s\n", fs->name);

If /boot is on a seperate partition and you run `grub-probe -t fs /boot/grub/core.img' grub_file_open returns 0 because grub_path is the full system path and not a relative path which GRUB needs.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer
#1 lore raw
Quoted 24 lines · Felix Zielcke

r2558 actually enabled this code path which was (almost) never executed before in probe():

      if (S_ISREG (st.st_mode))
        {
          /* Regular file.  Verify that we can read it properly.  */

          grub_file_t file;
          grub_util_info ("reading %s via OS facilities", path);
          filebuf_via_sys = grub_util_read_image (path);

          grub_util_info ("reading %s via GRUB facilities", path);
          asprintf (&grub_path, "(%s)%s", drive_name, path);
          file = grub_file_open (grub_path);
          filebuf_via_grub = xmalloc (file->size);
          grub_file_read (file, filebuf_via_grub, file->size);

          grub_util_info ("comparing");

          if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size))
            grub_util_error ("files differ");
        }
      printf ("%s\n", fs->name);
Quoted 3 lines

If /boot is on a seperate partition and you run `grub-probe -t fs /boot/grub/core.img' grub_file_open returns 0 because grub_path is the full system path and not a relative path which GRUB needs.

A proper fix for this would be too intrusive for 1.97. Unless someone has a bright idea, I'll comment it out untill we've released.

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

Am Freitag, den 04.09.2009, 21:26 +0200 schrieb Robert Millan:

Quoted 25 lines · Felix Zielcke
Quoted 24 lines

r2558 actually enabled this code path which was (almost) never executed before in probe():

      if (S_ISREG (st.st_mode))
        {
          /* Regular file.  Verify that we can read it properly.  */

          grub_file_t file;
          grub_util_info ("reading %s via OS facilities", path);
          filebuf_via_sys = grub_util_read_image (path);

          grub_util_info ("reading %s via GRUB facilities", path);
          asprintf (&grub_path, "(%s)%s", drive_name, path);
          file = grub_file_open (grub_path);
          filebuf_via_grub = xmalloc (file->size);
          grub_file_read (file, filebuf_via_grub, file->size);

          grub_util_info ("comparing");

          if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size))
            grub_util_error ("files differ");
        }
      printf ("%s\n", fs->name);
Quoted 6 lines
Quoted 3 lines

If /boot is on a seperate partition and you run `grub-probe -t fs /boot/grub/core.img' grub_file_open returns 0 because grub_path is the full system path and not a relative path which GRUB needs.

A proper fix for this would be too intrusive for 1.97. Unless someone has a bright idea, I'll comment it out untill we've released.

For the release this is probable the best idea.

Signature · 2 lines
Felix Zielcke
Proud Debian Maintainer
#3 lore raw
Quoted 9 lines · Felix Zielcke

Am Freitag, den 04.09.2009, 21:26 +0200 schrieb Robert Millan:

Quoted 6 lines · Felix Zielcke
Quoted 2 lines

r2558 actually enabled this code path which was (almost) never executed before in probe():

A proper fix for this would be too intrusive for 1.97. Unless someone has a bright idea, I'll comment it out untill we've released.

For the release this is probable the best idea.

Agreed. Sorry for this regression.

Signature · 1 line
Colin Watson                                       [[email protected]]
#4 lore raw
Quoted 6 lines · Colin Watson
Quoted 5 lines · Felix Zielcke

Am Freitag, den 04.09.2009, 21:26 +0200 schrieb Robert Millan:

Quoted 4 lines · Felix Zielcke
Quoted 2 lines

r2558 actually enabled this code path which was (almost) never executed before in probe():

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

A proper fix for this would be too intrusive for 1.97. Unless someone has a bright idea, I'll comment it out untill we've released.

For the release this is probable the best idea.

Agreed.

Ok, done.

Quoted 1 line

Sorry for this regression.

Not your fault! Hopefully I'll remember to re-enable this after 1.97 is released.

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."