[PATCH] make SELinux optional

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

 



This patch makes SELinux support optional in anaconda (at build time).
Cheers,

Matt
-- 
Matt Wilson
Founding Engineer
rPath, Inc.
msw@xxxxxxxxx
Index: Makefile.inc
===================================================================
RCS file: /usr/local/CVS/anaconda/Makefile.inc,v
retrieving revision 1.127
diff -u -r1.127 Makefile.inc
--- Makefile.inc	13 Jun 2005 19:09:23 -0000	1.127
+++ Makefile.inc	7 Mar 2006 00:57:34 -0000
@@ -24,6 +24,8 @@
 USEDIET=1
 endif
 
+USESELINUX=1
+
 ifndef RPM_OPT_FLAGS
 RPM_OPT_FLAGS = -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
 endif
Index: isys/Makefile
===================================================================
RCS file: /usr/local/CVS/anaconda/isys/Makefile,v
retrieving revision 1.90
diff -u -r1.90 Makefile
--- isys/Makefile	22 Feb 2006 20:04:46 -0000	1.90
+++ isys/Makefile	7 Mar 2006 00:57:34 -0000
@@ -8,7 +8,11 @@
 	  ethtool.o getipaddr.o wireless.o eddsupport.o
 SOBJECTS = $(patsubst %.o,%.lo,$(OBJECTS))
 SOURCES = $(patsubst %.o,%.c,$(OBJECTS)) isys.c
-LOADLIBES = -lresolv -lpci -lpopt -lpump -lext2fs -lz -lkudzu -lpci -ldevmapper -lselinux -lsepol
+LOADLIBES = -lresolv -lpci -lpopt -lpump -lext2fs -lz -lkudzu -lpci -ldevmapper
+ifeq ($(USESELINUX),1)
+LOADLIBES += -lselinux -lsepol
+SELINUXFLAGS = -DUSESELINUX=1
+endif
 PYMODULES = _isys.so
 SUBDIRS = gzlib
 DIET = diet
@@ -45,7 +49,7 @@
 	$(CC) -c $(CFLAGS) -fPIC -o $@ $<
 
 %.do: %.c
-	$(DIET) $(CC) -c $(CFLAGS) -DGZLIB=1 -DDIET=1 "-Du_char=unsigned char" -o $@ $<
+	$(DIET) $(CC) -c $(CFLAGS) -DGZLIB=1 -DDIET=1 "-Du_char=unsigned char" -o $(SELINUXFLAGS) $@ $<
 
 _isys.so: isys.lo $(SOBJECTS)
 	gcc -shared -g -fPIC -o $@ isys.lo $(SOBJECTS) $(LOADLIBES)
Index: isys/isys.c
===================================================================
RCS file: /usr/local/CVS/anaconda/isys/isys.c,v
retrieving revision 1.145
diff -u -r1.145 isys.c
--- isys/isys.c	23 Feb 2006 20:00:21 -0000	1.145
+++ isys/isys.c	7 Mar 2006 00:57:34 -0000
@@ -38,7 +38,9 @@
 #include <sys/types.h>
 #include <linux/fb.h>
 #include <libintl.h>
+#ifdef USESELINUX
 #include <selinux/selinux.h>
+#endif
 #include <libgen.h>
 #include <linux/major.h>
 #include <linux/raid/md_u.h>
@@ -114,7 +116,9 @@
 static PyObject * py_isLdlDasd(PyObject * s, PyObject * args);
 static PyObject * doGetMacAddress(PyObject * s, PyObject * args);
 static PyObject * doGetIPAddress(PyObject * s, PyObject * args);
+#ifdef USESELINUX
 static PyObject * doResetFileContext(PyObject * s, PyObject * args);
+#endif
 static PyObject * isWireless(PyObject * s, PyObject * args);
 static PyObject * doProbeBiosDisks(PyObject * s, PyObject * args);
 static PyObject * doGetBiosDisk(PyObject * s, PyObject * args); 
@@ -173,7 +177,9 @@
     { "isLdlDasd", (PyCFunction) py_isLdlDasd, METH_VARARGS, NULL},
     { "getMacAddress", (PyCFunction) doGetMacAddress, METH_VARARGS, NULL},
     { "getIPAddress", (PyCFunction) doGetIPAddress, METH_VARARGS, NULL},
+#ifdef USESELINUX
     { "resetFileContext", (PyCFunction) doResetFileContext, METH_VARARGS, NULL },
+#endif
     { "isWireless", (PyCFunction) isWireless, METH_VARARGS, NULL },
     { "biosDiskProbe", (PyCFunction) doProbeBiosDisks, METH_VARARGS,NULL},
     { "getbiosdisk",(PyCFunction) doGetBiosDisk, METH_VARARGS,NULL},
@@ -1351,7 +1357,7 @@
 
     return Py_BuildValue("s", ret);
 }
-
+#ifdef USESELINUX
 static PyObject * doResetFileContext(PyObject * s, PyObject * args) {
     char *fn, *buf = NULL;
     int ret;
@@ -1367,7 +1373,7 @@
 
     return Py_BuildValue("s", buf);
 }
-
+#endif
 static PyObject * py_getDasdPorts(PyObject * o, PyObject * args) {
     if (!PyArg_ParseTuple(args, "")) return NULL;
 
Index: loader2/Makefile
===================================================================
RCS file: /usr/local/CVS/anaconda/loader2/Makefile,v
retrieving revision 1.46
diff -u -r1.46 Makefile
--- loader2/Makefile	22 Feb 2006 20:00:32 -0000	1.46
+++ loader2/Makefile	7 Mar 2006 00:57:34 -0000
@@ -11,7 +11,10 @@
 NEWTLIB = -lnewt
 ISYSLIB = ../isys/libisys.a
 GUNZIP = -lz
-DMLIB = -ldevmapper -lselinux -lsepol
+DMLIB = -ldevmapper
+ifeq (1, $(USESELINUX))
+DMLIB += -lselinux -lsepol
+endif
 
 BINS = loader
 

[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