commit-grub
[Top][All Lists]
Advanced

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

[2612] 2009-09-24 Robert Millan <address@hidden>


From: Robert Millan
Subject: [2612] 2009-09-24 Robert Millan <address@hidden>
Date: Thu, 24 Sep 2009 13:22:21 +0000

Revision: 2612
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2612
Author:   robertmh
Date:     2009-09-24 13:22:19 +0000 (Thu, 24 Sep 2009)
Log Message:
-----------
2009-09-24  Robert Millan  <address@hidden>

        * util/i386/pc/grub-mkimage.c (generate_image): Enclose BIOS-specific
        size check within GRUB_MACHINE_PCBIOS section.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/util/i386/pc/grub-mkimage.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog       2009-09-24 13:15:51 UTC (rev 2611)
+++ trunk/grub2/ChangeLog       2009-09-24 13:22:19 UTC (rev 2612)
@@ -1,5 +1,10 @@
 2009-09-24  Robert Millan  <address@hidden>
 
+       * util/i386/pc/grub-mkimage.c (generate_image): Enclose BIOS-specific
+       size check within GRUB_MACHINE_PCBIOS section.
+
+2009-09-24  Robert Millan  <address@hidden>
+
        * include/grub/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate
        return value.
        * term/i386/pc/at_keyboard.c (grub_keyboard_getkey): Negate

Modified: trunk/grub2/util/i386/pc/grub-mkimage.c
===================================================================
--- trunk/grub2/util/i386/pc/grub-mkimage.c     2009-09-24 13:15:51 UTC (rev 
2611)
+++ trunk/grub2/util/i386/pc/grub-mkimage.c     2009-09-24 13:22:19 UTC (rev 
2612)
@@ -97,7 +97,6 @@
   size_t kernel_size, boot_size, total_module_size, core_size;
   size_t memdisk_size = 0, config_size = 0;
   char *kernel_path, *boot_path;
-  unsigned num;
   size_t offset;
   struct grub_util_path_list *path_list, *p, *next;
   struct grub_module_info *modinfo;
@@ -196,30 +195,30 @@
 
   grub_util_info ("the core size is 0x%x", core_size);
 
-  num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
-  if (num > 0xffff)
-    grub_util_error ("the core image is too big");
-
 #if defined(GRUB_MACHINE_PCBIOS)
-
-  boot_path = grub_util_get_path (dir, "diskboot.img");
-  boot_size = grub_util_get_image_size (boot_path);
-  if (boot_size != GRUB_DISK_SECTOR_SIZE)
-    grub_util_error ("diskboot.img is not one sector size");
-
-  boot_img = grub_util_read_image (boot_path);
-
-  /* i386 is a little endian architecture.  */
-  *((grub_uint16_t *) (boot_img + GRUB_DISK_SECTOR_SIZE
-                      - GRUB_BOOT_MACHINE_LIST_SIZE + 8))
-    = grub_cpu_to_le16 (num);
-
-  grub_util_write_image (boot_img, boot_size, out);
-  free (boot_img);
-  free (boot_path);
-
+  {
+    unsigned num;
+    num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
+    if (num > 0xffff)
+      grub_util_error ("the core image is too big");
+    
+    boot_path = grub_util_get_path (dir, "diskboot.img");
+    boot_size = grub_util_get_image_size (boot_path);
+    if (boot_size != GRUB_DISK_SECTOR_SIZE)
+      grub_util_error ("diskboot.img is not one sector size");
+    
+    boot_img = grub_util_read_image (boot_path);
+    
+    /* i386 is a little endian architecture.  */
+    *((grub_uint16_t *) (boot_img + GRUB_DISK_SECTOR_SIZE
+                        - GRUB_BOOT_MACHINE_LIST_SIZE + 8))
+      = grub_cpu_to_le16 (num);
+    
+    grub_util_write_image (boot_img, boot_size, out);
+    free (boot_img);
+    free (boot_path);
+  }
 #elif defined(GRUB_MACHINE_QEMU)
-
   {
     char *rom_img;
     size_t rom_size;





reply via email to

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