From: Zhu Yi <yi.zhu@intel.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Backup old boot sectors before installation
Date: Mon, 14 Dec 2009 10:48:42 +0800 [thread overview]
Message-ID: <1260758922.12157.281.camel@debian> (raw)
In-Reply-To: <1260524367.2832.10.camel@fz.local>
On Fri, 2009-12-11 at 17:39 +0800, Felix Zielcke wrote:
>
> Someone already made a patch for this inside grub-setup
> See here and also for the discussion of it:
> http://lists.gnu.org/archive/html/grub-devel/2009-09/msg00242.html
Thanks. If I knew this patch, I won't try to write one my own. I did do
some basic search and asked in #grub2 IRC before writing it though.
Anyway, I did a quick review for Garimella's patch. Both the ideas of
the two patches are the same: backup the mbr and boot sectors will be
overwritten by core.img to a file before grub2 overwrites them. The
implementations slightly differ in:
1. The format of the backup file.
The old boot sectors and the start of embed_region position is required
for both patches. Garimella also added some redundant fields (i.e. image
size and 0xff) for integrity checking. I think it's a good idea. But
something like a md5/sha1 checksum should be even better.
2. The image backup and recovery.
Both of the patches choose to backup the old boot sectors in
grub-setup.c. On the recovery, Garimella selected to do it in
grub-setup.c and I used grub-install script with dd(1). I don't think
this is a very big deal and either way is OK. The reason I choose
grub-install is I want to keep the grub-setup.c as clean as possible.
Because given the backup file format, one can recover it with dd(1) even
without any help with grub-setup.
3. The backup policy.
Garimella's patch backups every time before grub-setup overwrote the
boot sectors. There might be a problem when someone run
grub-setup/grub-install twice. So the backup image ends up with the
grub2 boot sectors. This makes the recovery for the "real" boot sectors
impossible. My patch won't overwrite if a previous backup image already
existed. grub-install will remove the backup image after a successful
recovery.
4. Blocklists installation.
This is not very important because blocklists is not recommended. To be
completeness, my patch backups the mbr if blocklists are used due to
embedding is not possible. This will be detected by grub-install as
well.
In conclusion, I believe this backup feature is useful and either
implementation should do the work. If we can merge the good parts of
them, we can get a better one. I just curious why the thread is stuck
since September. Any blocking issues with it? Can we keep the topic
moving forward? Your comments are highly welcome.
Thanks,
-yi
next prev parent reply other threads:[~2009-12-14 2:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-11 9:26 [PATCH] Backup old boot sectors before installation Zhu Yi
2009-12-11 9:39 ` Felix Zielcke
2009-12-11 22:23 ` Carles Pina i Estany
2009-12-14 2:48 ` Zhu Yi [this message]
2009-12-14 2:58 ` Isaac Dupree
2009-12-14 3:32 ` Zhu Yi
2009-12-14 2:59 ` kashyap garimella
2009-12-14 3:08 ` richardvoigt
2009-12-14 3:24 ` Isaac Dupree
2009-12-14 3:35 ` Zhu Yi
2009-12-14 3:52 ` Isaac Dupree
2009-12-14 3:15 ` Zhu Yi
2009-12-24 21:21 ` Robert Millan
2009-12-28 6:55 ` Zhu Yi
2009-12-28 22:04 ` Isaac Dupree
2009-12-29 3:21 ` Zhu Yi
2009-12-29 3:59 ` richardvoigt
2009-12-29 7:21 ` Zhu Yi
2010-01-07 19:15 ` rmh
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=1260758922.12157.281.camel@debian \
--to=yi.zhu@intel.com \
--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.