All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH] xen: allow XSM_FLASK_POLICY only if checkpolicy binary is available
@ 2021-07-14 16:17 Anthony PERARD
  2021-07-14 16:51 ` Jason Andryuk
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Anthony PERARD @ 2021-07-14 16:17 UTC (permalink / raw)
  To: xen-devel
  Cc: Anthony PERARD, Andrew Cooper, George Dunlap, Ian Jackson,
	Jan Beulich, Julien Grall, Stefano Stabellini, Wei Liu

This will help prevent the CI loop from having build failures when
`checkpolicy` isn't available, when doing "randconfig" jobs.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 Config.mk          | 6 ------
 xen/Makefile       | 2 ++
 xen/common/Kconfig | 7 +++++--
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/Config.mk b/Config.mk
index d08fa8d60dd7..97d3633706b3 100644
--- a/Config.mk
+++ b/Config.mk
@@ -137,12 +137,6 @@ export XEN_HAS_BUILD_ID=y
 build_id_linker := --build-id=sha1
 endif
 
-ifndef XEN_HAS_CHECKPOLICY
-    CHECKPOLICY ?= checkpolicy
-    XEN_HAS_CHECKPOLICY := $(shell $(CHECKPOLICY) -h 2>&1 | grep -q xen && echo y || echo n)
-    export XEN_HAS_CHECKPOLICY
-endif
-
 define buildmakevars2shellvars
     export PREFIX="$(prefix)";                                            \
     export XEN_SCRIPT_DIR="$(XEN_SCRIPT_DIR)";                            \
diff --git a/xen/Makefile b/xen/Makefile
index 8023680ffbf2..a60e49903d0c 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -17,6 +17,8 @@ export XEN_BUILD_HOST	?= $(shell hostname)
 PYTHON_INTERPRETER	:= $(word 1,$(shell which python3 python python2 2>/dev/null) python)
 export PYTHON		?= $(PYTHON_INTERPRETER)
 
+export CHECKPOLICY	?= checkpolicy
+
 export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
 
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 0ddd18e11af3..13537e460b8f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -25,6 +25,9 @@ config GRANT_TABLE
 config HAS_ALTERNATIVE
 	bool
 
+config HAS_CHECKPOLICY
+	def_bool $(success,$(CHECKPOLICY) -h 2>&1 | grep -q xen)
+
 config HAS_COMPAT
 	bool
 
@@ -235,8 +238,8 @@ config XSM_FLASK_AVC_STATS
 
 config XSM_FLASK_POLICY
 	bool "Compile Xen with a built-in FLASK security policy"
-	default y if "$(XEN_HAS_CHECKPOLICY)" = "y"
-	depends on XSM_FLASK
+	default y
+	depends on XSM_FLASK && HAS_CHECKPOLICY
 	---help---
 	  This includes a default XSM policy in the hypervisor so that the
 	  bootloader does not need to load a policy to get sane behavior from an
-- 
Anthony PERARD



^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-07-19 14:33 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-14 16:17 [XEN PATCH] xen: allow XSM_FLASK_POLICY only if checkpolicy binary is available Anthony PERARD
2021-07-14 16:51 ` Jason Andryuk
2021-07-14 17:09 ` Andrew Cooper
2021-07-15  6:25 ` Jan Beulich
2021-07-16 12:36   ` Anthony PERARD
2021-07-16 13:15   ` Andrew Cooper
2021-07-16 14:34     ` Jan Beulich
2021-07-16 16:23     ` Anthony PERARD
2021-07-16 12:38 ` [XEN PATCH v2] " Anthony PERARD
2021-07-16 13:00   ` Andrew Cooper
2021-07-19  7:37   ` Jan Beulich
2021-07-19 10:47     ` Anthony PERARD
2021-07-19 11:04       ` Jan Beulich
2021-07-19 14:33         ` George Dunlap
2021-07-16 15:26 ` [XEN PATCH] " George Dunlap
2021-07-16 15:50   ` Juergen Gross
2021-07-16 15:56   ` Anthony PERARD
2021-07-16 16:14   ` Andrew Cooper
2021-07-19  7:10     ` Jan Beulich
2021-07-16 16:27   ` Anthony PERARD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.