aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2016-09-14 14:04:40 -0400
committerRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2016-09-14 14:04:40 -0400
commitd6ee458ad47915230291708eaaaf38c059d4fd1c (patch)
treebb3a3962f2f8be85efae687bbbd8ffeec188c1f3
parentquotes to make shellcheck happy (diff)
downloadcatalyst-d6ee458ad47915230291708eaaaf38c059d4fd1c.tar.gz
catalyst-d6ee458ad47915230291708eaaaf38c059d4fd1c.tar.bz2
catalyst-d6ee458ad47915230291708eaaaf38c059d4fd1c.zip
operate in /tmp/stage1root as appropriate during stage1
-rwxr-xr-xtargets/stage1/stage1-controller.sh4
-rwxr-xr-xtargets/stage1/stage1-preclean-chroot.sh16
2 files changed, 11 insertions, 9 deletions
diff --git a/targets/stage1/stage1-controller.sh b/targets/stage1/stage1-controller.sh
index 3ad0ed52..6af13850 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 a80fc92e..0ba4c00d 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