change modules.conf behavior to be in line with behavior which will be used in the future for base module

This commit is contained in:
Chris PeBenito 2005-06-28 17:31:18 +00:00
parent a4c639ddd5
commit 19db6ba5a9
1 changed files with 19 additions and 10 deletions

View File

@ -121,7 +121,7 @@ APPCONF = config/appconfig
M4SUPPORT = $(wildcard $(POLDIR)/support/*.spt) M4SUPPORT = $(wildcard $(POLDIR)/support/*.spt)
GLOBALTUN := $(POLDIR)/global_tunables GLOBALTUN := $(POLDIR)/global_tunables
MOD_DISABLE := $(POLDIR)/modules.conf MOD_CONF := $(POLDIR)/modules.conf
TUNABLES := $(POLDIR)/tunables.conf TUNABLES := $(POLDIR)/tunables.conf
APPDIR := $(CONTEXTPATH) APPDIR := $(CONTEXTPATH)
@ -129,7 +129,6 @@ APPFILES := $(addprefix $(APPDIR)/,default_contexts default_type initrc_context
CONTEXTFILES += $(wildcard $(APPCONF)/*_context*) $(APPCONF)/media CONTEXTFILES += $(wildcard $(APPCONF)/*_context*) $(APPCONF)/media
USER_FILES := $(POLDIR)/users USER_FILES := $(POLDIR)/users
DISABLEMOD := $(foreach mod,$(shell egrep -v '^[[:blank:]]*\#' $(MOD_DISABLE)),$(subst ./,,$(shell find -iname $(mod).te)))
ALL_LAYERS := $(filter-out $(MODDIR)/CVS,$(shell find $(wildcard $(MODDIR)/*) -maxdepth 0 -type d)) ALL_LAYERS := $(filter-out $(MODDIR)/CVS,$(shell find $(wildcard $(MODDIR)/*) -maxdepth 0 -type d))
GENERATED_TE := $(basename $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.te.in))) GENERATED_TE := $(basename $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.te.in)))
@ -139,7 +138,10 @@ GENERATED_FC := $(basename $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.fc.in
# sort here since it removes duplicates, which can happen # sort here since it removes duplicates, which can happen
# when a generated file is already generated # when a generated file is already generated
DETECTED_MODS := $(sort $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.te)) $(GENERATED_TE)) DETECTED_MODS := $(sort $(foreach dir,$(ALL_LAYERS),$(wildcard $(dir)/*.te)) $(GENERATED_TE))
ALL_MODULES := $(filter-out $(DISABLEMOD),$(DETECTED_MODS))
MODON = on
ENABLEMOD := $(foreach mod,$(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(MODON)") print $$1 }' $(MOD_CONF)),$(subst ./,,$(shell find -iname $(mod).te)))
ALL_MODULES := $(filter $(ENABLEMOD),$(DETECTED_MODS))
PRE_TE_FILES := $(addprefix $(FLASKDIR)/,security_classes initial_sids access_vectors) $(M4SUPPORT) $(POLDIR)/mls PRE_TE_FILES := $(addprefix $(FLASKDIR)/,security_classes initial_sids access_vectors) $(M4SUPPORT) $(POLDIR)/mls
ALL_INTERFACES := $(ALL_MODULES:.te=.if) ALL_INTERFACES := $(ALL_MODULES:.te=.if)
@ -240,10 +242,16 @@ tmp/generated_definitions.conf: $(ALL_LAYERS) $(ALL_TE_FILES)
$(QUIET) $(SETTUN) $(TUNABLES) >> $@ $(QUIET) $(SETTUN) $(TUNABLES) >> $@
tmp/all_interfaces.conf: $(M4SUPPORT) $(ALL_INTERFACES) tmp/all_interfaces.conf: $(M4SUPPORT) $(ALL_INTERFACES)
ifeq ($(ALL_INTERFACES),)
$(error No enabled modules! $(notdir $(MOD_CONF)) may need to be generated by using "make conf")
endif
@test -d tmp || mkdir -p tmp @test -d tmp || mkdir -p tmp
$(QUIET) m4 $^ | sed -e s/dollarsstar/\$$\*/g > $@ $(QUIET) m4 $^ | sed -e s/dollarsstar/\$$\*/g > $@
tmp/all_te_files.conf: $(ALL_TE_FILES) tmp/all_te_files.conf: $(ALL_TE_FILES)
ifeq ($(ALL_TE_FILES),)
$(error No enabled modules! $(notdir $(MOD_CONF)) may need to be generated by using "make conf")
endif
@test -d tmp || mkdir -p tmp @test -d tmp || mkdir -p tmp
$(QUIET) cat $^ > $@ $(QUIET) cat $^ > $@
@ -345,11 +353,11 @@ relabel: $(FC) $(SETFILES)
# #
# Create config files # Create config files
# #
conf: $(MOD_DISABLE) $(TUNABLES) $(GENERATED_TE) $(GENERATED_IF) $(GENERATED_FC) conf: $(MOD_CONF) $(TUNABLES) $(GENERATED_TE) $(GENERATED_IF) $(GENERATED_FC)
$(MOD_DISABLE) $(TUNABLES): $(POLXML) $(MOD_CONF) $(TUNABLES): $(POLXML)
@echo "Creating $(MOD_DISABLE) and $(TUNABLES)" @echo "Updating $(MOD_CONF) and $(TUNABLES)"
$(QUIET) cd $(DOCS) && ../$(GENDOC) -t ../$(TUNABLES) -m ../$(MOD_DISABLE) -x ../$(POLXML) $(QUIET) cd $(DOCS) && ../$(GENDOC) -t ../$(TUNABLES) -m ../$(MOD_CONF) -x ../$(POLXML)
######################################## ########################################
# #
@ -358,8 +366,9 @@ $(MOD_DISABLE) $(TUNABLES): $(POLXML)
# minimal dependencies here, because we don't want to rebuild # minimal dependencies here, because we don't want to rebuild
# this and its dependents every time the dependencies # this and its dependents every time the dependencies
# change # change. Also use all .if files here, rather then just the
$(POLXML): $(ALL_INTERFACES) # enabled modules.
$(POLXML): $(DETECTED_MODS:.te=.if)
@echo "Creating $@" @echo "Creating $@"
@mkdir -p tmp @mkdir -p tmp
$(QUIET) echo '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>' > $@ $(QUIET) echo '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>' > $@
@ -476,7 +485,7 @@ bare: clean
rm -f $(POLXML) rm -f $(POLXML)
rm -f $(SUPPORT)/*.pyc rm -f $(SUPPORT)/*.pyc
rm -f $(FCSORT) rm -f $(FCSORT)
rm -f $(MOD_DISABLE) rm -f $(MOD_CONF)
rm -f $(TUNABLES) rm -f $(TUNABLES)
rm -fR $(HTMLDIR) rm -fR $(HTMLDIR)
ifneq ($(GENERATED_TE),) ifneq ($(GENERATED_TE),)