3 source /tmp/chroot-functions.sh
5 # We do this first, so we know our package list for --debug
6 export clst_buildpkgs="$(/tmp/build.py)"
8 # Setup our environment
9 BOOTSTRAP_USE="$(portageq envvar BOOTSTRAP_USE)"
10 [ -n "${clst_BINDIST}" ] && BOOTSTRAP_USE="${BOOTSTRAP_USE} bindist"
12 FEATURES="${clst_myfeatures} nodoc noman noinfo -news"
14 ## Sanity check profile
15 if [ -z "${clst_buildpkgs}" ]
17 echo "Your profile seems to be broken."
18 echo "Could not build a list of build packages."
19 echo "Double check your /etc/portage/make.profile link and the 'packages' files."
23 ## Setup seed pkgmgr to ensure latest
24 clst_root_path=/ setup_pkgmgr
27 if [ -n "${clst_update_seed}" ]; then
28 if [ "${clst_update_seed}" == "yes" ]; then
29 echo "Updating seed stage..."
30 if [ -n "${clst_update_seed_command}" ]; then
31 clst_root_path=/ run_merge "--buildpkg=n ${clst_update_seed_command}"
33 clst_root_path=/ run_merge "--update --deep --newuse --complete-graph --rebuild-if-new-ver gcc"
35 elif [ "${clst_update_seed}" != "no" ]; then
36 echo "Invalid setting for update_seed: ${clst_update_seed}"
40 # reset emerge options for the target
41 clst_update_seed=no setup_myemergeopts
43 echo "Skipping seed stage update..."
46 make_destpath /tmp/stage1root
49 # First, we drop in a known-good baselayout
50 [ -e /etc/portage/make.conf ] && \
51 echo 'USE="${USE} -build"' >> /etc/portage/make.conf
52 run_merge "--oneshot --nodeps sys-apps/baselayout"
54 sed -i '/USE="${USE} -build"/d' /etc/portage/make.conf
56 # Now, we install our packages
57 [ -e /etc/portage/make.conf ] && \
58 echo "USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" \
59 >> /etc/portage/make.conf
60 run_merge "--oneshot ${clst_buildpkgs}"
61 sed -i "/USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \
62 /etc/portage/make.conf