summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Makefile.inc2
-rw-r--r--isys/Makefile8
-rw-r--r--isys/isys.c10
-rw-r--r--loader2/Makefile5
5 files changed, 27 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1790cdb60..36c4a8c6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-03-13 Matt Wilson <msw@rpath.com>
+
+ * Makefile.inc: Add flag for whether or not to use SELinux.
+ * isys/Makefile: Conditionalize SELinux.
+ * isys/isys.c: Likewise.
+ * loader2/Makefile: Likewise.
+
2006-03-13 Jeremy Katz <katzj@redhat.com>
* iw/lvm_dialog_gui.py (VolumeGroupEditor.createPEOptionMenu): Cap
diff --git a/Makefile.inc b/Makefile.inc
index 5cced1a02..1e0c0ee9f 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -24,6 +24,8 @@ ifeq (nosucharch, $(ARCH))
USEDIET=1
endif
+USESELINUX=1
+
ifndef RPM_OPT_FLAGS
RPM_OPT_FLAGS = -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
endif
diff --git a/isys/Makefile b/isys/Makefile
index 64325cc86..26581fa6f 100644
--- a/isys/Makefile
+++ b/isys/Makefile
@@ -8,7 +8,11 @@ OBJECTS = nfsmount.o nfsmount_clnt.o nfsmount_xdr.o imount.o getmacaddr.o \
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 @@ all: subdirs $(PYMODULES) libisys.a $(DIETLIB)
$(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)
diff --git a/isys/isys.c b/isys/isys.c
index 32a9ad6d4..7e75714ab 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -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_isUsableDasd(PyObject * s, PyObject * args);
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 @@ static PyMethodDef isysModuleMethods[] = {
{ "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 @@ static PyObject * doGetIPAddress(PyObject * s, PyObject * args) {
return Py_BuildValue("s", ret);
}
-
+#ifdef USESELINUX
static PyObject * doResetFileContext(PyObject * s, PyObject * args) {
char *fn, *buf = NULL;
int ret;
@@ -1367,7 +1373,7 @@ static PyObject * doResetFileContext(PyObject * s, PyObject * args) {
return Py_BuildValue("s", buf);
}
-
+#endif
static PyObject * py_getDasdPorts(PyObject * o, PyObject * args) {
if (!PyArg_ParseTuple(args, "")) return NULL;
diff --git a/loader2/Makefile b/loader2/Makefile
index 0492e7eac..5528c4abe 100644
--- a/loader2/Makefile
+++ b/loader2/Makefile
@@ -11,7 +11,10 @@ SLANGLIB = -lslang
NEWTLIB = -lnewt
ISYSLIB = ../isys/libisys.a
GUNZIP = -lz
-DMLIB = -ldevmapper -lselinux -lsepol
+DMLIB = -ldevmapper
+ifeq (1, $(USESELINUX))
+DMLIB += -lselinux -lsepol
+endif
BINS = loader