[PATCH rhel6-branch 3/4] Provide ways in kickstart to skip kernel and bootloader.

Chris Lumens clumens at redhat.com
Mon Aug 4 15:12:32 UTC 2014


This patch (along with one in pykickstart) allows for a kickstart file to do
the following:

(1) Prevent any kernel package from being installed by putting "-kernel" in the
%packages section.

(2) Prevent any bootloader package from being installed (and therefore, any
bootloader config from being written) by putting "bootloader --disabled" in
the command section.

Related: rhbz#1123481
---
 kickstart.py  | 2 +-
 platform.py   | 3 +++
 yuminstall.py | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/kickstart.py b/kickstart.py
index dda681c..13e8798 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -289,7 +289,7 @@ class Bootloader(commands.bootloader.RHEL6_Bootloader):
             anaconda.id.bootloader.kickstart = 1
             anaconda.id.bootloader.doUpgradeOnly = 1
 
-        if location is None:
+        if location is None or self.disabled:
             anaconda.id.ksdata.permanentSkipSteps.extend(["bootloadersetup", "instbootloader"])
         else:
             anaconda.id.ksdata.showSteps.append("bootloader")
diff --git a/platform.py b/platform.py
index 8338f44..51e2e3f 100644
--- a/platform.py
+++ b/platform.py
@@ -189,6 +189,9 @@ class Platform(object):
 
     @property
     def packages (self):
+        if self.anaconda.isKickstart and self.anaconda.id.ksdata.bootloader.disabled:
+            return []
+
         if flags.cmdline.get('fips', None) == '1':
             return self._packages + ['dracut-fips']
         return self._packages
diff --git a/yuminstall.py b/yuminstall.py
index 7ac68b7..99cc78e 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1574,6 +1574,9 @@ debuglevel=6
 
             return True
 
+        if anaconda.isKickstart and "kernel" in anaconda.id.ksdata.packages.excludedList:
+            return
+
         foundkernel = False
 
         if not foundkernel and isys.isPaeAvailable():
-- 
1.9.3



More information about the anaconda-patches mailing list