Re: [PATCH] Save/Load environment variable support

2008-07-03 Thread Robert Millan
On Fri, Jul 04, 2008 at 04:11:07AM +0800, Bean wrote: > > BTW, I think update-grub should create a new grubenv if it doesn't > exists, so that user won't see the file not found error. Would be interesting if update-grub added a "savedefault" blob to each menuentry, and loaded the default afterwar

Re: [PATCH] Save/Load environment variable support

2008-07-03 Thread Bean
On Fri, Jul 4, 2008 at 4:41 AM, Marco Gerards <[EMAIL PROTECTED]> wrote: > Pavel Roskin <[EMAIL PROTECTED]> writes: > >> On Thu, 2008-07-03 at 20:04 +0200, Marco Gerards wrote: >> >>> Great! Can you explain how it works? >> >> Very good question. It's not "discoverable". I could not find way to

Re: [PATCH] Save/Load environment variable support

2008-07-03 Thread Marco Gerards
Pavel Roskin <[EMAIL PROTECTED]> writes: > On Thu, 2008-07-03 at 20:04 +0200, Marco Gerards wrote: > >> Great! Can you explain how it works? > > Very good question. It's not "discoverable". I could not find way to > figure out that /boot/grub/grubenv is the default without looking at the > code

Re: [PATCH] Save/Load environment variable support

2008-07-03 Thread Bean
On Fri, Jul 4, 2008 at 2:09 AM, Pavel Roskin <[EMAIL PROTECTED]> wrote: > On Thu, 2008-07-03 at 20:04 +0200, Marco Gerards wrote: > >> Great! Can you explain how it works? > > Very good question. It's not "discoverable". I could not find way to > figure out that /boot/grub/grubenv is the default

Re: [PATCH] Save/Load environment variable support

2008-07-03 Thread Pavel Roskin
On Thu, 2008-07-03 at 20:04 +0200, Marco Gerards wrote: > Great! Can you explain how it works? Very good question. It's not "discoverable". I could not find way to figure out that /boot/grub/grubenv is the default without looking at the code. load_env without arguments merely prints "error: f

Re: [PATCH] Save/Load environment variable support

2008-07-03 Thread Marco Gerards
Bean <[EMAIL PROTECTED]> writes: > On Tue, Jul 1, 2008 at 11:54 PM, Robert Millan <[EMAIL PROTECTED]> wrote: >> On Mon, Jun 30, 2008 at 09:06:28PM +0800, Bean wrote: >>> Hi, >>> >>> This is the new patch, some changes: >>> >>> 1, envblk.h, remove GRUB_ENVBLK_RDIR and the like, they're not needed >

Re: [PATCH] Save/Load environment variable support

2008-07-02 Thread Bean
On Tue, Jul 1, 2008 at 11:54 PM, Robert Millan <[EMAIL PROTECTED]> wrote: > On Mon, Jun 30, 2008 at 09:06:28PM +0800, Bean wrote: >> Hi, >> >> This is the new patch, some changes: >> >> 1, envblk.h, remove GRUB_ENVBLK_RDIR and the like, they're not needed >> in this patch. >> 2, util/envblk.c, use

Re: [PATCH] Save/Load environment variable support

2008-07-01 Thread Robert Millan
On Mon, Jun 30, 2008 at 09:06:28PM +0800, Bean wrote: > Hi, > > This is the new patch, some changes: > > 1, envblk.h, remove GRUB_ENVBLK_RDIR and the like, they're not needed > in this patch. > 2, util/envblk.c, use grub_* function for string manipulation. > 3, commands/loadenv.c, use grub_disk_r

Re: [PATCH] Save/Load environment variable support

2008-06-30 Thread Bean
Hi, This is the new patch, some changes: 1, envblk.h, remove GRUB_ENVBLK_RDIR and the like, they're not needed in this patch. 2, util/envblk.c, use grub_* function for string manipulation. 3, commands/loadenv.c, use grub_disk_read/grub_disk_write to read/write disk, the problem of lower level api

Re: [PATCH] Save/Load environment variable support

2008-06-15 Thread Bean
On Sun, Jun 15, 2008 at 9:25 PM, Robert Millan <[EMAIL PROTECTED]> wrote: > On Sun, Jun 15, 2008 at 03:44:56AM +0800, Bean wrote: >> >> +#define grub_strlen strlen >> >> +#define grub_strcpy strcpy >> >> +#define grub_strchr strchr >> >> +#define grub_memcmp memcmp >> >> +#define grub_memcpy m

Re: [PATCH] Save/Load environment variable support

2008-06-15 Thread Robert Millan
On Sun, Jun 15, 2008 at 03:44:56AM +0800, Bean wrote: > >> +#define grub_strlen strlen > >> +#define grub_strcpy strcpy > >> +#define grub_strchr strchr > >> +#define grub_memcmp memcmp > >> +#define grub_memcpy memcpy > > > > Uhm can we avoid this? The rest of non-util code just calls the gr

Re: [PATCH] Save/Load environment variable support

2008-06-14 Thread Bean
On Sun, Jun 15, 2008 at 3:30 AM, Robert Millan <[EMAIL PROTECTED]> wrote: > On Fri, Jun 13, 2008 at 03:07:54PM +0800, Bean wrote: >> # Misc. >> -pkglib_MODULES += gzio.mod elf.mod >> +pkglib_MODULES += gzio.mod elf.mod findroot.mod >> >> [...] >> +# For findroot.mod. >> +findroot_mod_SOURCES = ker

Re: [PATCH] Save/Load environment variable support

2008-06-14 Thread Robert Millan
On Fri, Jun 13, 2008 at 03:07:54PM +0800, Bean wrote: > # Misc. > -pkglib_MODULES += gzio.mod elf.mod > +pkglib_MODULES += gzio.mod elf.mod findroot.mod > > [...] > +# For findroot.mod. > +findroot_mod_SOURCES = kern/findroot.c > +findroot_mod_CFLAGS = $(COMMON_CFLAGS) > +findroot_mod_LDFLAGS =

Re: [PATCH] Save/Load environment variable support

2008-06-14 Thread Bean
On Sun, Jun 15, 2008 at 3:20 AM, Robert Millan <[EMAIL PROTECTED]> wrote: > On Sun, Jun 15, 2008 at 03:03:43AM +0800, Bean wrote: >> >> Hi, >> >> Yes, this is a standalone command, it's used to support persistent >> variable. For example, we can archive the result of savedefault using >> the follow

Re: [PATCH] Save/Load environment variable support

2008-06-14 Thread Robert Millan
On Sun, Jun 15, 2008 at 03:03:43AM +0800, Bean wrote: > > Hi, > > Yes, this is a standalone command, it's used to support persistent > variable. For example, we can archive the result of savedefault using > the following command: > > load_env > > menuentry aa { > save_env default > } > > loa

Re: [PATCH] Save/Load environment variable support

2008-06-14 Thread Bean
On Sun, Jun 15, 2008 at 2:47 AM, Robert Millan <[EMAIL PROTECTED]> wrote: > On Fri, Jun 13, 2008 at 03:07:54PM +0800, Bean wrote: >> Hi, >> >> I separate the save/load environment variable function from my >> previous patch on environment block. It contains the command >> save_env/load_env/list_env

Re: [PATCH] Save/Load environment variable support

2008-06-14 Thread Robert Millan
On Fri, Jun 13, 2008 at 03:07:54PM +0800, Bean wrote: > Hi, > > I separate the save/load environment variable function from my > previous patch on environment block. It contains the command > save_env/load_env/list_env and tool grub-editenv, but without the > kernel patch. > -- > Bean > > diff