fbcaed
From 6e37ac460ec6a9ec34ff067bf6b74f1d2bdce13d Mon Sep 17 00:00:00 2001
fbcaed
From: Colin Walters <walters@verbum.org>
fbcaed
Date: Thu, 24 Apr 2014 16:02:17 -0400
fbcaed
Subject: [PATCH 06/20] iutil: Transparently redirect anyone who asks
fbcaed
 root=/mnt/sysimage to sysroot
fbcaed
fbcaed
This is a followup from the previous commit to split the physical
fbcaed
mount and OS root path.  No code should be asking to run code directly
fbcaed
in the physical root, so just redirect them to the OS root.
fbcaed
fbcaed
Resolves: rhbz#1113535
fbcaed
Port of rpmostreepayload patches from master
fbcaed
commit 6bfa5c1c7b0b3a2301ac1468438d096407fb0a8f
fbcaed
---
fbcaed
 pyanaconda/iutil.py | 10 ++++++++--
fbcaed
 1 file changed, 8 insertions(+), 2 deletions(-)
fbcaed
fbcaed
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
fbcaed
index 46f8079..41853f7 100644
fbcaed
--- a/pyanaconda/iutil.py
fbcaed
+++ b/pyanaconda/iutil.py
fbcaed
@@ -96,9 +96,15 @@ def _run_program(argv, root='/', stdin=None, stdout=None, env_prune=None, log_ou
fbcaed
     if env_prune is None:
fbcaed
         env_prune = []
fbcaed
 
fbcaed
+    # Transparently redirect callers requesting root=ROOT_PATH to the
fbcaed
+    # configured system root.
fbcaed
+    target_root = root
fbcaed
+    if target_root == ROOT_PATH:
fbcaed
+        target_root = getSysroot()
fbcaed
+
fbcaed
     def chroot():
fbcaed
-        if root and root != '/':
fbcaed
-            os.chroot(root)
fbcaed
+        if target_root and target_root != '/':
fbcaed
+            os.chroot(target_root)
fbcaed
             os.chdir("/")
fbcaed
 
fbcaed
     with program_log_lock:
fbcaed
-- 
fbcaed
1.9.3
fbcaed