files/catalyst.conf: Whitespace cleanup
[proj/catalyst.git] / targets / stage1 / stage1-chroot.sh
1 #!/bin/bash
2
3 source /tmp/chroot-functions.sh
4
5 # We do this first, so we know our package list for --debug
6 export clst_buildpkgs="$(/tmp/build.py)"
7
8 # Setup our environment
9 BOOTSTRAP_USE="$(portageq envvar BOOTSTRAP_USE)"
10 FEATURES="${clst_myfeatures} nodoc noman noinfo -news"
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/portage/make.profile link and the 'packages' files."
18 exit 1
19 fi
20
21 ## Setup seed pkgmgr to ensure latest
22 clst_root_path=/ setup_pkgmgr
23
24 # Update stage3
25 if [ -n "${clst_update_seed}" ]; then
26 if [ "${clst_update_seed}" == "yes" ]; then
27 echo "Updating seed stage..."
28 if [ -n "${clst_update_command}" ]; then
29 clst_root_path=/ run_merge "${clst_update_command}"
30 else
31 clst_root_path=/ run_merge "--update --deep --newuse --onlydeps gcc"
32 fi
33 elif [ "${clst_update_seed}" != "no" ]; then
34 echo "Invalid setting for update_seed: ${clst_update_seed}"
35 exit 1
36 fi
37 else
38 echo "Skipping seed stage update..."
39 fi
40
41 make_destpath /tmp/stage1root
42
43 ## START BUILD
44 # First, we drop in a known-good baselayout
45 [ -e /etc/portage/make.conf ] && \
46 echo 'USE="${USE} -build"' >> /etc/portage/make.conf
47 run_merge "--oneshot --nodeps sys-apps/baselayout"
48
49 sed -i '/USE="${USE} -build"/d' /etc/portage/make.conf
50
51 # Now, we install our packages
52 [ -e /etc/portage/make.conf ] && \
53 echo "USE=\"-* bindist build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" \
54 >> /etc/portage/make.conf
55 run_merge "--oneshot ${clst_buildpkgs}"
56 sed -i "/USE=\"-* bindist build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \
57 /etc/portage/make.conf