Blob Blame History Raw
From ffc6d1c3e3bd51dc5cbfc602c66b860ffadfe245 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 21 Jul 2016 22:29:05 +0100
Subject: [PATCH] Revert "p2v: Disable SELinux in virt-p2v-make-disk."

The commit claimed that SELinux was disabled in the
virt-p2v-make-kickstart script, and so this was just making things
consistent.  However this is not true.  SELinux *is* enabled in the
kickstart version.  There is some code to disable it, but it is
commented out (admittedly it's hard to tell because the code is buried
in a multi-line sed expression).

The commit message also claimed (this time correctly) that the
'--selinux-relabel' step caused an extra reboot each time virt-p2v is
run from the ISO.  However we have recently fixed this so it can
usually do the relabelling during the build, not at boot time, so this
is no longer a problem.

This reverts commit 25ffcc7d436cd8f6bcf29d8bde5efd4b8823d6cc.

(cherry picked from commit fcce1f694e46933dd5d6a0ef1369cef3c5152fc5)
---
 p2v/virt-p2v-make-disk.in | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/p2v/virt-p2v-make-disk.in b/p2v/virt-p2v-make-disk.in
index cc7ee93..a199e1e 100644
--- a/p2v/virt-p2v-make-disk.in
+++ b/p2v/virt-p2v-make-disk.in
@@ -149,10 +149,9 @@ EOF
 latest_version="$(cd /lib/modules; ls -1vr | head -1)"
 dracut -f --kver $latest_version
 EOF
-        # Double quotes because we want $tmpdir to be expanded.
-        # Disable SELinux for consistency with virt-p2v-make-kickstart.
+        # Double quotes because we want $tmpdir to be expanded:
         extra_args="
-          --edit /etc/selinux/config:s/^SELINUX=.*/SELINUX=disabled/g
+          --selinux-relabel
           --upload $tmpdir/p2v.conf:/etc/dracut.conf.d/
           --run $tmpdir/post-install
         "
-- 
2.7.4