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]",