Skip to contentSkip to conversation

Build Xen XSM policy with 'xsm' DISTRO_FEATURE.

PATCH Applied [email protected] 2 participants 5 messages Oct 17, 2013 – Oct 18, 2013

lore
Share & tools
lore
#0 lore raw

cover Build Xen XSM policy with 'xsm' DISTRO_FEATURE.

This patch series allows users to build the XSM policy from the Xen source tree. This adds a dependency on the checkpolicy compiler from meta-selinux layer but only if the 'xsm' DISTRO_FEATURE is present. The README has been updated to reflect this conditional dependency (I guessed at the formatting).

Philip Tricca (3):
xen: avoid installing flask policy file as '/boot' build xsm policy when 'xsm' DISTRO_FEATURE is present Add note about dependency on meta-selinux to README.

 README                                             |    6 +++++
 ...lask-avoid-installing-policy-file-as-boot.patch |   26 +++++++++++++++++++
 recipes-extended/xen/xen_4.3.0.bb                  |    9 ++++---
 3 files changed, 38 insertions(+), 3 deletions(-)
#1 lore raw

PATCH 1/3 xen: avoid installing flask policy file as '/boot'

From: Philip Tricca <[email protected]>

Upstream patch to fix race condition between creating /boot and installing the XSM policy. Race would cause policy to be written to /boot instead of into the /boot directory if it didn't already exist.

---
 ...lask-avoid-installing-policy-file-as-boot.patch |   26 ++++++++++++++++++++
 recipes-extended/xen/xen_4.3.0.bb                  |    5 +++-
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 recipes-extended/xen/xen-4.3.0/flask-avoid-installing-policy-file-as-boot.patch
recipes-extended/xen/xen-4.3.0/flask-avoid-installing-policy-file-as-boot.patch new file +26 -0
new file mode 100644
index 0000000..d980807
@@ -0,0 +1,26 @@
+From 8bff3edead4318bfebc487f929f833d11922c238 Mon Sep 17 00:00:00 2001
+From: "Vadim A. Misbakh-Soloviov" <[email protected]>
+Date: Tue, 30 Jul 2013 16:34:38 +0400
+Subject: [PATCH] flask: avoid installing policy file as '/boot'
+
+Signed-off-by: Vadim A. Misbakh-Soloviov <[email protected]>
+Acked-by: Daniel De Graaf <[email protected]>
+---
+ tools/flask/policy/Makefile |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tools/flask/policy/Makefile b/tools/flask/policy/Makefile
+index e666f3e..df1e8f3 100644
+--- a/tools/flask/policy/Makefile
++++ b/tools/flask/policy/Makefile
+@@ -103,6 +103,7 @@ POLICY_SECTIONS += $(USERS) $(CONSTRAINTS) $(ISID_DEFS)
+ all: $(POLICY_FILENAME)
+ 
+ install: $(POLICY_FILENAME)
++	$(INSTALL_DIR) $(POLICY_LOADPATH)
+ 	$(INSTALL_DATA) $^ $(POLICY_LOADPATH)
+ 
+ $(POLICY_FILENAME): policy.conf
+-- 
+1.7.10.4
+
recipes-extended/xen/xen_4.3.0.bb +4 -1
index e9a22cc..228f75f 100644
@@ -6,7 +6,10 @@ PR = "r0"
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=e0f0f3ac55608719a82394cc353928df"
 
-SRC_URI = "http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz"
+SRC_URI = " \
+    http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz \
+    file://flask-avoid-installing-policy-file-as-boot.patch \
+    "
 
 SRC_URI[md5sum] = "7b18cfb58f1ac2ce39cf35a1867f0c0a"
 SRC_URI[sha256sum] = "e1e9faabe4886e2227aacdbde74410653b233d66642ca1972a860cbec6439961"
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/3 build xsm policy when 'xsm' DISTRO_FEATURE is present

In reply to [email protected]

From: Philip Tricca <[email protected]>

