I don't see how to open a bug in Bug Tracker, so I'm sending it to the list.

Legacy savedefault saves the current entry as the default boot entry if no
argument is specified. The translation only saves the first word of a
multiword title.

In addition, savedefault NUM and savedefault fallback are not supported.

The attached patch to the latest git source fixes this.

Norman Shulman
Sr. Developer/Architect
N-Dimension Solutions Inc.
9030 Leslie St, Unit 300
Richmond Hill, ON L4B 1G2

Tel: 905 707-8884 x 226
Fax: 905 707-0886

This email and any files transmitted with it are solely intended for the
use of the named recipient(s) and may contain information that is
privileged and confidential. If you receive this email in error, please
immediately notify the sender and delete this message in all its forms.
diff --git a/grub-core/lib/legacy_parse.c b/grub-core/lib/legacy_parse.c
index ef56150..3694806 100644
--- a/grub-core/lib/legacy_parse.c
+++ b/grub-core/lib/legacy_parse.c
@@ -285,12 +285,15 @@ static struct legacy_command legacy_commands[] =
      " derived from attempting the mount will NOT work correctly."},
     {"rootnoverify", "echo \"$root\"\n", NULL, 0,
      0, {}, FLAG_FALLBACK, NULL, NULL},
-    /* FIXME: support saving NUM and fallback.  */
-    {"savedefault", "saved_entry=${chosen}; save_env saved_entry\n", NULL, 0,
-     0, {}, 0, "[NUM | `fallback']",
+    {"savedefault",
+     "saved_entry='%s'\n"
+     "if [ \"$saved_entry\" = \"fallback\" ]; then saved_entry=\"$fallback\"; fi\n"
+     "if [ \"$saved_entry\" = \"\" ]; then saved_entry=\"${chosen}\"; fi\n"
+     "save_env saved_entry\n", 
+     NULL, 0, 1, {TYPE_VERBATIM}, 0, "[NUM|fallback]",
      "Save the current entry as the default boot entry if no argument is"
      " specified. If a number is specified, this number is saved. If"
-     " `fallback' is used, next fallback entry is saved."},
+     " 'fallback' is used, the fallback entry is saved."},
     {"serial", "serial %s\n", NULL, 0, 1, {TYPE_REST_VERBATIM}, 0, 
      "[--unit=UNIT] [--port=PORT] [--speed=SPEED] [--word=WORD] "
      "[--parity=PARITY] [--stop=STOP] [--device=DEV]",
Bug-grub mailing list

Reply via email to