All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: grub-devel@gnu.org
Subject: Failure to embed core.img is fatal now
Date: Wed, 25 Jun 2008 17:48:34 -0400	[thread overview]
Message-ID: <1214430514.11716.19.camel@dv> (raw)

Hello!

I have a system with a hard drive with a geometry that doesn't leave
space for GRUB to be embedded:

Disk /dev/sda: 30.0 GB, 30020272128 bytes
64 heads, 32 sectors/track, 28629 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk identifier: 0xfafa98d2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       26704    27344880   83  Linux
/dev/sda2           26705       28629     1971200   82  Linux swap / Solaris

I'm trying to install the current GRUB2:

# grub-install /dev/sda
grub-setup: error: Cannot read `/boot/grub/core.img' correctly

It turns out following happens in grub-setup:

- core.img is read by the OS facilities
- the memory image is modified
- the memory image is compared to core.img read by GRUB FS code and fails
- the memory image is modified again
- first 2 sectors of the memory image are written to core.img

I think the 2 sectors should be written before the image is read back.
I tried to fix it, but it didn't work in the first try (GRUB hangs after
showing "GRUB Loading kernel.")

I'm also surprised that the code alternately uses dir and
DEFAULT_DIRECTORY to calculate core_path.  core_path is calculated 3
times in one function!  If dir and DEFAULT_DIRECTORY are used correctly,
I suggest that two different variables are used for what is now called
core_path.

-- 
Regards,
Pavel Roskin



             reply	other threads:[~2008-06-25 21:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25 21:48 Pavel Roskin [this message]
2008-06-26  1:02 ` Failure to embed core.img is fatal now Javier Martín
2008-06-26  1:32   ` Pavel Roskin
2008-06-26  1:44 ` Pavel Roskin
2008-06-26 14:20 ` Robert Millan
2008-06-26 14:48   ` Pavel Roskin
2008-06-26 16:54     ` Pavel Roskin
2008-06-29 11:27       ` Robert Millan
2008-06-29 16:20         ` Pavel Roskin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1214430514.11716.19.camel@dv \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.