Initial commit after creating the git repository.
[catalyst.git] / targets / stage1 / stage1-chroot.sh
1 #!/bin/bash
2
3 # We do this first, so we know our package list for --debug
4 export clst_buildpkgs="$(/tmp/build.py)"
5
6 source /tmp/chroot-functions.sh
7
8 # Setup our environment
9 STAGE1_USE="$(portageq envvar STAGE1_USE)"
10 FEATURES="${clst_myfeatures} nodoc noman noinfo"
11
12 ## Sanity check profile
13 if [ -z "${clst_buildpkgs}" ]
14 then
15         echo "Your profile seems to be broken."
16         echo "Could not build a list of build packages."
17         echo "Double check your /etc/make.profile link and the 'packages' files."
18         exit 1
19 fi
20
21 ## START BUILD
22 # First, we drop in a known-good baselayout
23 [ -e /etc/make.conf ] && \
24         echo 'USE="${USE} -build"' >> /etc/make.conf
25 run_merge "--oneshot --nodeps sys-apps/baselayout"
26 sed -i '/USE="${USE} -build"/d' /etc/make.conf
27
28 # Next, we install the package manager
29 clst_root_path=/ setup_pkgmgr
30 make_destpath /tmp/stage1root
31
32 # Now, we install our packages
33 [ -e /etc/make.conf ] && \
34         echo "USE=\"-* bindist build ${STAGE1_USE} ${clst_HOSTUSE}\"" \
35         >> /etc/make.conf
36 run_merge "--noreplace --oneshot ${clst_buildpkgs}"
37 sed -i "/USE=\"-* bindist build ${STAGE1_USE} ${clst_HOSTUSE}\"/d" \
38         /etc/make.conf