Removing any functions that we now call by default when we source chroot-functions...
[catalyst.git] / targets / embedded / embedded-chroot.sh
index 3e970fe984b1e49c92f4921e80e66586aa9c1804..6f2b97b024231dc20b723a3eee7f16b81492959c 100755 (executable)
@@ -1,68 +1,15 @@
 #!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-chroot.sh,v 1.13 2005/01/28 18:37:23 wolf31o2 Exp $
 
-portage_version=`/usr/lib/portage/bin/portageq best_version / sys-apps/portage \
-       | cut -d/ -f2 | cut -d- -f2,3`
-if [ `echo ${portage_version} | cut -d- -f1 | cut -d. -f3` -lt 51 ]
-then
-       echo "ERROR: Your portage version is too low in your seed stage.  Portage version"
-       echo "2.0.51 or greater is required."
-       exit 1
-fi
+. /tmp/chroot-functions.sh
 
-/usr/sbin/env-update
-source /etc/profile
+# Setup the environment
+export DESTROOT="${clst_root_path}"
+export clst_root_path="/"
 
-[ -f /tmp/envscript ] && source /tmp/envscript
+echo "Installing dependencies into ${DESTROOT}..."
+run_emerge -o "${clst_embedded_packages}"
 
-if [ -n "${clst_CCACHE}" ]
-then
-       export clst_myfeatures="${clst_myfeatures} ccache"
-       emerge --oneshot --nodeps -b -k ccache || exit 1
-fi
+export clst_root_path="${DESTROOT}"
+export INSTALL_MASK="${clst_install_mask}" 
 
-if [ -n "${clst_DISTCC}" ]
-then
-       export clst_myfeatures="${clst_myfeatures} distcc"
-       export DISTCC_HOSTS="${clst_distcc_hosts}"
-
-       USE="-gtk -gnome" emerge --oneshot --nodeps -b -k distcc || exit 1
-fi
-
-if [ -n "${clst_PKGCACHE}" ]
-then
-       export clst_myemergeopts="--usepkg --buildpkg --newuse"
-fi
-
-if [ -n "${clst_FETCH}" ]
-then
-       export clst_myemergeopts="${clst_myemergeopts} -f"
-fi
-
-# setup the environment
-export FEATURES="${clst_myfeatures}"
-export CONFIG_PROTECT="-*"
-export clst_myemergeopts="${clst_myemergeopts} -O"
-export USE="${clst_embedded_use}"
-
-if [ ! -d "/tmp/mergeroot" ]
-then
-       install -d /tmp/mergeroot
-fi
-
-## START BUILD
-if [ "${clst_VERBOSE}" ]
-then
-       ROOT=/tmp/mergeroot emerge ${clst_myemergeopts} -vp ${clst_embedded_packages} || exit 1
-       echo "Press any key within 15 seconds to pause the build..."
-       read -s -t 15 -n 1
-       if [ $? -eq 0 ]
-       then
-               echo "Press any key to continue..."
-               read -s -n 1
-       fi
-fi
-
-ROOT=/tmp/mergeroot emerge ${clst_myemergeopts} ${clst_embedded_packages} || exit 1
+run_emerge -1 -O "${clst_embedded_packages}"