[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
i386/pc/grub-setup.c question
From: |
Seth Goldberg |
Subject: |
i386/pc/grub-setup.c question |
Date: |
Wed, 05 Aug 2009 01:41:10 -0700 (PDT) |
User-agent: |
Alpine 2.00 (GSO 1167 2008-08-23) |
Hi,
I've been looking at grub-setup.c and am perplexed by the following code:
/* Make sure that GRUB reads the identical image as the OS. */
tmp_img = xmalloc (core_size);
core_path_dev = grub_util_get_path (dir, core_file);
/* It is a Good Thing to sync two times. */
sync ();
sync ();
#define MAX_TRIES 5
for (i = 0; i < MAX_TRIES; i++)
{
grub_util_info ("attempting to read the core image `%s' from GRUB%s",
core_path_dev, (i == 0) ? "" : " again");
grub_disk_cache_invalidate_all ();
file = grub_file_open (core_path_dev);
if (file)
{
if (grub_file_size (file) != core_size)
....
Has the blocklist (--force) code path been tested? Since grub_file_open
fails if there's no device specified in the string, and since core_path_dev
cannot include a device spec (since it's a concatenation of the grub directory
+ the core filename), I can't see how this loop could work, but I may be
missing something :).
Thanks,
--S
- i386/pc/grub-setup.c question,
Seth Goldberg <=