diff --git a/Rules.modular b/Rules.modular index c731ea01d2..dcfa13a06f 100644 --- a/Rules.modular +++ b/Rules.modular @@ -3,6 +3,18 @@ # Rules and Targets for building modular policies # +target_module_store := $(DESTDIR)/var/lib/selinux/refpolicy + +SEMODULE += -s $(NAME) + +ifneq ($(DESTDIR),) + SEMODULE += -p $(DESTDIR) +endif + +ifneq ($(PRIORITY),) + SEMODULE += -X $(PRIORITY) +endif + all_modules := $(base_mods) $(mod_mods) $(off_mods) all_interfaces := $(all_modules:.te=.if) enabled_mod_fc := $(addprefix $(tmpdir)/,$(notdir $(base_mods:.te=.mod.fc) $(mod_mods:.te=.mod.fc))) @@ -55,8 +67,8 @@ load: $(instpkg) $(appfiles) # make sure two directories exist since they are not # created by semanage @echo "Loading configured modules." - @$(INSTALL) -d -m 0755 $(policypath) $(dir $(fcpath)) - $(verbose) $(SEMODULE) -s $(NAME) -i $(modpkgdir)/$(notdir $(base_pkg)) $(foreach mod,$(mod_pkgs),-i $(modpkgdir)/$(mod)) + @$(INSTALL) -d -m 0755 $(policypath) $(dir $(fcpath)) $(target_module_store) + $(verbose) $(SEMODULE) -i $(modpkgdir)/$(notdir $(base_pkg)) $(foreach mod,$(mod_pkgs),-i $(modpkgdir)/$(mod)) ######################################## # @@ -66,8 +78,8 @@ pure-load: $(instpkg) $(appfiles) # make sure two directories exist since they are not # created by semanage @echo "Loading configured modules." - @$(INSTALL) -d -m 0755 $(policypath) $(dir $(fcpath)) - $(verbose) $(SEMODULE) -s $(NAME) -i $(modpkgdir)/$(notdir $(base_pkg)) $(foreach mod,$(mod_pkgs),-i $(modpkgdir)/$(mod)) $(foreach omod,$(filter-out base $(notdir $(mod_mods:.te=)),$(shell $(SEMODULE) -l)),-r $(omod)) + @$(INSTALL) -d -m 0755 $(policypath) $(dir $(fcpath)) $(target_module_store) + $(verbose) $(SEMODULE) -i $(modpkgdir)/$(notdir $(base_pkg)) $(foreach mod,$(mod_pkgs),-i $(modpkgdir)/$(mod)) $(foreach omod,$(filter-out base $(notdir $(mod_mods:.te=)),$(shell $(SEMODULE) -l)),-r $(omod)) ######################################## #