[rhel7/master] Fix noselinux cmdline default (#1137049)

Brian C. Lane bcl at redhat.com
Thu Sep 4 00:16:01 UTC 2014

Commit fc8f719114 change the cmdline noselinux behavior but didn't set
the default to the new -1 value so it would always enable selinux, even
if the kickstart used selinux --disabled and no cmdline option was

This fixes things so that they work as expected. kickstart selinux
commands work, cmdline overrides only if it has been passed.

Resolves: rhbz#1137049
 anaconda | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/anaconda b/anaconda
index ffce0f0..d451ad3 100755
--- a/anaconda
+++ b/anaconda
@@ -277,8 +277,9 @@ def parseOptions(argv=None, cmdline=None):
-    op.add_option("--noselinux", dest="selinux", action="store_false", default=True)
-    op.add_option("--selinux", action="store_true")
+    from pykickstart.constants import SELINUX_DISABLED, SELINUX_ENFORCING
+    op.add_option("--noselinux", dest="selinux", action="store_const", const=SELINUX_DISABLED, default=constants.SELINUX_DEFAULT)
+    op.add_option("--selinux", action="store_const", const=SELINUX_ENFORCING)
     op.add_option("--nompath", dest="mpath", action="store_false", default=True)
     op.add_option("--mpath", action="store_true")

More information about the anaconda-patches mailing list