Re: [PATCH] If crashkernel= is given in kickstart, don't add crashkernel=auto (#691910).

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

 



Ack.

On 07/22/2011 03:38 PM, Chris Lumens wrote:
More generically, this allows arguments given in the kickstart file to override
any that anaconda would automatically add via an install class.
---
  bootloader.py          |   20 ++++++++++++++++++++
  installclass.py        |    3 +--
  installclasses/rhel.py |    2 +-
  packages.py            |    3 ++-
  4 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/bootloader.py b/bootloader.py
index 8631f0b..c77830a 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -142,6 +142,26 @@ def writeBootloader(anaconda):
      if anaconda.id.bootloader.defaultDevice == -1:
          return

+    # Append extra bootloader args that the install class provides, but do not
+    # append them if they duplicate ones already there.  So, args provided by
+    # the bootloader kickstart command take precedence over internal ones.
+    for extraArg in anaconda.id.instClass.bootloaderExtraArgs:
+        if '=' in extraArg:
+            extra = extraArg.split('=')[0]
+        else:
+            extra = extraArg
+
+        # We have to do it this way to catch both standalone arguments and
+        # those that take a value.
+        found = False
+        for arg in anaconda.id.bootloader.args.appendArgs:
+            if extra == arg or arg.startswith(extra+"="):
+                found = True
+                break
+
+        if not found:
+            anaconda.id.bootloader.args.append(extraArg)
+
      if anaconda.id.bootloader.doUpgradeOnly:
          (bootType, theDev) = checkbootloader.getBootloaderTypeAndBoot(anaconda.rootPath, storage=anaconda.id.storage)

diff --git a/installclass.py b/installclass.py
index deb7e53..ad12971 100644
--- a/installclass.py
+++ b/installclass.py
@@ -55,7 +55,7 @@ class BaseInstallClass(object):
      # default to showing the upgrade option
      showUpgrade = True
      bootloaderTimeoutDefault = 0
-    bootloaderExtraArgs = ""
+    bootloaderExtraArgs = []

      # list of of (txt, grplist) tuples for task selection screen
      tasks = []
@@ -202,7 +202,6 @@ class BaseInstallClass(object):
          anaconda.id.reset()
          anaconda.id.instClass = self
          anaconda.id.bootloader.timeout = self.bootloaderTimeoutDefault
-        anaconda.id.bootloader.args.append(self.bootloaderExtraArgs)

      def versionMatches(self, oldver):
          pass
diff --git a/installclasses/rhel.py b/installclasses/rhel.py
index 6171d5d..8e30d88 100644
--- a/installclasses/rhel.py
+++ b/installclasses/rhel.py
@@ -39,7 +39,7 @@ class InstallClass(BaseInstallClass):
      hidden = 1

      bootloaderTimeoutDefault = 5
-    bootloaderExtraArgs = "crashkernel=auto"
+    bootloaderExtraArgs = ["crashkernel=auto"]

      tasks = [(N_("Minimal"),
                ["core"])]
diff --git a/packages.py b/packages.py
index 4e786be..c593a54 100644
--- a/packages.py
+++ b/packages.py
@@ -317,7 +317,8 @@ def rpmSetupGraphicalSystem(anaconda):
      if iutil.isConsoleOnVirtualTerminal() and \
         (ts.dbMatch('provides', 'rhgb').count() or \
          ts.dbMatch('provides', 'plymouth').count()):
-        anaconda.id.bootloader.args.append("rhgb quiet")
+        anaconda.id.bootloader.args.append("rhgb")
+        anaconda.id.bootloader.args.append("quiet")

      if ts.dbMatch('provides', 'service(graphical-login)').count() and \
         ts.dbMatch('provides', 'xorg-x11-server-Xorg').count() and \



--
David Cantrell <dcantrell@xxxxxxxxxx>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Westford, MA | EST5EDT

_______________________________________________
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