FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 08-12-2011, 10:42 PM
David Lehman
 
Default Set the default grub2 entry to the OS we just installed.

---
pyanaconda/bootloader.py | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 73ef393..0dfe25f 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1506,6 +1506,7 @@ class GRUB2(GRUB):
defaults = open(defaults_file, "w+")
defaults.write("GRUB_TIMEOUT=%d
" % self.timeout)
defaults.write("GRUB_DISTRIBUTOR="%s"
" % productName)
+ defaults.write("GRUB_DEFAULT=saved
")
if self.console and self.console.startswith("ttyS"):
defaults.write("GRUB_TERMINAL="serial console"
")
defaults.write("GRUB_SERIAL_COMMAND="%s"
" % self.serial_command)
@@ -1564,6 +1565,16 @@ class GRUB2(GRUB):
except (BootLoaderError, OSError, RuntimeError) as e:
log.error("bootloader password setup failed: %s" % e)

+ # make sure the default entry is the OS we are installing
+ entry_title = "%s Linux, with Linux %s" % (productName,
+ self.default.version)
+ rc = iutil.execWithRedirect("grub2-set-default",
+ [entry_title],
+ root=install_root,
+ stdout="/dev/tty5", stderr="/dev/tty5")
+ if rc:
+ log.error("failed to set default menu entry to %s" % productName)
+
# now tell grub2 to generate the main configuration file
rc = iutil.execWithRedirect("grub2-mkconfig",
["-o", self.config_file],
--
1.7.3.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 04:29 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org