* [PATCH] savedefault
@ 2009-06-01 10:48 Vladimir 'phcoder' Serbinenko
2009-06-07 7:50 ` Felix Zielcke
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-01 10:48 UTC (permalink / raw)
To: The development of GRUB 2
[-- Attachment #1: Type: text/plain, Size: 144 bytes --]
Hello. Here is a long-awaited savedefault patch. Works correctly only
if my scripting fix is applied
--
Regards
Vladimir 'phcoder' Serbinenko
[-- Attachment #2: savedefault.diff --]
[-- Type: text/x-diff, Size: 6404 bytes --]
diff --git a/include/grub/menu.h b/include/grub/menu.h
index 3bd25e8..bc04e43 100644
--- a/include/grub/menu.h
+++ b/include/grub/menu.h
@@ -81,7 +81,7 @@ typedef struct grub_menu_execute_callback
grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
int grub_menu_get_timeout (void);
void grub_menu_set_timeout (int timeout);
-void grub_menu_execute_entry (grub_menu_entry_t entry);
+void grub_menu_execute_entry(grub_menu_t menu, grub_menu_entry_t entry);
void grub_menu_execute_with_fallback (grub_menu_t menu,
grub_menu_entry_t entry,
grub_menu_execute_callback_t callback,
diff --git a/normal/menu.c b/normal/menu.c
index 59ad83f..df67973 100644
--- a/normal/menu.c
+++ b/normal/menu.c
@@ -122,8 +122,22 @@ get_and_remove_first_entry_number (const char *name)
/* Run a menu entry. */
void
-grub_menu_execute_entry(grub_menu_entry_t entry)
+grub_menu_execute_entry(grub_menu_t menu, grub_menu_entry_t entry)
{
+ grub_menu_entry_t e;
+ int no = 0;
+ char buf[64];
+
+ for (e = menu->entry_list; e && e != entry; e = e->next, no++);
+
+ if (e)
+ {
+ grub_sprintf (buf, "%d", no);
+ grub_env_set ("chosen_entry", buf);
+ }
+ else
+ grub_env_unset ("chosen_entry");
+
grub_parser_execute ((char *) entry->sourcecode);
if (grub_errno == GRUB_ERR_NONE && grub_loader_is_loaded ())
@@ -145,7 +159,7 @@ grub_menu_execute_with_fallback (grub_menu_t menu,
callback->notify_booting (entry, callback_data);
- grub_menu_execute_entry (entry);
+ grub_menu_execute_entry (menu, entry);
/* Deal with fallback entries. */
while ((fallback_entry = get_and_remove_first_entry_number ("fallback"))
@@ -156,7 +170,7 @@ grub_menu_execute_with_fallback (grub_menu_t menu,
entry = grub_menu_get_entry (menu, fallback_entry);
callback->notify_fallback (entry, callback_data);
- grub_menu_execute_entry (entry);
+ grub_menu_execute_entry (menu, entry);
/* If the function call to execute the entry returns at all, then this is
taken to indicate a boot failure. For menu entries that do something
other than actually boot an operating system, this could assume
diff --git a/normal/menu_text.c b/normal/menu_text.c
index e0d96c4..dd154e4 100644
--- a/normal/menu_text.c
+++ b/normal/menu_text.c
@@ -580,7 +580,7 @@ show_text_menu (grub_menu_t menu, int nested)
else
{
grub_errno = GRUB_ERR_NONE;
- grub_menu_execute_entry (e);
+ grub_menu_execute_entry (menu, e);
if (grub_errno != GRUB_ERR_NONE)
{
grub_print_error ();
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index d8fa416..a019b36 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -32,10 +32,13 @@ for i in ${GRUB_PRELOAD_MODULES} ; do
done
if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi
+if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then GRUB_DEFAULT='${saved_entry}' ; fi
+
if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi
if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi
cat << EOF
+load_env
set default=${GRUB_DEFAULT}
set timeout=${GRUB_TIMEOUT}
EOF
diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in
index 11e3a25..444fc42 100644
--- a/util/grub.d/10_freebsd.in
+++ b/util/grub.d/10_freebsd.in
@@ -57,6 +57,8 @@ if [ "x$kfreebsd" != "x" ] ; then
cat << EOF
menuentry "${OS}" {
+ saved_entry=\${chosen_entry}
+ save_env saved_entry
EOF
prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
cat << EOF
diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in
index 12d61b0..114017b 100644
--- a/util/grub.d/10_hurd.in
+++ b/util/grub.d/10_hurd.in
@@ -70,6 +70,8 @@ fi
cat << EOF
menuentry "${OS}" {
+ saved_entry=\${chosen_entry}
+ save_env saved_entry
EOF
prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/"
cat << EOF
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index c2da413..93d141b 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -97,6 +97,8 @@ linux_entry ()
{
cat << EOF
menuentry "$1" {
+ saved_entry=\${chosen_entry}
+ save_env saved_entry
EOF
prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
cat << EOF
diff --git a/util/grub.d/10_windows.in b/util/grub.d/10_windows.in
index 8877b15..fc70e59 100644
--- a/util/grub.d/10_windows.in
+++ b/util/grub.d/10_windows.in
@@ -71,6 +71,8 @@ for dir in $dirlist ; do
echo "Found $OS on $dir ($dev)" >&2
cat << EOF
menuentry "$OS" {
+ saved_entry=\${chosen_entry}
+ save_env saved_entry
EOF
prepare_grub_to_access_device "$dev" | sed 's,^,\t,'
diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in
index a145277..352e464 100644
--- a/util/grub.d/30_os-prober.in
+++ b/util/grub.d/30_os-prober.in
@@ -45,6 +45,8 @@ for OS in ${OSPROBED} ; do
cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" {
+ saved_entry=\${chosen_entry}
+ save_env saved_entry
set root=${CHAINROOT}
chainloader +1
}
@@ -69,6 +71,8 @@ EOF
cat << EOF
menuentry "${LLABEL} (on ${DEVICE})" {
+ saved_entry=\${chosen_entry}
+ save_env saved_entry
set root=${LINUXROOT}
linux ${LKERNEL} ${LPARAMS}
EOF
@@ -88,6 +92,8 @@ EOF
OSXDISK=disk"`echo ${OSXROOT} | awk -F , '{ print $1 ; }' | sed 's/(hd//;'`"s"`echo ${OSXROOT} | awk -F , '{ print $2 ; }' | sed 's/)//;'`"
cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" {
+ saved_entry=\${chosen_entry}
+ save_env saved_entry
set root=${OSXROOT}
insmod vbe
insmod gfxterm
diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in
index 468a72e..0b9572b 100644
--- a/util/i386/pc/grub-install.in
+++ b/util/i386/pc/grub-install.in
@@ -39,6 +39,7 @@ else
fi
grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}`
grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
+grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
rootdir=
grub_prefix=`echo /boot/grub | sed ${transform}`
modules=
@@ -230,6 +231,10 @@ if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
done
fi
+if ! test -f ${grubdir}/grubenv; then
+ $grub_editenv ${grubdir}/grubenv create
+fi
+
# Write device to a variable so we don't have to traverse /dev every time.
grub_device=`$grub_probe --target=device ${grubdir}`
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH] savedefault
2009-06-01 10:48 [PATCH] savedefault Vladimir 'phcoder' Serbinenko
@ 2009-06-07 7:50 ` Felix Zielcke
2009-06-07 9:14 ` Vladimir 'phcoder' Serbinenko
2009-06-07 9:35 ` Bean
2009-06-11 20:05 ` Robert Millan
2 siblings, 1 reply; 9+ messages in thread
From: Felix Zielcke @ 2009-06-07 7:50 UTC (permalink / raw)
To: The development of GRUB 2
Am Montag, den 01.06.2009, 12:48 +0200 schrieb Vladimir 'phcoder'
Serbinenko:
> Hello. Here is a long-awaited savedefault patch. Works correctly only
> if my scripting fix is applied
What happens if this is used on RAID?
Especially when the grubenv file is wrapped by the chunksize?
We should consider this if we use saven_env by default.
--
Felix Zielcke
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] savedefault
2009-06-07 7:50 ` Felix Zielcke
@ 2009-06-07 9:14 ` Vladimir 'phcoder' Serbinenko
0 siblings, 0 replies; 9+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-07 9:14 UTC (permalink / raw)
To: The development of GRUB 2
On Sun, Jun 7, 2009 at 9:50 AM, Felix Zielcke<fzielcke@z-51.de> wrote:
> Am Montag, den 01.06.2009, 12:48 +0200 schrieb Vladimir 'phcoder'
> Serbinenko:
>> Hello. Here is a long-awaited savedefault patch. Works correctly only
>> if my scripting fix is applied
>
> What happens if this is used on RAID?
Then writing is handled by raid module which always return
GRUB_ERR_NOT_IMPLEMENTED_YET which would make save_env fail. If users
circumvent raid module they do a faulty install and it's their fault
if their RAID gets desynchronised
> Especially when the grubenv file is wrapped by the chunksize?
> We should consider this if we use saven_env by default.
> --
> Felix Zielcke
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'phcoder' Serbinenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] savedefault
2009-06-01 10:48 [PATCH] savedefault Vladimir 'phcoder' Serbinenko
2009-06-07 7:50 ` Felix Zielcke
@ 2009-06-07 9:35 ` Bean
2009-06-07 14:51 ` Vladimir 'phcoder' Serbinenko
2009-06-11 20:05 ` Robert Millan
2 siblings, 1 reply; 9+ messages in thread
From: Bean @ 2009-06-07 9:35 UTC (permalink / raw)
To: The development of GRUB 2
Hi,
Actually, I'm thinking about a more generic method to implement this
feature with events. The menu viewer fire events at certain
circumstance, and we can configure the commands to execute. For
example, we could have a menu.select event fire when a menu item is
selected, and use something like this in grub.cfg:
event add menu.select save_env saved_entry
Command "save_env saved_entry" would be run automatically, no need to
patch up the menu items.
One advantage with the event model is that it can handle password at
the same time, for example, we could write something like this:
event add menu.select_check password
event add menu.commandline_check password
password command is run when user tries to select the menu item or
enter command line.
On Mon, Jun 1, 2009 at 6:48 PM, Vladimir 'phcoder'
Serbinenko<phcoder@gmail.com> wrote:
> Hello. Here is a long-awaited savedefault patch. Works correctly only
> if my scripting fix is applied
>
> --
> Regards
> Vladimir 'phcoder' Serbinenko
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>
--
Bean
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] savedefault
2009-06-07 9:35 ` Bean
@ 2009-06-07 14:51 ` Vladimir 'phcoder' Serbinenko
2009-06-08 7:37 ` Bean
0 siblings, 1 reply; 9+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-07 14:51 UTC (permalink / raw)
To: The development of GRUB 2
Hello. Welcome back
On Sun, Jun 7, 2009 at 11:35 AM, Bean<bean123ch@gmail.com> wrote:
> Hi,
>
> Actually, I'm thinking about a more generic method to implement this
> feature with events. The menu viewer fire events at certain
> circumstance, and we can configure the commands to execute. For
> example, we could have a menu.select event fire when a menu item is
> selected, and use something like this in grub.cfg:
>
> event add menu.select save_env saved_entry
>
> Command "save_env saved_entry" would be run automatically, no need to
> patch up the menu items.
Often user doesn't want some entries to be saved as default. E.g.
"single user" entries. I know that it's easy to revert to other method
but if nearly everyone does your work will be effort for nothing
>
> One advantage with the event model is that it can handle password at
> the same time, for example, we could write something like this:
>
> event add menu.select_check password
> event add menu.commandline_check password
>
> password command is run when user tries to select the menu item or
> enter command line.
>
> On Mon, Jun 1, 2009 at 6:48 PM, Vladimir 'phcoder'
> Serbinenko<phcoder@gmail.com> wrote:
>> Hello. Here is a long-awaited savedefault patch. Works correctly only
>> if my scripting fix is applied
>>
>> --
>> Regards
>> Vladimir 'phcoder' Serbinenko
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> http://lists.gnu.org/mailman/listinfo/grub-devel
>>
>>
>
>
>
> --
> Bean
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'phcoder' Serbinenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] savedefault
2009-06-07 14:51 ` Vladimir 'phcoder' Serbinenko
@ 2009-06-08 7:37 ` Bean
2009-06-11 18:38 ` Vladimir 'phcoder' Serbinenko
0 siblings, 1 reply; 9+ messages in thread
From: Bean @ 2009-06-08 7:37 UTC (permalink / raw)
To: The development of GRUB 2
On Sun, Jun 7, 2009 at 10:51 PM, Vladimir 'phcoder'
Serbinenko<phcoder@gmail.com> wrote:
> Hello. Welcome back
>
> On Sun, Jun 7, 2009 at 11:35 AM, Bean<bean123ch@gmail.com> wrote:
>> Hi,
>>
>> Actually, I'm thinking about a more generic method to implement this
>> feature with events. The menu viewer fire events at certain
>> circumstance, and we can configure the commands to execute. For
>> example, we could have a menu.select event fire when a menu item is
>> selected, and use something like this in grub.cfg:
>>
>> event add menu.select save_env saved_entry
>>
>> Command "save_env saved_entry" would be run automatically, no need to
>> patch up the menu items.
> Often user doesn't want some entries to be saved as default. E.g.
> "single user" entries. I know that it's easy to revert to other method
> but if nearly everyone does your work will be effort for nothing
Hi,
Now the menuitem support attributes, perhaps we could utilize it to
store parameters for the event handler, for example, "save/nosave" for
savedefault, "lock/unlock" for password, etc.
>>
>> One advantage with the event model is that it can handle password at
>> the same time, for example, we could write something like this:
>>
>> event add menu.select_check password
>> event add menu.commandline_check password
>>
>> password command is run when user tries to select the menu item or
>> enter command line.
>>
>> On Mon, Jun 1, 2009 at 6:48 PM, Vladimir 'phcoder'
>> Serbinenko<phcoder@gmail.com> wrote:
>>> Hello. Here is a long-awaited savedefault patch. Works correctly only
>>> if my scripting fix is applied
>>>
>>> --
>>> Regards
>>> Vladimir 'phcoder' Serbinenko
>>>
>>> _______________________________________________
>>> Grub-devel mailing list
>>> Grub-devel@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/grub-devel
>>>
>>>
>>
>>
>>
>> --
>> Bean
>>
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> http://lists.gnu.org/mailman/listinfo/grub-devel
>>
>
>
>
> --
> Regards
> Vladimir 'phcoder' Serbinenko
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Bean
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] savedefault
2009-06-08 7:37 ` Bean
@ 2009-06-11 18:38 ` Vladimir 'phcoder' Serbinenko
0 siblings, 0 replies; 9+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-11 18:38 UTC (permalink / raw)
To: The development of GRUB 2; +Cc: Bean
Hello
On Mon, Jun 8, 2009 at 9:37 AM, Bean<bean123ch@gmail.com> wrote:
> On Sun, Jun 7, 2009 at 10:51 PM, Vladimir 'phcoder'
> Serbinenko<phcoder@gmail.com> wrote:
>> Hello. Welcome back
>>
>> On Sun, Jun 7, 2009 at 11:35 AM, Bean<bean123ch@gmail.com> wrote:
>>> Hi,
>>>
>>> Actually, I'm thinking about a more generic method to implement this
>>> feature with events. The menu viewer fire events at certain
>>> circumstance, and we can configure the commands to execute. For
>>> example, we could have a menu.select event fire when a menu item is
>>> selected, and use something like this in grub.cfg:
>>>
>>> event add menu.select save_env saved_entry
>>>
>>> Command "save_env saved_entry" would be run automatically, no need to
>>> patch up the menu items.
>> Often user doesn't want some entries to be saved as default. E.g.
>> "single user" entries. I know that it's easy to revert to other method
>> but if nearly everyone does your work will be effort for nothing
>
> Hi,
>
> Now the menuitem support attributes, perhaps we could utilize it to
> store parameters for the event handler, for example, "save/nosave" for
> savedefault, "lock/unlock" for password, etc.
>
Difficult to say whether such addition would be useful. I feel like
it's over-engineering. I may be wrong however. Fell free to expose
what you have in your head about this idea.
Meanwhile could we merge my patch? We can add fancy handlers later
>>>
>>> One advantage with the event model is that it can handle password at
>>> the same time, for example, we could write something like this:
>>>
>>> event add menu.select_check password
>>> event add menu.commandline_check password
>>>
>>> password command is run when user tries to select the menu item or
>>> enter command line.
>>>
>>> On Mon, Jun 1, 2009 at 6:48 PM, Vladimir 'phcoder'
>>> Serbinenko<phcoder@gmail.com> wrote:
>>>> Hello. Here is a long-awaited savedefault patch. Works correctly only
>>>> if my scripting fix is applied
>>>>
>>>> --
>>>> Regards
>>>> Vladimir 'phcoder' Serbinenko
>>>>
>>>> _______________________________________________
>>>> Grub-devel mailing list
>>>> Grub-devel@gnu.org
>>>> http://lists.gnu.org/mailman/listinfo/grub-devel
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Bean
>>>
>>>
>>> _______________________________________________
>>> Grub-devel mailing list
>>> Grub-devel@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/grub-devel
>>>
>>
>>
>>
>> --
>> Regards
>> Vladimir 'phcoder' Serbinenko
>>
>>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> http://lists.gnu.org/mailman/listinfo/grub-devel
>>
>
>
>
> --
> Bean
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'phcoder' Serbinenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] savedefault
2009-06-01 10:48 [PATCH] savedefault Vladimir 'phcoder' Serbinenko
2009-06-07 7:50 ` Felix Zielcke
2009-06-07 9:35 ` Bean
@ 2009-06-11 20:05 ` Robert Millan
2009-06-12 1:04 ` Pavel Roskin
2 siblings, 1 reply; 9+ messages in thread
From: Robert Millan @ 2009-06-11 20:05 UTC (permalink / raw)
To: The development of GRUB 2
Hi!
On Mon, Jun 01, 2009 at 12:48:38PM +0200, Vladimir 'phcoder' Serbinenko wrote:
> cat << EOF
> +load_env
> set default=${GRUB_DEFAULT}
Does the "set" line override the settings in load_env? It looks like it
would.
> --- a/util/grub.d/10_freebsd.in
> +++ b/util/grub.d/10_freebsd.in
> @@ -57,6 +57,8 @@ if [ "x$kfreebsd" != "x" ] ; then
>
> cat << EOF
> menuentry "${OS}" {
> + saved_entry=\${chosen_entry}
> + save_env saved_entry
> EOF
> prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
> cat << EOF
> diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in
> index 12d61b0..114017b 100644
> --- a/util/grub.d/10_hurd.in
> +++ b/util/grub.d/10_hurd.in
> @@ -70,6 +70,8 @@ fi
>
> cat << EOF
> menuentry "${OS}" {
> + saved_entry=\${chosen_entry}
> + save_env saved_entry
> EOF
> prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/"
> cat << EOF
> diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
> index c2da413..93d141b 100644
> --- a/util/grub.d/10_linux.in
> +++ b/util/grub.d/10_linux.in
> @@ -97,6 +97,8 @@ linux_entry ()
> {
> cat << EOF
> menuentry "$1" {
> + saved_entry=\${chosen_entry}
> + save_env saved_entry
> EOF
> prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
> cat << EOF
I think it'd really be a good idea to either factorize this into a function
(ala prepare_grub_to_access_device), or make it part of the scripting engine.
I'm afraid of the possibility that later we want to change something and can't
because 3rd party scripts depend on it (this happened with disk selection
before we had prepare_grub_to_access_device).
--
Robert Millan
The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
how) you may access your data; but nobody's threatening your freedom: we
still allow you to remove your data and not access it at all."
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH] savedefault
2009-06-11 20:05 ` Robert Millan
@ 2009-06-12 1:04 ` Pavel Roskin
0 siblings, 0 replies; 9+ messages in thread
From: Pavel Roskin @ 2009-06-12 1:04 UTC (permalink / raw)
To: grub-devel
Quoting Robert Millan <rmh@aybabtu.com>:
>> + saved_entry=\${chosen_entry}
>> + save_env saved_entry
>> EOF
>> prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/"
>> cat << EOF
>
> I think it'd really be a good idea to either factorize this into a function
> (ala prepare_grub_to_access_device), or make it part of the scripting engine.
I already mentioned the possibility of having an argument to save_env
to allow saving a variable under a different name, e.g.:
save_env --as saved_entry chosen_entry
Another approach would be to allow saving text from the command line:
save_env saved_entry="$chosen_entry"
> I'm afraid of the possibility that later we want to change something
> and can't
> because 3rd party scripts depend on it (this happened with disk selection
> before we had prepare_grub_to_access_device).
I think we would want to use text, not numbers. We have enough space
in the environment for that. It's more reliable.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-06-12 1:05 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-01 10:48 [PATCH] savedefault Vladimir 'phcoder' Serbinenko
2009-06-07 7:50 ` Felix Zielcke
2009-06-07 9:14 ` Vladimir 'phcoder' Serbinenko
2009-06-07 9:35 ` Bean
2009-06-07 14:51 ` Vladimir 'phcoder' Serbinenko
2009-06-08 7:37 ` Bean
2009-06-11 18:38 ` Vladimir 'phcoder' Serbinenko
2009-06-11 20:05 ` Robert Millan
2009-06-12 1:04 ` Pavel Roskin
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.