]> git.proxmox.com Git - grub2.git/commitdiff
2009-09-24 Robert Millan <rmh.grub@aybabtu.com>
authorrobertmh <robertmh@localhost>
Thu, 24 Sep 2009 13:22:19 +0000 (13:22 +0000)
committerrobertmh <robertmh@localhost>
Thu, 24 Sep 2009 13:22:19 +0000 (13:22 +0000)
        * util/i386/pc/grub-mkimage.c (generate_image): Enclose BIOS-specific
        size check within GRUB_MACHINE_PCBIOS section.

ChangeLog
util/i386/pc/grub-mkimage.c

index b5315fa703aea9c1bc5ed87bff5a6ac7e8a8726e..797b50874522a3b8e611b181b1d6daf7f7ce2eb2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-24  Robert Millan  <rmh.grub@aybabtu.com>
+
+       * util/i386/pc/grub-mkimage.c (generate_image): Enclose BIOS-specific
+       size check within GRUB_MACHINE_PCBIOS section.
+
 2009-09-24  Robert Millan  <rmh.grub@aybabtu.com>
 
        * include/grub/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate
index b81392ce8a1a656a0ee98d0c15ba20e991f5dedb..c8fe02e13bc954a784d98ccbb20597877c6d3302 100644 (file)
@@ -97,7 +97,6 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
   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 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
 
   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;