]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-mkrescue.c: Fix incorrect file usage in fallback code.
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 16 Dec 2013 23:33:55 +0000 (00:33 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 16 Dec 2013 23:33:55 +0000 (00:33 +0100)
Reported by: Jon McCune

ChangeLog
util/grub-mkrescue.c

index 88406393e40d18ba2a57f937366d75d097ef4bc2..b51a039b1f40bc91c47d3b389d1b77f91550a78a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-12-16  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-mkrescue.c: Fix incorrect file usage in fallback code.
+
+       Reported by: Jon McCune
+
 2013-12-16  Andrey Borzenkov <arvidjaar@gmail.com>
 
        * grub-core/osdep/linux/platform.c (grub_install_get_default_x86_platform):
index 3e19cb7203006addb6183b4216ebdd4b1cacbadf..b4ee8f598888f868ca359b5a9eeb2f5e9694c6a2 100644 (file)
@@ -509,7 +509,7 @@ main (int argc, char *argv[])
              if (!sa)
                grub_util_error (_("cannot open `%s': %s"), sysarea_img,
                                 strerror (errno));
-             bi = grub_util_fopen (sysarea_img, "wb");
+             bi = grub_util_fopen (bin, "rb");
              if (!bi)
                grub_util_error (_("cannot open `%s': %s"), bin,
                                 strerror (errno));
@@ -519,10 +519,10 @@ main (int argc, char *argv[])
              fclose (bi);
              fwrite (buf, 1, 512, sa);
              
-             grub_install_make_image_wrap (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC],
-                                           "/boot/grub", output,
-                                           0, load_cfg,
-                                           "i386-pc", 0);
+             grub_install_make_image_wrap_file (source_dirs[GRUB_INSTALL_PLATFORM_I386_PC],
+                                                "/boot/grub", sa, sysarea_img,
+                                                0, load_cfg,
+                                                "i386-pc", 0);
              sz = ftello (sa);
              fflush (sa);
              grub_util_fd_sync (fileno (sa));