grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r2558 made another use case for make_relative_to_its_root visible (else


From: Felix Zielcke
Subject: r2558 made another use case for make_relative_to_its_root visible (else SEGFAULT)
Date: Fri, 04 Sep 2009 20:52:44 +0200

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.


-- 
Felix Zielcke
Proud Debian Maintainer





reply via email to

[Prev in Thread] Current Thread [Next in Thread]