grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: whereis grub shell ?


From: Pavel Roskin
Subject: Re: whereis grub shell ?
Date: Wed, 19 Mar 2008 19:04:55 -0400

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 via email to

[Prev in Thread] Current Thread [Next in Thread]