hi,

I tried to use the savedefault command but it didn't work. Setup:
grub-0.5.96.1
built from tarball
install with grub-install on /dev/hda
There seems to be something wrong with savedefault. I changed the stage2
saved_entry in asm.S to test the "default saved" command and it worked.
Running the savedefault command as part of an menu entry doesn't produce
any error messages, and there seems to be disk activity (read or write).
I have attached a patch to stage2/builtins.c that I wanted to
use in the beginning, it lets one use a parameter that is stored as saved entry
instead of the current one. savedefault doesn't seem to work, neither in the
original nor in the patched version.
Can someone help?

Thanks,

Torvald
2872a2873,2882
>   int new_entryno;
>   int old_errnum;
> 
>   /* if an integer was passed as argument use it instead of the current
>      entry */
>   old_errnum = errnum;
>   if (!safe_parse_maxint (&arg, &new_entryno)) {
>     new_entryno = current_entryno;
>     errnum = old_errnum;
>   }
2900,2901c2910,2911
<   /* Check if the saved entry number differs from current entry number.  */
<   if (*entryno_ptr != current_entryno)
---
>   /* Check if the saved entry number differs from new/current entry number.  */
>   if (*entryno_ptr != new_entryno)
2904c2914
<       *entryno_ptr = current_entryno;
---
>       *entryno_ptr = new_entryno;
2930,2931c2940,2942
<   "savedefault",
<   "Save the current entry as the default boot entry."
---
>   "savedefault [new_entry]",
>   "Save an entry as the default boot entry. If new_enty is omitted the"
>   " current entry is saved."

Reply via email to