diff --git a/refpolicy/Changelog b/refpolicy/Changelog index 2135048..1fdb984 100644 --- a/refpolicy/Changelog +++ b/refpolicy/Changelog @@ -1,3 +1,4 @@ +- Add Make target to validate module linking. - Make duplicate template and interface declarations a fatal error. - Patch to stabilize modules.conf `make conf` output, from Erich Schubert. - Move xconsole_device_t from devices to xserver since it is diff --git a/refpolicy/Makefile b/refpolicy/Makefile index 74331cc..cb9c184 100644 --- a/refpolicy/Makefile +++ b/refpolicy/Makefile @@ -50,6 +50,8 @@ CHECKPOLICY := $(BINDIR)/checkpolicy CHECKMODULE := $(BINDIR)/checkmodule SEMODULE := $(SBINDIR)/semodule SEMOD_PKG := $(BINDIR)/semodule_package +SEMOD_LNK := $(BINDIR)/semodule_link +SEMOD_EXP := $(BINDIR)/semodule_expand LOADPOLICY := $(SBINDIR)/load_policy SETFILES := $(SBINDIR)/setfiles GENHOMEDIRCON := $(SBINDIR)/genhomedircon diff --git a/refpolicy/README b/refpolicy/README index db9e3d1..3bf21ff 100644 --- a/refpolicy/README +++ b/refpolicy/README @@ -50,6 +50,9 @@ load Compile, package, and install the base module and loadable modules, then insert them into the module store. +validate Validate if the configured modules can successfully + link and expand. + Make targets specific to monolithic policies: policy Compile a policy locally for development and testing. diff --git a/refpolicy/Rules.modular b/refpolicy/Rules.modular index 7fd21a8..d877c36 100644 --- a/refpolicy/Rules.modular +++ b/refpolicy/Rules.modular @@ -215,6 +215,16 @@ $(APPDIR)/customizable_types: $(BASE_CONF) ######################################## # +# Validate linking and expanding of modules +# +validate: $(BASE_PKG) $(MOD_PKGS) + @echo "Validating policy linking." + $(verbose) $(SEMOD_LNK) -o $(TMPDIR)/test.lnk $^ + $(verbose) $(SEMOD_EXP) $(TMPDIR)/test.lnk $(TMPDIR)/policy.bin + @echo "Success." + +######################################## +# # Clean the sources # clean: @@ -223,4 +233,4 @@ clean: rm -f $(BUILDDIR)*.pp rm -fR $(TMPDIR) -.PHONY: default all policy base modules install load clean +.PHONY: default all policy base modules install load clean validate