This pulls in a dependency on the checkpolicy compiler (native) and adds --enable-xsmpolicy in do_configure when 'xsm' DISTRO_FEATURE is present.

---
 recipes-extended/xen/xen_4.3.0.bb |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
recipes-extended/xen/xen_4.3.0.bb +2 -2
index 228f75f..078b39c 100644
@@ -20,7 +20,7 @@ COMPATIBLE_HOST = '(x86_64.*).*-linux'
 
 inherit autotools gettext setuptools update-rc.d
 
-DEPENDS = "util-linux util-linux-native file-native zlib ncurses openssl bison-native flex-native gettext dev86-native iasl-native pciutils virtual/libgl virtual/libsdl bridge-utils iproute2 procps yajl pixman python python-setuptools-native xz xz-native libsdl"
+DEPENDS = "util-linux util-linux-native file-native zlib ncurses openssl bison-native flex-native gettext dev86-native iasl-native pciutils virtual/libgl virtual/libsdl bridge-utils iproute2 procps yajl pixman python python-setuptools-native xz xz-native libsdl ${@base_contains('DISTRO_FEATURES', 'xsm', 'checkpolicy-native', '', d )}"
 
 # inherit setuptools adds python to RDEPENDS, override it
 RDEPENDS_${PN} = ""
@@ -580,7 +580,7 @@ do_configure() {
     fi
 
     # do configure
-    ./configure --exec-prefix=/usr --prefix=/usr --host=${HOST_SYS} --disable-stubdom --disable-ioemu-stubdom --disable-pv-grub --disable-xenstore-stubdom
+    ./configure --exec-prefix=/usr --prefix=/usr --host=${HOST_SYS} --disable-stubdom --disable-ioemu-stubdom --disable-pv-grub --disable-xenstore-stubdom "${@base_contains('DISTRO_FEATURES', 'xsm', '--enable-xsmpolicy', '--disable-xsmpolicy',d)}"
 
     # seabios needs a patch to specify correct compiler - pull and patch Makefile
     make -C ${S}/tools/firmware seabios-dir
Signature · 1 line
1.7.10.4
#3 lore raw

PATCH 3/3 Add note about dependency on meta-selinux to README.

In reply to [email protected]

From: Philip Tricca <[email protected]>

---
 README |    6 ++++++
 1 file changed, 6 insertions(+)
README +6 -0
index e8c5252..48327a2 100644
@@ -21,6 +21,12 @@ layers: meta-oe
 
 BBFILE_PRIORITY_openembedded-layer = "4"
 
+Required for Xen XSM policy:
+URI: git://git.yoctoproject.org/meta-selinux
+branch: master
+revision: HEAD
+prio: default
+
 Maintenance
 -----------
 
Signature · 1 line
1.7.10.4
#4 lore raw
In reply to [email protected]
Quoted 10 lines · On Thu, Oct 17, 2013 at 2:47 PM, <[email protected]> wrote:

This patch series allows users to build the XSM policy from the Xen source tree. This adds a dependency on the checkpolicy compiler from meta-selinux layer but only if the 'xsm' DISTRO_FEATURE is present. The README has been updated to reflect this conditional dependency (I guessed at the formatting).

Philip Tricca (3):
xen: avoid installing flask policy file as '/boot' build xsm policy when 'xsm' DISTRO_FEATURE is present Add note about dependency on meta-selinux to README.

Looks fine to me, I was thinking about patch 2/2 and using a variable instead of the inline python in the configure line .. but in the end, it just isn't worth it.

I merged the series with some minor tweaks to the shortlogs.

Bruce

Quoted 10 lines
 README                                             |    6 +++++
 ...lask-avoid-installing-policy-file-as-boot.patch |   26 +++++++++++++++++++
 recipes-extended/xen/xen_4.3.0.bb                  |    9 ++++---
 3 files changed, 38 insertions(+), 3 deletions(-)

_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"