Blame SOURCES/0178-customize-Allow-selinux-relabel-flag-to-work-on-cros.patch

ffd6ed
From 63f9fefe9b4513d8a17e7594e5c87a0ab90593f9 Mon Sep 17 00:00:00 2001
ffd6ed
From: "Richard W.M. Jones" <rjones@redhat.com>
ffd6ed
Date: Fri, 15 May 2015 10:03:42 +0100
ffd6ed
Subject: [PATCH] customize: Allow --selinux-relabel flag to work on
ffd6ed
 cross-architecture builds (RHBZ#1212807).
ffd6ed
ffd6ed
(cherry picked from commit a43e8405ef83786f72f507f1aea31977b2f4de91)
ffd6ed
---
ffd6ed
 customize/customize_run.ml | 22 +++++++++++++---------
ffd6ed
 1 file changed, 13 insertions(+), 9 deletions(-)
ffd6ed
ffd6ed
diff --git a/customize/customize_run.ml b/customize/customize_run.ml
ffd6ed
index 6b861d5..48ae24b 100644
ffd6ed
--- a/customize/customize_run.ml
ffd6ed
+++ b/customize/customize_run.ml
ffd6ed
@@ -307,15 +307,19 @@ exec >>%s 2>&1
ffd6ed
 
ffd6ed
   if ops.flags.selinux_relabel then (
ffd6ed
     msg (f_"SELinux relabelling");
ffd6ed
-    let cmd = sprintf "
ffd6ed
-      if load_policy && fixfiles restore; then
ffd6ed
-        rm -f /.autorelabel
ffd6ed
-      else
ffd6ed
-        touch /.autorelabel
ffd6ed
-        echo '%s: SELinux relabelling failed, will relabel at boot instead.'
ffd6ed
-      fi
ffd6ed
-    " prog in
ffd6ed
-    do_run ~display:"load_policy && fixfiles restore" cmd
ffd6ed
+    if guest_arch_compatible then (
ffd6ed
+      let cmd = sprintf "
ffd6ed
+        if load_policy && fixfiles restore; then
ffd6ed
+          rm -f /.autorelabel
ffd6ed
+        else
ffd6ed
+          touch /.autorelabel
ffd6ed
+          echo '%s: SELinux relabelling failed, will relabel at boot instead.'
ffd6ed
+        fi
ffd6ed
+      " prog in
ffd6ed
+      do_run ~display:"load_policy && fixfiles restore" cmd
ffd6ed
+    ) else (
ffd6ed
+      g#touch "/.autorelabel"
ffd6ed
+    )
ffd6ed
   );
ffd6ed
 
ffd6ed
   (* Clean up the log file:
ffd6ed
-- 
ffd6ed
1.8.3.1
ffd6ed