commit:     d6ee458ad47915230291708eaaaf38c059d4fd1c
Author:     Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 14 18:04:40 2016 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Wed Sep 14 18:04:40 2016 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d6ee458a

operate in /tmp/stage1root as appropriate during stage1

 targets/stage1/stage1-controller.sh      |  4 ++--
 targets/stage1/stage1-preclean-chroot.sh | 16 +++++++++-------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/targets/stage1/stage1-controller.sh 
b/targets/stage1/stage1-controller.sh
index 3ad0ed5..6af1385 100755
--- a/targets/stage1/stage1-controller.sh
+++ b/targets/stage1/stage1-controller.sh
@@ -28,9 +28,9 @@ case "$1" in
 
        clean)
                # Clean out man, info and doc files
-               rm -rf usr/share/{man,doc,info}/*
+               rm -rf /tmp/stage1root/usr/share/{man,doc,info}/*
                # Zap all .pyc and .pyo files
-               find . -iname "*.py[co]" -exec rm -f {} \;
+               find /tmp/stage1root/ -iname "*.py[co]" -exec rm -f {} \;
        ;;
 
        *)

diff --git a/targets/stage1/stage1-preclean-chroot.sh 
b/targets/stage1/stage1-preclean-chroot.sh
index a80fc92..0ba4c00 100755
--- a/targets/stage1/stage1-preclean-chroot.sh
+++ b/targets/stage1/stage1-preclean-chroot.sh
@@ -1,25 +1,27 @@
 #!/bin/bash
 
 export RUN_DEFAULT_FUNCS="no"
+export ROOT=/tmp/stage1root
 
 source /tmp/chroot-functions.sh
 
 update_env_settings
 show_debug
 
-# Now, some finishing touches to initialize gcc-config....
-unset ROOT
-
+# Right now these will parse the unpacked stage3 but change things
+# inside of /tmp/stage1root due to ROOT env variable
 setup_gcc
 setup_binutils
 
 # Stage1 is not going to have anything in zoneinfo, so save our Factory 
timezone
-if [ -d /usr/share/zoneinfo ]
+if [ -d "${ROOT}/usr/share/zoneinfo" ]
 then
-       rm -f /etc/localtime
-       cp /usr/share/zoneinfo/Factory /etc/localtime
+       rm -f "${ROOT}/etc/localtime"
+       cp "${ROOT}/usr/share/zoneinfo/Factory" "${ROOT}/etc/localtime"
 else
-       echo UTC > /etc/TZ
+       echo UTC > "${ROOT}/etc/TZ"
 fi
 
+# unset ROOT for safety (even though cleanup_stages doesn't use it)
+unset ROOT
 cleanup_stages

Reply via email to