bugGNU GRUB - Bugs: bug #557, Rotating default boot? Possible...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #557: Rotating default boot? Possible feature

Submitter:  None
Submitted:  Fri 07 Jun 2002 12:18:19 AM UTC
   
 
Category:  Configuration Severity:  Major
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Originator Email:  -email is unavailable- Open/Closed:  Closed
Release:  None Release:  unknown
Reproducibility:  None Planned Release:  None

Jump to the original submission

Mon 21 Jun 2004 11:45:20 AM UTC, comment #6: 

This is done in the trunk of the CVS.

Yoshinori K. Okuji <okuji>
Group administrator
Tue 01 Oct 2002 12:07:57 PM UTC, comment #5: 

I'll second this patch. Much easier than having a forest of grub configuration files like I proposed below, and can be used to solve a number of interesting things including kind of emulation of the lilo -R option as requested in Bug #1241

Regards
Henrik

Henrik Nordstrom <hno>
Wed 11 Sep 2002 04:07:45 PM UTC, comment #4: 

You should be able to do this with a two stage menu system and using the savedefault option, without any changes to the existing GRUB code


Create three grub config files, making up a two levels directory structure



-- grub.conf ---
default saved
hiddenmenu
timeout=0
title Alternative 1
configfile (hd0,0)/boot/grub/alt1.conf
title Alternative 2
configfile (hd0,0)/boot/grub/alt2.conf

--- alt1.conf ---
default 2
timeout=10
title Alternative 2
configfile (hd0,0)/boot/grub/alt1.conf
title Alternative 1
kernel ...
savedefault

--- alt2.conf ---
default 2
timeout=10
title Alternative 1
kernel ...
savedefault
title Alternative 2
configfile (hd0,0)/boot/grub/alt2.conf


Regards
Henrik

Henrik Nordstrom <hno>
Sun 16 Jun 2002 10:08:29 PM UTC, comment #3: 

--- stage2/builtins.c.ORIG      Sun Jun 16 21:10:05 2002
+++ stage2/builtins.c   Sun Jun 16 23:50:24 2002
@@ -3197,7 +3197,8 @@
 #if !defined(SUPPORT_DISKLESS) && !defined(GRUB_UTIL)
   char buffer[512];
   int *entryno_ptr;

+  int entryno = 0;
+
   /* This command is only useful when you boot an entry from the menu
      interface.  */
   if (! (flags & BUILTIN_SCRIPT))
@@ -3205,6 +3206,12 @@
       errnum = ERR_UNRECOGNIZED;
       return 1;
     }
+
+  /* Get entryno, if specified. Otherwise the current */
+  if (! safe_parse_maxint (&arg, &entryno))
+    {
+      entryno = current_entryno;
+    }
  
   /* Get the geometry of the boot drive (i.e. the disk which contains
      this stage2).  */
@@ -3231,10 +3238,10 @@
   entryno_ptr = (int *) (buffer + STAGE2_SAVED_ENTRYNO);
 
   /* Check if the saved entry number differs from current entry number.  */
-  if (*entryno_ptr != current_entryno)
+  if (*entryno_ptr != entryno)
     {
       /* Overwrite the saved entry number.  */
-      *entryno_ptr = current_entryno;
+      *entryno_ptr = entryno;
      
       /* Save the image in the disk.  */
       if (! rawwrite (boot_drive, install_second_sector, buffer))
@@ -3256,8 +3263,9 @@
   "savedefault",
   savedefault_func,
   BUILTIN_CMDLINE,
-  "savedefault",
-  "Save the current entry as the default boot entry."
+  "savedefault [NUM]",
+  "Save the current entry or the entry number NUM "
+  "as the default boot entry."
 };

Anonymous
Sun 16 Jun 2002 10:05:57 PM UTC, comment #2: 

Can test with this little patch ? It realize the shiva suggestion.

Anonymous
Tue 11 Jun 2002 12:45:51 AM UTC, comment #1: 

I think this could be done by accepting a parameter in savedefault: the name of the boot section to save as the default for the next boot.

It would also be nice to have a userland utility that sets the default from a running OS, so you could create desktop shortcuts to boot a different OS next time.

Invalid User ID <#8021>
Fri 07 Jun 2002 12:18:19 AM UTC, original submission:  

As operating systems are becoming extremely stable these days (even in the MS world), the only times I actually reboot my computer are to switch to that /other/ operating system.  When I reboot again, it's to get back into my nice Linux environment.

While I do have Linux as default, would it ever be possible to have GRUB rotate the default boot between 2 or more partitions?  Then, by default, it would boot into a different operating system from what you just restarted in.

Is this a feature that other people would like to see?

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-06-21 okuji StatusNone Fixed
    Open/ClosedOpen Closed
    Release unknown
    Planned Release 0.96

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code