* util/grub-setup.c (write_rootdev): Remove unused core_img

parameter.  Update all callers.
(setup): Define core_sectors only if GRUB_SETUP_BIOS, to appease
'gcc -Wunused-but-set-variable'.  Remove unnecessary nested #ifdef
GRUB_SETUP_BIOS.
This commit is contained in:
Colin Watson 2012-09-19 02:41:51 +01:00
parent 140acd3c83
commit 735abf545c
2 changed files with 16 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2012-09-19 Colin Watson <cjwatson@ubuntu.com>
* util/grub-setup.c (write_rootdev): Remove unused core_img
parameter. Update all callers.
(setup): Define core_sectors only if GRUB_SETUP_BIOS, to appease
'gcc -Wunused-but-set-variable'. Remove unnecessary nested #ifdef
GRUB_SETUP_BIOS.
2012-09-18 Vladimir Serbinenko <phcoder@gmail.com> 2012-09-18 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkconfig_lib.in (grub_tab): New variable. * util/grub-mkconfig_lib.in (grub_tab): New variable.
@ -29,7 +37,7 @@
le-conversion. le-conversion.
Reported by: BURETTE, Bernard. Reported by: BURETTE, Bernard.
2012-09-17 Colin Watson <cjwatson@debian.org> 2012-09-17 Colin Watson <cjwatson@ubuntu.com>
* util/grub-mkconfig_lib.in (grub_quote): Remove outdated sentence * util/grub-mkconfig_lib.in (grub_quote): Remove outdated sentence
from comment. from comment.

View file

@ -105,7 +105,7 @@
#endif #endif
static void static void
write_rootdev (char *core_img, grub_device_t root_dev, write_rootdev (grub_device_t root_dev,
char *boot_img, grub_uint64_t first_sector) char *boot_img, grub_uint64_t first_sector)
{ {
#ifdef GRUB_SETUP_BIOS #ifdef GRUB_SETUP_BIOS
@ -148,7 +148,9 @@ setup (const char *dir,
char *boot_img, *core_img; char *boot_img, *core_img;
char *root = 0; char *root = 0;
size_t boot_size, core_size; size_t boot_size, core_size;
#ifdef GRUB_SETUP_BIOS
grub_uint16_t core_sectors; grub_uint16_t core_sectors;
#endif
grub_device_t root_dev = 0, dest_dev, core_dev; grub_device_t root_dev = 0, dest_dev, core_dev;
struct grub_boot_blocklist *first_block, *block; struct grub_boot_blocklist *first_block, *block;
char *tmp_img; char *tmp_img;
@ -229,8 +231,10 @@ setup (const char *dir,
core_path = grub_util_get_path (dir, core_file); core_path = grub_util_get_path (dir, core_file);
core_size = grub_util_get_image_size (core_path); core_size = grub_util_get_image_size (core_path);
#ifdef GRUB_SETUP_BIOS
core_sectors = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) core_sectors = ((core_size + GRUB_DISK_SECTOR_SIZE - 1)
>> GRUB_DISK_SECTOR_BITS); >> GRUB_DISK_SECTOR_BITS);
#endif
if (core_size < GRUB_DISK_SECTOR_SIZE) if (core_size < GRUB_DISK_SECTOR_SIZE)
grub_util_error (_("the size of `%s' is too small"), core_path); grub_util_error (_("the size of `%s' is too small"), core_path);
#ifdef GRUB_SETUP_BIOS #ifdef GRUB_SETUP_BIOS
@ -386,7 +390,6 @@ setup (const char *dir,
is_ldm = grub_util_is_ldm (dest_dev->disk); is_ldm = grub_util_is_ldm (dest_dev->disk);
#ifdef GRUB_SETUP_BIOS
if (fs_probe) if (fs_probe)
{ {
if (!fs && !dest_partmap) if (!fs && !dest_partmap)
@ -424,7 +427,6 @@ setup (const char *dir,
dest_dev->disk->name, dest_partmap->name); dest_dev->disk->name, dest_partmap->name);
} }
#endif
/* Copy the partition table. */ /* Copy the partition table. */
if (dest_partmap || if (dest_partmap ||
@ -520,7 +522,7 @@ setup (const char *dir,
block->len = 0; block->len = 0;
block->segment = 0; block->segment = 0;
write_rootdev (core_img, root_dev, boot_img, first_sector); write_rootdev (root_dev, boot_img, first_sector);
core_img = realloc (core_img, nsec * GRUB_DISK_SECTOR_SIZE); core_img = realloc (core_img, nsec * GRUB_DISK_SECTOR_SIZE);
first_block = (struct grub_boot_blocklist *) (core_img first_block = (struct grub_boot_blocklist *) (core_img
@ -858,7 +860,7 @@ unable_to_embed:
free (core_path_dev); free (core_path_dev);
free (tmp_img); free (tmp_img);
write_rootdev (core_img, root_dev, boot_img, first_sector); write_rootdev (root_dev, boot_img, first_sector);
/* Write the first two sectors of the core image onto the disk. */ /* Write the first two sectors of the core image onto the disk. */
grub_util_info ("opening the core image `%s'", core_path); grub_util_info ("opening the core image `%s'", core_path);