All of lore.kernel.org
 help / color / mirror / Atom feed
* Proposal for savedefault implementation
@ 2008-03-20  8:09 Pavel Roskin
  2008-03-20 12:28 ` Bean
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Roskin @ 2008-03-20  8:09 UTC (permalink / raw)
  To: The development of GRUB 2

Hello!

I cannot promise I'll do the coding myself, but I've been thinking of  
a safe approach to savedefault implementation, and I'd like to share  
some of my thoughts.

GRUB should support only one kind of writing to the disk, namely  
writing to one sector at a specified offset.  Even that is not  
trivial, as we should try to support BIOS, openfirmware and ATA.  And  
maybe we should try to support RAID at some point.

There should be a utility capable of creating a "blessed sector" where  
GRUB would be allowed to write.  Choosing the location is up to that  
utility and the user running it.  It could be a bootloader area of a  
partition, a sector on the first track of the hard drive or a file on  
the filesystem.

The utility must ensure that GRUB can write to that sector safely at  
the boot time.  In particular, it should be indeed aligned at the  
sector boundary, it should not be compressed or fragmented.  If it's  
on RAID, the bootloader should know what to do.  Only GRUB and the  
utility should ever write to that sector.  Using any other tools  
should be discouraged.

What could be in the "blessed sector":

version of the utility that created it
minimal version of GRUB allowed to write
sector size
sector number on the drive
data length
modification time?
counter, which is incremented on write?
drives and sectors to write copies to?
settings, perhaps stored as 0-terminated strings in the format key=value

GRUB should read the sector first, perhaps using the filesystem.  It  
should check that its version is at least the required one.  Then it  
should re-read the sector by the sector number.  The data should be  
exactly the same.  That should allow writing by the sector number.

The command for writing should save variables from the environment.   
Likewise, reading from the file should copy variables to the  
environment.

-- 
Regards,
Pavel Roskin



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-03-22  7:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-20  8:09 Proposal for savedefault implementation Pavel Roskin
2008-03-20 12:28 ` Bean
2008-03-20 16:26   ` Pavel Roskin
2008-03-21  8:57     ` Bean
2008-03-21 11:31       ` Bean
2008-03-22  6:36         ` Pavel Roskin
2008-03-22  7:23           ` Bean

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.