[PATCH 1/2] Override ROOT_PATH with environmental variable

Brian C. Lane bcl at redhat.com
Tue Mar 11 23:02:02 UTC 2014


Normally ROOT_PATH is "/mnt/sysimage", but with dirinstall it would be
nice to be able to install to arbitrary directories. This lets the path
be overridden by the ANACONDA_ROOT_PATH environmental variable.
---
 data/anaconda_options.txt | 4 +++-
 pyanaconda/constants.py   | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/data/anaconda_options.txt b/data/anaconda_options.txt
index 6dc90c4..753609a 100644
--- a/data/anaconda_options.txt
+++ b/data/anaconda_options.txt
@@ -1,7 +1,9 @@
 dirinstall
 Use the device mounted at /mnt/sysimage as the installation
 destination. The --dirinstall and --image options are mutually
-exclusive.
+exclusive. The /mnt/sysimage directory can be overridden by
+setting the ANACONDA_ROOT_PATH environmental variable before
+starting anaconda.
 
 image
 Specification of disk image file to be used as installation
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
index 8de29a9..a868409 100644
--- a/pyanaconda/constants.py
+++ b/pyanaconda/constants.py
@@ -21,6 +21,7 @@
 
 from pyanaconda.i18n import _, N_
 
+import os
 import re
 
 SELINUX_DEFAULT = 1
@@ -78,7 +79,7 @@ DD_RPMS = "/tmp/DD-*"
 TRANSLATIONS_UPDATE_DIR="/tmp/updates/po"
 
 ANACONDA_CLEANUP = "anaconda-cleanup"
-ROOT_PATH = "/mnt/sysimage"
+ROOT_PATH = os.environ.get("ANACONDA_ROOT_PATH", "/mnt/sysimage")
 MOUNT_DIR = "/mnt/install"
 DRACUT_REPODIR = "/run/install/repo"
 DRACUT_ISODIR = "/run/install/source"
-- 
1.8.5.3



More information about the anaconda-patches mailing list