[PATCH] Add leavebootorder option (anaconda) (take 2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=827116

The default on PowerPC machines is to change the boot order to boot into the
newly installed drive.  There are install scenarios where this is not
preferable.  So, I have added a new boot commandline and kickstart option
called leavebootorder. EFI changes will be in a later patch since I do not
have access to an appropriate system to test on.

---
 anaconda                 |    1 +
 pyanaconda/bootloader.py |   10 +++++++++-
 pyanaconda/kickstart.py  |    5 ++++-
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/anaconda b/anaconda
index 46a8748..471b109 100755
--- a/anaconda
+++ b/anaconda
@@ -267,6 +267,7 @@ def parseOptions(argv=None, cmdline=None):
     op.add_option("--image", action="append", dest="images", default=[])
     op.add_option("--memcheck", action="store_true", default=True)
     op.add_option("--nomemcheck", action="store_false", dest="memcheck")
+    op.add_option("--leavebootorder", action="store_true", default=False)
 
     # some defaults change based on cmdline flags
     if cmdline is not None:
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 29394b1..159c71b 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -294,6 +294,8 @@ class BootLoader(object):
         self.errors = []
         self.warnings = []
 
+        self.leavebootorder = flags.cmdline.getbool("leavebootorder")
+
     #
     # stage1 device access
     #
@@ -1076,6 +1078,9 @@ class BootLoader(object):
         if self.drive_order:
             f.write(" --driveorder=%s" % ",".join(self.drive_order))
 
+        if self.leavebootorder:
+            f.write(" --leavebootorder")
+
         append = self.boot_args - self.dracut_args
         if append:
             f.write(" --append=\"%s\"" % append)
@@ -2055,7 +2060,10 @@ class IPSeriesGRUB2(GRUB2):
     #
 
     def install(self):
-        self.updateNVRAMBootList()
+        if self.leavebootorder:
+            log.info("leavebootorder passed as an option. Will not update the NVRAM boot list.")
+        else:
+            self.updateNVRAMBootList()
 
         super(IPSeriesGRUB2, self).install(args=["--no-nvram"])
 
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 8d313f0..305fc89 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -256,7 +256,7 @@ class AutoStep(commands.autostep.FC3_AutoStep):
         flags.autostep = 1
         flags.autoscreenshot = self.autoscreenshot
 
-class Bootloader(commands.bootloader.F17_Bootloader):
+class Bootloader(commands.bootloader.F18_Bootloader):
     def execute(self):
         if self.location == "none":
             location = None
@@ -304,6 +304,9 @@ class Bootloader(commands.bootloader.F17_Bootloader):
                 drive = self.anaconda.storage.devicetree.getDeviceByName(spec)
                 self.anaconda.bootloader.stage1_drive = drive
 
+        if self.leavebootorder:
+            self.anaconda.bootloader.leavebootorder = True
+
         self.anaconda.dispatch.skip_steps("upgbootloader", "bootloader")
 
 class BTRFSData(commands.btrfs.F17_BTRFSData):
-- 
1.7.7.6

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


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux