zengxyz / rpms / anaconda

Forked from rpms/anaconda 4 months ago
Clone
fbcaed
From 5741fc05e8c65537acbd220418574ad041a3f8fe Mon Sep 17 00:00:00 2001
fbcaed
From: "Brian C. Lane" <bcl@redhat.com>
fbcaed
Date: Tue, 11 Mar 2014 14:04:13 -0700
fbcaed
Subject: [PATCH 02/20] Override ROOT_PATH with environmental variable
fbcaed
fbcaed
Normally ROOT_PATH is "/mnt/sysimage", but with dirinstall it would be
fbcaed
nice to be able to install to arbitrary directories. This lets the path
fbcaed
be overridden by the ANACONDA_ROOT_PATH environmental variable.
fbcaed
fbcaed
Resolves: rhbz#1113535
fbcaed
Port of rpmostreepayload patches from master
fbcaed
commit 2e3d576ee643a676d1ca3f4c194c5fbc59b9d295
fbcaed
---
fbcaed
 data/anaconda_options.txt | 4 +++-
fbcaed
 pyanaconda/constants.py   | 4 +++-
fbcaed
 2 files changed, 6 insertions(+), 2 deletions(-)
fbcaed
fbcaed
diff --git a/data/anaconda_options.txt b/data/anaconda_options.txt
fbcaed
index 6dc90c4..753609a 100644
fbcaed
--- a/data/anaconda_options.txt
fbcaed
+++ b/data/anaconda_options.txt
fbcaed
@@ -1,7 +1,9 @@
fbcaed
 dirinstall
fbcaed
 Use the device mounted at /mnt/sysimage as the installation
fbcaed
 destination. The --dirinstall and --image options are mutually
fbcaed
-exclusive.
fbcaed
+exclusive. The /mnt/sysimage directory can be overridden by
fbcaed
+setting the ANACONDA_ROOT_PATH environmental variable before
fbcaed
+starting anaconda.
fbcaed
 
fbcaed
 image
fbcaed
 Specification of disk image file to be used as installation
fbcaed
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
fbcaed
index 266eb53..e864630 100644
fbcaed
--- a/pyanaconda/constants.py
fbcaed
+++ b/pyanaconda/constants.py
fbcaed
@@ -23,6 +23,8 @@ from pyanaconda.i18n import _, N_
fbcaed
 
fbcaed
 import re
fbcaed
 
fbcaed
+import os
fbcaed
+
fbcaed
 SELINUX_DEFAULT = 1
fbcaed
 
fbcaed
 DISPATCH_BACK = -1
fbcaed
@@ -78,7 +80,7 @@ DD_RPMS = "/tmp/DD-*"
fbcaed
 TRANSLATIONS_UPDATE_DIR="/tmp/updates/po"
fbcaed
 
fbcaed
 ANACONDA_CLEANUP = "anaconda-cleanup"
fbcaed
-ROOT_PATH = "/mnt/sysimage"
fbcaed
+ROOT_PATH = os.environ.get("ANACONDA_ROOT_PATH", "/mnt/sysimage")
fbcaed
 MOUNT_DIR = "/mnt/install"
fbcaed
 DRACUT_REPODIR = "/run/install/repo"
fbcaed
 DRACUT_ISODIR = "/run/install/source"
fbcaed
-- 
fbcaed
1.9.3
fbcaed