grub-devel
[Top][All Lists]
Advanced

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

LVM write support from grub2. Writing to environment block in core.img


From: Roger Cruz
Subject: LVM write support from grub2. Writing to environment block in core.img
Date: Mon, 9 Nov 2009 17:11:53 -0800 (PST)

I have a system where the boot partition is on top of an LVM.  I'm using the loadenv module to save state and remember the previously booted entry.  I have something like this:

if [ ${prev_saved_entry} ]; then
  saved_entry=${prev_saved_entry}
  save_env saved_entry
  prev_saved_entry=
  save_env prev_saved_entry
fi

In examining why save_env is not writing to grubenv, I came across this LVM routine that says LVM writes are not supported.
static grub_err_t
grub_lvm_write (grub_disk_t disk __attribute ((unused)),
             grub_disk_addr_t sector __attribute ((unused)),
             grub_size_t size __attribute ((unused)),
            const char *buf __attribute ((unused)))
{
  return GRUB_ERR_NOT_IMPLEMENTED_YET;
}

Is there a plan to add this support?  Anyone currently working on it that I may get an early implementation from?  If not, is there a technical reason why this would be hard for someone (maybe me) to implement?

As a work-around, I'm considering using the environment block in core.img.  Are there routines that can be run at boot time to allow grub to change the variables there, perhaps using the same module (loadenv) and so it can be used as "save_env -f core.img"?  Anyone see any reasons why I shouldn't write to that space?

Thanks
Roger



reply via email to

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