All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: whereis grub shell ?
Date: Wed, 19 Mar 2008 19:04:55 -0400	[thread overview]
Message-ID: <1205967895.7538.31.camel@dv> (raw)
In-Reply-To: <200803192358.54130.bhyoram@zahav.net.il>

On Wed, 2008-03-19 at 23:58 +0200, yoram bar haim wrote:
> On Tuesday 18 March 2008 22:37:13 Pavel Roskin wrote:
> > There is no "savedefault".  It hasn't been implemented yet.  And if it's
> > implemented, I would actually prefer that grub-emu is only allowed to do
> > it by the means of hostfs, not directly.
> 
> I respcetfully disagree. I think that if possible, host filesystems should 
> only be accessed as "readonly" by a bootloader.

We are talking about different things.  grub-emu is not a bootloader,
it's a userspace program.

Anyway, the functionality for writing to files from the bootloader was
present in GRUB 1, and I think it can be ported to GRUB 2.  Perhaps it
would be nice to have extra sanity checks for the filesystems that
checksum, compress or mirror the data.

But generally, it's a widely used feature, and I'm not aware of many
users having their filesystems trashed by GRUB 1.

>  that also saves the efforts 
> of implementing safe writing capabilities to all filesystems that grub can 
> possibly read configuration from.

Please note that it's not a general writing capability.  It's a
capability of writing to a certain short file without changing its
length or any metadata (timestamps etc).  If necessary, the file can be
created by a userspace utility that would try to ensure that the file is
contiguous and uncompressed.  The file could also include its sector
number at the time of creation, so that the bootloader would not write
to the file if it was relocated.

> I understand that any alternative (probably exploiting reserved byte at the 
> MBR or bootsector) is durty hack, so if there is an agreed way to 
> implement "savedefault" but no time to do that, I will be happy to help by 
> implementing it in any way that is agreed by the good people here.

It should be possible to write to the GRUB bootloader in the MBR or in
the reserved part of the filesystem, but it's actually less portable.
The low-level details of GRUB installation may be different on different
systems.  Besides, there is less space there.  It would be nice to have
a whole sector (512 bytes) available.

I think nobody would object that we need savedefault functionality that
is safe and reasonably portable.  As for the details, perhaps whoever
supplies the patch should have a choice.

I don't think anyone expects savedefault to work under any conditions,
such as RAID, LVM and particularly nasty filesystems.  But ext2 and fat
should work.

-- 
Regards,
Pavel Roskin



  reply	other threads:[~2008-03-19 23:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-16 20:41 whereis grub shell ? yoram bar haim
2008-03-16 20:49 ` Pavel Roskin
2008-03-16 21:05   ` yoram bar haim
2008-03-16 21:19   ` yoram bar haim
2008-03-18 12:02   ` Robert Millan
2008-03-18 19:31     ` yoram bar haim
2008-03-18 20:07       ` Robert Millan
2008-03-18 20:37       ` Pavel Roskin
2008-03-19 21:58         ` yoram bar haim
2008-03-19 23:04           ` Pavel Roskin [this message]
2008-04-13 11:02             ` Robert Millan

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=1205967895.7538.31.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.