# ChangeLog for gentoo/src/catalyst
# Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.39 2004/04/06 05:31:37 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.40 2004/04/12 14:38:26 zhen Exp $
+
+ 12 Apr 2004; John Davis <zhen@gentoo.org> modules/catalyst_support.py,
+ targets/embedded/cramfs-runscript.sh, targets/embedded/embedded-chroot.sh,
+ targets/embedded/embedded-preclean-chroot.sh, targets/embedded/embedded.sh,
+ targets/grp/grp-chroot.sh, targets/grp/grp-preclean-chroot.sh,
+ targets/grp/grp.sh, targets/livecd-stage1/livecd-stage1-chroot.sh,
+ targets/livecd-stage1/livecd-stage1-preclean-chroot.sh,
+ targets/livecd-stage1/livecd-stage1.sh, targets/stage1/stage1-chroot.sh,
+ targets/stage1/stage1-preclean1-chroot.sh,
+ targets/stage1/stage1-preclean2-chroot.sh, targets/stage1/stage1.sh,
+ targets/stage2/stage2-chroot.sh, targets/stage2/stage2-preclean-chroot.sh,
+ targets/stage2/stage2.sh, targets/stage3/stage3.sh,
+ targets/tinderbox/tinderbox.sh:
+ lots of cleanup on the bash backend. take a look @ the code and report bugs to
+ zhen@gentoo.org please.
06 Apr 2004; John Davis <zhen@gentoo.org> targets/stage1/stage1-chroot.sh:
fix for /dev in stage1
# Distributed under the GNU General Public License version 2
# Copyright 2003-2004 Gentoo Technologies, Inc.
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.17 2004/02/13 02:41:26 drobbins Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.18 2004/04/12 14:38:26 zhen Exp $
import sys,string,os,types
mypack[x]="'"+mypack[x]+"'"
mypack=string.join(mypack)
#escape ">" and "<" for the shell (using backslash)
- mypack=string.replace(mypack,">","\\>")
- mypack=string.replace(mypack,"<","\\<")
+ #mypack=string.replace(mypack,">","\\>")
+ #mypack=string.replace(mypack,"<","\\<")
return mypack
required_config_file_values=["storedir","sharedir","distdir","portdir"]
+#!/bin/bash
# Copyright david@futuretel.com
# puts a the embedded image into a cramfs
}
case $1 in
-
-run)
- # move this to preclean stage
- # it's a hack because dhcpcd is lame
- install -d $root_fs_path/var/lib/dhcpc
+ run)
+ # move this to preclean stage
+ # it's a hack because dhcpcd is lame
+ install -d $root_fs_path/var/lib/dhcpc
- install -d $clst_image_path
- mkcramfs $root_fs_path $clst_image_path/root.img
- imagesize=`du -sk $clst_image_path/root.img | cut -f1`
- echo "Created cramfs image at ${clst_image_path}/root.img"
- echo "Image size: ${imagesize}k"
+ install -d $clst_image_path
+ mkcramfs $root_fs_path $clst_image_path/root.img
+ imagesize=`du -sk $clst_image_path/root.img | cut -f1`
+ echo "Created cramfs image at ${clst_image_path}/root.img"
+ echo "Image size: ${imagesize}k"
;;
-preclean)
+ preclean)
;;
esac
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-chroot.sh,v 1.1 2004/04/12 14:38:26 zhen Exp $
+
+/usr/sbin/env-update
+source /etc/profile
+
+if [ -n "${clst_ENVSCRIPT}" ]
+then
+ source /tmp/envscript
+ rm -f /tmp/envscript
+fi
+
+if [ -n "${clst_CCACHE}" ]
+then
+ export clst_myfeatures="${clst_myfeatures} ccache"
+ emerge --oneshot --nodeps ccache || exit 1
+fi
+
+if [ -n "${clst_DISTCC}" ]
+then
+ export clst_myfeatures="${clst_myfeatures} distcc"
+ export DISTCC_HOSTS="${clst_distcc_hosts}"
+
+ USE="-gtk -gnome" emerge --oneshot --nodeps distcc || exit 1
+ echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
+ /usr/bin/distcc-config --install 2>&1 > /dev/null
+ /usr/bin/distccd 2>&1 > /dev/null
+fi
+
+if [ -n "${clst_PKGCACHE}" ]
+then
+ export clst_myemergeopts="--usepkg --buildpkg"
+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
+ROOT=/tmp/mergeroot emerge ${clst_myemergeopts} ${clst_embedded_packages} || exit 1
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/embedded-preclean-chroot.sh,v 1.1 2004/04/12 14:38:26 zhen Exp $
+
+/usr/sbin/env-update
+source /etc/profile
+
+if [ -n "${clst_DISTCC}" ]
+then
+ killall -9 distccd
+ userdel distcc || exit 1
+fi
+#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/Attic/embedded.sh,v 1.2 2004/04/04 16:58:15 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/embedded/Attic/embedded.sh,v 1.3 2004/04/12 14:38:26 zhen Exp $
case $1 in
-enter)
- $clst_CHROOT $clst_chroot_path
+ enter)
+ ${clst_CHROOT} ${clst_chroot_path}
;;
-run)
- $clst_CHROOT $clst_chroot_path /bin/bash << EOF
- /usr/sbin/env-update
- source /etc/profile
- export USE="\${clst_embedded_use}"
- rm -f /tmp/stage23
- if [ -n "${clst_CCACHE}" ]
- then
- export FEATURES="ccache"
- emerge --oneshot --nodeps ccache || exit 1
- fi
- export CONFIG_PROTECT="-*"
-
- #portage needs to be merged manually with USE="build" set to avoid frying our
- #make.conf. emerge system could merge it otherwise.
- #USE="build" emerge portage
- if [ ! -d "/tmp/mergeroot" ]
- then
- install -d /tmp/mergeroot
- fi
+ run)
+ if [ -n "${clst_ENVSCRIPT}" ]
+ then
+ cp "${clst_ENVSCRIPT}" ${clst_chroot_path}/tmp/envscript
+ fi
- if [ -n "${clst_PKGCACHE}" ]
- then
- ROOT=/tmp/mergeroot emerge -O $clst_embedded_packages --usepkg --buildpkg || exit 1
- else
- ROOT=/tmp/mergeroot emerge -O $clst_embedded_packages || exit 1
- fi
-EOF
- [ $? -ne 0 ] && exit 1
+ cp ${clst_sharedir}/targets/embedded/embedded-chroot.sh ${clst_chroot_path}/tmp
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/embedded-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/embedded-chroot.sh
+
+ [ $? -ne 0 ] && exit 1
;;
-preclean)
- $clst_CHROOT $clst_chroot_path /bin/bash << EOF
- env-update
- source /etc/profile
- if [ -n "${clst_CCACHE}" ]
- then
- emerge -C dev-util/ccache || exit 1
- fi
-EOF
- [ $? -ne 0 ] && exit 1
+
+ preclean)
+ exit 0
;;
-clean)
- exit 0
+
+ clean)
+ exit 0
;;
-*)
- exit 1
+
+ *)
+ exit 1
;;
+
esac
exit 0
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/grp-chroot.sh,v 1.1 2004/04/12 14:38:26 zhen Exp $
+
+/usr/sbin/env-update
+source /etc/profile
+
+if [ -n "${clst_ENVSCRIPT}" ]
+then
+ source /tmp/envscript
+ rm -f /tmp/envscript
+fi
+
+if [ -n "${clst_CCACHE}" ]
+then
+ export clst_myfeatures="${clst_myfeatures} ccache"
+ emerge --oneshot --nodeps ccache || exit 1
+fi
+
+if [ -n "${clst_DISTCC}" ]
+then
+ export clst_myfeatures="${clst_myfeatures} distcc"
+ export DISTCC_HOSTS="${clst_distcc_hosts}"
+
+ USE="-gnome -gtk" emerge --oneshot --nodeps distcc || exit 1
+ echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
+ /usr/bin/distcc-config --install 2>&1 > /dev/null
+ /usr/bin/distccd 2>&1 > /dev/null
+fi
+
+# setup the environment
+export FEATURES="${clst_myfeatures}"
+export CONFIG_PROTECT="-*"
+
+## START BUILD
+USE="build" emerge portage
+#turn off auto-use:
+
+export USE_ORDER="env:conf:defaults"
+
+if [ "${clst_grp_type}" = "pkgset" ]
+then
+ unset DISTDIR
+ export PKGDIR="/tmp/grp/${clst_grp_target}"
+ emerge --usepkg --buildpkg --noreplace ${clst_grp_packages} || exit 1
+else
+ unset DISTDIR
+ #don't grab MS core fonts, etc.
+ export USE="${USE} bindist"
+ #first grab to the normal distdir
+
+ ## why don't we just set distdir first and fetch once???
+ DISTDIR="/tmp/grp/${clst_grp_target}" emerge --fetchonly ${clst_grp_packages} || exit 1
+ #export DISTDIR="/tmp/grp/${clst_grp_target}"
+ #export OLD_MIRRORS="${GENTOO_MIRRORS}"
+ #export GENTOO_MIRRORS="/usr/portage/distfiles"
+ #now grab them again, but with /usr/portage/distfiles as the primary mirror (local grab)
+ #emerge --fetchonly ${clst_grp_packages} || exit 1
+ #restore original GENTOO_MIRRORS setting, if any
+ #export GENTOO_MIRRORS="${OLD_MIRRORS}"
+ unset PKGDIR
+fi
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/grp-preclean-chroot.sh,v 1.1 2004/04/12 14:38:26 zhen Exp $
+
+/usr/sbin/env-update
+source /etc/profile
+
+if [ -n "${clst_DISTCC}" ]
+then
+ killall -9 distccd
+ userdel distcc || exit 1
+fi
+#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/Attic/grp.sh,v 1.12 2004/04/04 16:58:15 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/grp/Attic/grp.sh,v 1.13 2004/04/12 14:38:26 zhen Exp $
case $1 in
-enter)
- $clst_CHROOT $clst_chroot_path
+ enter)
+ ${clst_CHROOT} ${clst_chroot_path}
;;
-run)
- shift
- export clst_grp_type=$1
- shift
- export clst_grp_target=$1
- shift
- export clst_grp_packages="$*"
- $clst_CHROOT $clst_chroot_path /bin/bash << EOF
- /usr/sbin/env-update
- source /etc/profile
- if [ -n "${clst_ENVSCRIPT}" ]
- then
- source /tmp/envscript
- rm -f /tmp/envscript
- fi
- if [ -n "${clst_CCACHE}" ]
- then
- export FEATURES="ccache"
- emerge --oneshot --nodeps ccache || exit 1
- fi
- if [ -n "${clst_DISTCC}" ]
- then
- export FEATURES="distcc"
- export DISTCC_HOSTS="${clst_distcc_hosts}"
- USE="-gnome -gtk" emerge --oneshot --nodeps distcc || exit 1
- echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
- /usr/bin/distcc-config --install 2>&1 > /dev/null
- /usr/bin/distccd 2>&1 > /dev/null
- fi
- export CONFIG_PROTECT="-*"
-
- USE="build" emerge portage
- #turn off auto-use:
- export USE_ORDER="env:conf:defaults"
- if [ "$clst_grp_type" = "pkgset" ]
- then
- unset DISTDIR
- export PKGDIR="/tmp/grp/$clst_grp_target"
- emerge --usepkg --buildpkg --noreplace $clst_grp_packages || exit 1
- else
- unset DISTDIR
- #don't grab MS core fonts, etc.
- export USE="\$USE bindist"
- #first grab to the normal distdir
- emerge --fetchonly $clst_grp_packages || exit 1
- export DISTDIR="/tmp/grp/$clst_grp_target"
- export OLD_MIRRORS="\$GENTOO_MIRRORS"
- export GENTOO_MIRRORS="/usr/portage/distfiles"
- #now grab them again, but with /usr/portage/distfiles as the primary mirror (local grab)
- emerge --fetchonly $clst_grp_packages || exit 1
- #restore original GENTOO_MIRRORS setting, if any
- export GENTOO_MIRRORS="\$OLD_MIRRORS"
- unset PKGDIR
- fi
-EOF
- [ $? -ne 0 ] && exit 1
+ run)
+ shift
+ export clst_grp_type=$1
+ shift
+ export clst_grp_target=$1
+ shift
+
+ if [ -n "${clst_ENVSCRIPT}" ]
+ then
+ cp ${clst_ENVSCRIPT} ${clst_chroot_path}/tmp/envscript
+ fi
+
+ cp ${clst_sharedir}/targets/grp/grp-chroot.sh ${clst_chroot_path}/tmp
+ clst_grp_packages="$*" ${clst_CHROOT} ${clst_chroot_path} /tmp/grp-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/grp-chroot.sh
+
+ [ $? -ne 0 ] && exit 1
+ ;;
+
+ preclean)
+ cp ${clst_sharedir}/targets/grp/grp-preclean-chroot.sh ${clst_chroot_path}/tmp
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/grp-preclean-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/grp-preclean-chroot.sh
+
+ [ $? -ne 0 ] && exit 1
;;
-*)
- exit 1
+
+ clean)
+ exit 0
+ ;;
+
+ *)
+ exit 1
;;
+
esac
exit 0
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-chroot.sh,v 1.1 2004/04/12 14:38:26 zhen Exp $
+
+/usr/sbin/env-update
+source /etc/profile
+
+if [ -n "${clst_ENVSCRIPT}" ]
+then
+ source /tmp/envscript
+ rm -f /tmp/envscript
+fi
+
+if [ -n "${clst_CCACHE}" ]
+then
+ export clst_myfeatures="${clst_myfeatures} ccache"
+ emerge --oneshot --nodeps ccache || exit 1
+fi
+
+if [ -n "${clst_DISTCC}" ]
+then
+ export clst_myfeatures="${clst_myfeatures} distcc"
+ export DISTCC_HOSTS="${clst_distcc_hosts}"
+
+ USE="-gnome -gtk" emerge --oneshot --nodeps distcc || exit 1
+ echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
+ /usr/bin/distcc-config --install 2>&1 > /dev/null
+ /usr/bin/distccd 2>&1 > /dev/null
+fi
+
+if [ -n "${clst_PKGCACHE}" ]
+then
+ clst_emergeopts="--usepkg --buildpkg"
+else
+ clst_emergeopts=""
+fi
+
+## setup the environment
+export FEATURES="${clst_myfeatures}"
+export CONFIG_PROTECT="-*"
+
+## START BUILD
+USE="build" emerge portage
+#turn off auto-use:
+export USE_ORDER="env:conf:defaults"
+
+emerge ${clst_emergeopts} ${clst_packages}
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh,v 1.1 2004/04/12 14:38:26 zhen Exp $
+
+/usr/sbin/env-update
+source /etc/profile
+
+if [ -n "${clst_DISTCC}" ]
+then
+ killall -9 distccd
+ userdel distcc || exit 1
+fi
+#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/Attic/livecd-stage1.sh,v 1.8 2004/03/26 17:03:29 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/livecd-stage1/Attic/livecd-stage1.sh,v 1.9 2004/04/12 14:38:26 zhen Exp $
case $1 in
-enter)
- $clst_CHROOT $clst_chroot_path
+ enter)
+ ${clst_CHROOT} ${clst_chroot_path}
;;
-run)
- shift
- $clst_CHROOT $clst_chroot_path /bin/bash << EOF
- env-update
- source /etc/profile
- if [ -n "${clst_ENVSCRIPT}" ]
- then
- source /tmp/envscript
- rm -f /tmp/envscript
- fi
- if [ -n "${clst_CCACHE}" ]
- then
- export FEATURES="ccache"
- emerge --oneshot --nodeps ccache || exit 1
- fi
- if [ -n "${clst_DISTCC}" ]
- then
- export FEATURES="distcc"
- export DISTCC_HOSTS="${clst_distcc_hosts}"
- USE="-gtk -gnome" emerge --oneshot --nodeps distcc || exit 1
- echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /$
- /usr/bin/distcc-config --install 2>&1 > /dev/null
- /usr/bin/distccd 2>&1 > /dev/null
- fi
- export CONFIG_PROTECT="-*"
- USE="build" emerge portage
- #turn off auto-use:
- export USE_ORDER="env:conf:defaults"
- for x in $*
- do
- if [ -n "${clst_PKGCACHE}" ]
+ run)
+ shift
+
+ if [ -n "${clst_ENVSCRIPT}" ]
then
- emerge --usepkg --buildpkg "\$x" || exit 1
- if [ "\$?" -ne 0 ]
- then
- echo "\$x failed to build."
- exit 1
- fi
- else
- emerge "\$x"
- if [ "\$?" -ne 0 ]
- then
- echo "\$x failed to build."
- exit 1
- fi
+ cp "${clst_ENVSCRIPT}" ${clst_chroot_path}/tmp/envscript
fi
- done
-EOF
- [ $? -ne 0 ] && exit 1
- ;;
-*)
- exit 1
+
+ cp ${clst_sharedir}/targets/livecd-stage1/livecd-stage1-chroot.sh ${clst_chroot_path}/tmp
+ clst_packages="$*" ${clst_CHROOT} ${clst_chroot_path} /tmp/livecd-stage1-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/livecd-stage1-chroot.sh
+ [ $? -ne 0 ] && exit 1
;;
+
+ preclean)
+ cp ${clst_sharedir}/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh ${clst_chroot_path}/tmp
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/livecd-stage1-preclean-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/livecd-stage1-preclean-chroot.sh
+
+ [ $? -ne 0 ] && exit 1
+ ;;
+
+ clean)
+ exit 0
+ ;;
+
+ *)
+ exit 1
+ ;;
+
esac
exit 0
#!/bin/bash
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/stage1-chroot.sh,v 1.12 2004/04/12 14:38:26 zhen Exp $
/usr/sbin/env-update
source /etc/profile
source /tmp/envscript
rm -f /tmp/envscript
fi
-
-case $1 in
- build)
-
- #emerge and enable ccache before we set ROOT
- if [ -n "${clst_CCACHE}" ]
- then
- export FEATURES="ccache"
- emerge --oneshot --nodeps ccache || exit 1
- fi
-
- if [ -n "${clst_DISTCC}" ]
- then
- export FEATURES="distcc"
- export DISTCC_HOSTS="${clst_distcc_hosts}"
- USE="-gtk -gnome" emerge --oneshot --nodeps distcc || exit 1
- echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
- /usr/bin/distcc-config --install 2>&1 > /dev/null
- /usr/bin/distccd 2>&1 > /dev/null
- fi
-
- export ROOT=${2}
- install -d $ROOT
- if [ -n "${clst_PKGCACHE}" ]
- then
- export EMERGE_OPTS="--usepkg --buildpkg"
- fi
+if [ -n "${clst_CCACHE}" ]
+then
+ export clst_myfeatures="${clst_myfeatures} ccache"
+ emerge --oneshot --nodeps ccache || exit 1
+fi
- for x in $(/tmp/build.sh)
- do
- echo $x >> /tmp/build.log
- USE="-* build" emerge ${EMERGE_OPTS} --noreplace $x || exit 1
- done
+if [ -n "${clst_DISTCC}" ]
+then
+ export clst_myfeatures="${clst_myfeatures} distcc"
+ export DISTCC_HOSTS="${clst_distcc_hosts}"
- if [ ! -d ${ROOT}/dev ]
- then
- mkdir -p ${ROOT}/dev
- cd ${ROOT}/dev
- MAKEDEV generic-i386
- fi
- ;;
+ USE="-gtk -gnome" emerge --oneshot --nodeps distcc || exit 1
+ echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
+ /usr/bin/distcc-config --install 2>&1 > /dev/null
+ /usr/bin/distccd 2>&1 > /dev/null
+fi
- preclean)
- #normal chroot is fine here since this is our second chroot (no $clst_CHROOT needed)
- chroot ${2} /bin/bash << EOF
- #now, some finishing touches to initialize gcc-config....
- unset ROOT
- if [ -e /usr/sbin/gcc-config ]
- then
- mythang=\$( cd /etc/env.d/gcc; ls ${clst_CHOST}-* )
- gcc-config \${mythang}; /usr/sbin/env-update; source /etc/profile
- fi
- #stage1 is not going to have anything in zoneinfo, so save our Factory timezone
- rm -f /etc/localtime
- cp /usr/share/zoneinfo/Factory /etc/localtime
-EOF
- ;;
-esac
+if [ -n "${clst_PKGCACHE}" ]
+then
+ export EMERGE_OPTS="--usepkg --buildpkg"
+fi
+# setup our environment
+export FEATURES="${clst_myfeatures}"
+export ROOT=${1}
+install -d ${ROOT}
+
+## START BUILD
+for x in $(/tmp/build.sh)
+do
+ echo $x >> /tmp/build.log
+ USE="-* build" emerge ${EMERGE_OPTS} --noreplace $x || exit 1
+done
+
+# if baselayout did not fix up /dev, we do it
+if [ ! -d i${ROOT}/dev ]
+then
+ mkdir -p ${ROOT}/dev
+ cd ${ROOT}/dev
+ MAKEDEV generic-i386
+fi
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/stage1-preclean1-chroot.sh,v 1.1 2004/04/12 14:38:26 zhen Exp $
+
+/usr/sbin/env-update
+source /etc/profile
+
+if [ -n "${clst_DISTCC}" ]
+then
+ /bin/killall -9 distccd
+ userdel distcc || exit 1
+fi
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/stage1-preclean2-chroot.sh,v 1.1 2004/04/12 14:38:26 zhen Exp $
+
+#now, some finishing touches to initialize gcc-config....
+unset ROOT
+
+if [ -e /usr/sbin/gcc-config ]
+then
+ mythang=$( cd /etc/env.d/gcc; ls ${clst_CHOST}-* )
+ echo $mythang; sleep 20
+ gcc-config ${mythang}; /usr/sbin/env-update; source /etc/profile
+fi
+
+#stage1 is not going to have anything in zoneinfo, so save our Factory timezone
+rm -f /etc/localtime
+cp /usr/share/zoneinfo/Factory /etc/localtime
+#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/stage1.sh,v 1.9 2004/03/19 16:06:37 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage1/Attic/stage1.sh,v 1.10 2004/04/12 14:38:26 zhen Exp $
case $1 in
-enter)
- $clst_CHROOT $clst_chroot_path /bin/bash
+ enter)
+ ${clst_CHROOT} ${clst_chroot_path} /bin/bash
;;
-run)
- cp ${clst_sharedir}/targets/stage1/stage1-chroot.sh ${clst_chroot_path}/tmp
- cp ${clst_sharedir}/targets/stage1/build.sh ${clst_chroot_path}/tmp
- # set up "ROOT in chroot" dir
- install -d ${clst_chroot_path}/tmp/stage1root/etc
- # set up make.conf and make.profile link in "ROOT in chroot":
- cp ${clst_chroot_path}/etc/make.conf ${clst_chroot_path}/tmp/stage1root/etc
- cp -a ${clst_chroot_path}/etc/make.profile ${clst_chroot_path}/tmp/stage1root/etc
- # enter chroot, execute our build script
- $clst_CHROOT ${clst_chroot_path} /tmp/stage1-chroot.sh build /tmp/stage1root
- [ $? -ne 0 ] && exit 1
+
+ run)
+ if [ -n "${clst_ENVSCRIPT}" ]
+ then
+ cp "${clst_ENVSCRIPT}" ${clst_chroot_path}/tmp/envscript
+ fi
+
+ cp ${clst_sharedir}/targets/stage1/stage1-chroot.sh ${clst_chroot_path}/tmp
+ cp ${clst_sharedir}/targets/stage1/build.sh ${clst_chroot_path}/tmp
+
+ # set up "ROOT in chroot" dir
+ install -d ${clst_chroot_path}/tmp/stage1root/etc
+
+ # set up make.conf and make.profile link in "ROOT in chroot":
+ cp ${clst_chroot_path}/etc/make.conf ${clst_chroot_path}/tmp/stage1root/etc
+ cp -a ${clst_chroot_path}/etc/make.profile ${clst_chroot_path}/tmp/stage1root/etc
+
+ # enter chroot, execute our build script
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/stage1-chroot.sh /tmp/stage1root
+ [ $? -ne 0 ] && exit 1
;;
-preclean)
- #preclean runs with bind mounts active -- for running any commands inside chroot
- $clst_CHROOT ${clst_chroot_path} /tmp/stage1-chroot.sh preclean /tmp/stage1root
- [ $? -ne 0 ] && exit 1
+
+ preclean)
+ #preclean runs with bind mounts active -- for running any commands inside chroot
+
+ #first we cleanup after ourselves
+ cp ${clst_sharedir}/targets/stage1/stage1-preclean1-chroot.sh ${clst_chroot_path}/tmp
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/stage1-preclean1-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/stage1-preclean1-chroot.sh
+ [ $? -ne 0 ] && exit 1
+
+ #second we do the gcc magic
+ cp ${clst_sharedir}/targets/stage1/stage1-preclean2-chroot.sh ${clst_chroot_path}/tmp/stage1root/tmp
+ ${clst_CHROOT} ${clst_chroot_path}/tmp/stage1root /tmp/stage1-preclean2-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/stage1root/tmp/stage1-preclean2-chroot.sh
+ [ $? -ne 0 ] && exit 1
;;
-clean)
- #clean runs after preclean with bind mounts unmounted
- keepers="sys-kernel/linux-headers sys-devel/binutils sys-devel/gcc sys-apps/baselayout sys-libs/glibc virtual/glibc virtual/kernel"
- # set everything to uid 999 (nouser)
- cd ${clst_chroot_path}/tmp/stage1root
- install -d var/db/pkg2
- for x in $keepers
- do
- category=${x%%/*}
- package=${x##*/}
- [ "`ls var/db/pkg/${x}* 2>/dev/null`" = "" ] && continue
- install -d var/db/pkg2/${category}
- mv var/db/pkg/${category}/${package}* var/db/pkg2/${category}
- done
- rm -rf var/db/pkg
- mv var/db/pkg2 var/db/pkg
+
+ clean)
+ #clean runs after preclean with bind mounts unmounted
+ keepers="sys-kernel/linux-headers sys-devel/binutils sys-devel/gcc sys-apps/baselayout sys-libs/glibc virtual/glibc virtual/kernel"
+ # set everything to uid 999 (nouser)
+ cd ${clst_chroot_path}/tmp/stage1root
+ install -d var/db/pkg2
+
+ for x in $keepers
+ do
+ category=${x%%/*}
+ package=${x##*/}
+ [ "`ls var/db/pkg/${x}* 2>/dev/null`" = "" ] && continue
+ install -d var/db/pkg2/${category}
+ mv var/db/pkg/${category}/${package}* var/db/pkg2/${category}
+ done
+ rm -rf var/db/pkg
+ mv var/db/pkg2 var/db/pkg
- # clean out man, info and doc files
- rm -rf usr/share/{man,doc,info}/*
- # zap all .pyc and .pyo files
- find -iname "*.py[co]" -exec rm -f {} \;
- # cleanup all .a files except libgcc.a, *_nonshared.a and /usr/lib/portage/bin/*.a
- find -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' | grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a' | xargs rm -f
+ # clean out man, info and doc files
+ rm -rf usr/share/{man,doc,info}/*
+ # zap all .pyc and .pyo files
+ find -iname "*.py[co]" -exec rm -f {} \;
+ # cleanup all .a files except libgcc.a, *_nonshared.a and /usr/lib/portage/bin/*.a
+ find -iname "*.a" | grep -v 'libgcc.a' | grep -v 'nonshared.a' | grep -v '/usr/lib/portage/bin/' | grep -v 'libgcc_eh.a' | xargs rm -f
;;
+
*)
- exit 1
+ exit 1
;;
+
esac
exit 0
--- /dev/null
+#!/bin/sh
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-chroot.sh,v 1.1 2004/04/12 14:38:26 zhen Exp $
+
+/usr/sbin/env-update
+source /etc/profile
+
+if [ -n ${clst_ENVSCRIPT} ]
+then
+ source /tmp/envscript
+ rm -f /tmp/envscript
+fi
+
+if [ -n "${clst_CCACHE}" ]
+then
+ export clst_myfeatures="${clst_myfeatures} ccache"
+ emerge --oneshot --nodeps ccache || exit 1
+fi
+
+if [ -n "${clst_DISTCC}" ]
+then
+ export clst_myfeatures="${clst_myfeatures} distcc"
+ export DISTCC_HOSTS="${clst_distcc_hosts}"
+
+ USE="-gnome -gtk" emerge --oneshot --nodeps distcc || exit 1
+ echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
+ /usr/bin/distcc-config --install 2>&1 > /dev/null
+ /usr/bin/distccd 2>&1 > /dev/null
+fi
+
+if [ -n "${clst_PKGCACHE}" ]
+then
+ export EMERGE_OPTS="--usepkg --buildpkg"
+fi
+
+grep GRP_STAGE23_USE /etc/make.profile/make.defaults > /tmp/stage23
+source /tmp/stage23
+rm -f /tmp/stage23
+
+if [ -f /usr/portage/profiles/${clst_profile}/parent ]
+then
+ export clst_bootstrap="bootstrap-cascade.sh"
+else
+ export clst_bootstrap=bootstrap.sh
+fi
+
+## setup the environment
+export FEATURES="${clst_myfeatures}"
+
+## START BUILD
+/usr/portage/scripts/${clst_bootstrap} || exit 1
--- /dev/null
+#!/bin/bash
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/stage2-preclean-chroot.sh,v 1.1 2004/04/12 14:38:26 zhen Exp $
+
+/usr/sbin/env-update
+source /etc/profile
+
+export CONFIG_PROTECT="-*"
+
+if [ -n "${clst_CCACHE}" ]
+then
+ emerge -C dev-util/ccache || exit 1
+fi
+
+if [ -n "${clst_DISTCC}" ]
+then
+ killall -9 distccd
+ emerge -C sys-devel/distcc || exit 1
+ userdel distcc || exit 1
+fi
+#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/Attic/stage2.sh,v 1.11 2004/04/04 16:58:15 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage2/Attic/stage2.sh,v 1.12 2004/04/12 14:38:26 zhen Exp $
case $1 in
-enter)
- $clst_CHROOT $clst_chroot_path
+ enter)
+
+ $clst_CHROOT ${clst_chroot_path}
;;
-run)
- $clst_CHROOT $clst_chroot_path /bin/bash << EOF
- /usr/sbin/env-update
- source /etc/profile
- if [ -n "${clst_ENVSCRIPT}" ]
- then
- source /tmp/envscript
- rm -f /tmp/envscript
- fi
- cat /etc/make.profile/make.defaults | grep GRP_STAGE23_USE > /tmp/stage23
- source /tmp/stage23
- export USE="-* \${clst_HOSTUSE} \${GRP_STAGE23_USE}"
- if [ -n "${clst_CCACHE}" ]
- then
- export FEATURES="ccache"
- emerge --oneshot --nodeps ccache || exit 1
- fi
- if [ -n "${clst_DISTCC}" ]
- then
- export FEATURES="distcc"
- export DISTCC_HOSTS="${clst_distcc_hosts}"
- USE="-gnome -gtk" emerge --oneshot --nodeps distcc || exit 1
- echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
- /usr/bin/distcc-config --install 2>&1 > /dev/null
- /usr/bin/distccd 2>&1 > /dev/null
- fi
- if [ -n "${clst_PKGCACHE}" ]
- then
- export EMERGE_OPTS="--usepkg --buildpkg"
- fi
- if [ -f /usr/portage/profiles/${clst_profile}/parent ]
- then
- export clst_bootstrap="bootstrap-cascade.sh"
- else
- export clst_bootstrap=bootstrap.sh
- fi
- /usr/portage/scripts/\${clst_bootstrap} || exit 1
-EOF
- [ $? -ne 0 ] && exit 1
+
+ run)
+ if [ -n "${clst_ENVSCRIPT}" ]
+ then
+ cp "${clst_ENVSCRIPT}" ${clst_chroot_path}/tmp/envscript
+ fi
+
+ cp ${clst_sharedir}/targets/stage2/stage2-chroot.sh ${clst_chroot_path}/tmp
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/stage2-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/stage2-chroot.sh
+ [ $? -ne 0 ] && exit 1
;;
-preclean)
- #preclean runs with bind-mounts active
- $clst_CHROOT $clst_chroot_path /bin/bash << EOF
- env-update
- source /etc/profile
- if [ -n "${clst_CCACHE}" ]
- then
- emerge -C dev-util/ccache || exit 1
- fi
- if [ -n "${clst_DISTCC}" ]
- then
- emerge -C sys-devel/distcc || exit 1
- fi
-EOF
- [ $? -ne 0 ] && exit 1
+
+ preclean)
+ cp ${clst_sharedir}/targets/stage2/stage2-preclean-chroot.sh ${clst_chroot_path}/tmp
+ #preclean runs with bind-mounts active
+ $clst_CHROOT $clst_chroot_path /tmp/stage2-preclean-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/stage2-preclean-chroot.sh
+ [ $? -ne 0 ] && exit 1
;;
-clean)
- exit 0
+
+ clean)
+ exit 0
;;
-*)
- exit 1
+
+ *)
+ exit 1
;;
+
esac
exit 0
+#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/Attic/stage3.sh,v 1.12 2004/04/04 16:58:15 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/stage3/Attic/stage3.sh,v 1.13 2004/04/12 14:38:26 zhen Exp $
case $1 in
-enter)
- $clst_CHROOT $clst_chroot_path
+ enter)
+ ${clst_CHROOT} ${clst_chroot_path}
;;
-run)
- $clst_CHROOT $clst_chroot_path /bin/bash << EOF
- /usr/sbin/env-update
- source /etc/profile
- if [ -n ${ENVSCRIPT} ]
- then
- source /tmp/envscript
- rm -f /tmp/envscript
- fi
- cat /etc/make.profile/make.defaults | grep GRP_STAGE23_USE > /tmp/stage23
- source /tmp/stage23
- export USE="-* \${clst_HOSTUSE} \${GRP_STAGE23_USE}"
- rm -f /tmp/stage23
- export CONFIG_PROTECT="-*"
-
- #portage needs to be merged manually with USE="build" set to avoid frying our
- #make.conf. emerge system could merge it otherwise.
- USE="build" emerge portage
- if [ -n "${clst_CCACHE}" ]
- then
- export FEATURES="ccache"
- emerge --oneshot --nodeps ccache || exit 1
- fi
- if [ -n "${clst_DISTCC}" ]
- then
- export FEATURES="distcc"
- export DISTCC_HOSTS="${clst_distcc_hosts}"
- USE="-gnome -gtk" emerge --oneshot --nodeps distcc || exit 1
- echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
- /usr/bin/distcc-config --install 2>&1 > /dev/null
- /usr/bin/distccd 2>&1 > /dev/null
- fi
- if [ -n "${clst_PKGCACHE}" ]
- then
- emerge system --usepkg --buildpkg || exit 1
- else
- emerge system || exit 1
- fi
-EOF
- [ $? -ne 0 ] && exit 1
+
+ run)
+ if [ -n "${clst_ENVSCRIPT}" ]
+ then
+ cp "${clstr_ENVSCRIPT}" ${clst_chroot_path}/tmp/envscript
+ fi
+
+ cp ${clst_sharedir}/targets/stage3/stage3-chroot.sh ${clst_chroot_path}/tmp
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/stage3-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/stage3-chroot.sh
+ [ $? -ne 0 ] && exit 1
;;
-preclean)
- $clst_CHROOT $clst_chroot_path /bin/bash << EOF
- env-update
- source /etc/profile
- if [ -n "${clst_CCACHE}" ]
- then
- emerge -C dev-util/ccache || exit 1
- fi
- if [ -n "${clst_DISTCC}" ]
- then
- emerge -C sys-devel/distcc || exit 1
- userdel distcc
- fi
-EOF
- [ $? -ne 0 ] && exit 1
+
+ preclean)
+ cp ${clst_sharedir}/targets/stage3/stage3-preclean-chroot.sh ${clst_chroot_path}/tmp
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/stage3-preclean-chroot.sh
+ rm -rf ${clst_chroot_path}/tmp/stage3-preclean-chroot.sh
+ [ $? -ne 0 ] && exit 1
;;
-clean)
- exit 0
+
+ clean)
+ exit 0
;;
-*)
- exit 1
+
+ *)
+ exit 1
;;
+
esac
exit 0
+#!/bin/bash
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/targets/tinderbox/Attic/tinderbox.sh,v 1.5 2004/04/04 16:58:15 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/targets/tinderbox/Attic/tinderbox.sh,v 1.6 2004/04/12 14:38:26 zhen Exp $
case $1 in
-run)
- shift
- export clst_tinderbox_packages="$*"
- $clst_CHROOT $clst_chroot_path /bin/bash << EOF
- /usr/sbin/env-update
- source /etc/profile
- if [ -n "${clst_ENVSCRIPT}" ]
- then
- source /tmp/envscript
- rm -f /tmp/envscript
- fi
- if [ -n "${clst_CCACHE}" ]
- then
- export FEATURES="ccache"
- emerge --oneshot --nodeps ccache || exit 1
- fi
- if [ -n "${clst_DISTCC}" ]
- then
- export FEATURES="distcc"
- export DISTCC_HOSTS="${clst_distcc_hosts}"
- USE="-gnome -gtk" emerge --oneshot --nodeps distcc || exit 1
- echo "distcc:x:240:2:distccd:/dev/null:/bin/false" >> /etc/passwd
- /usr/bin/distcc-config --install 2>&1 > /dev/null
- /usr/bin/distccd 2>&1 > /dev/null
- fi
- export CONFIG_PROTECT="-*"
-
- USE="build" emerge portage
- #turn off auto-use:
- export USE_ORDER="env:conf:defaults"
- #back up pristine system
- rsync -avx --exclude "/root/" --exclude "/tmp/" --exclude "/usr/portage/" / /tmp/rsync-bak/
- for x in $clst_tinderbox_packages
- do
- emerge --usepkg --buildpkg \$x
- if [ "\$?" != "0" ]
+ run)
+ shift
+
+ if [ -n "${clst_ENVSCRIPT}" ]
then
- echo "! \$x" >> /tmp/tinderbox.log
- else
- echo "\$x" >> /tmp/tinderbox.log
+ cp "${clst_ENVSCRIPT}" ${clst_chroot_path}/tmp/envscript
fi
- echo "Syncing from original pristine tinderbox snapshot..."
- rsync -avx --delete --exclude "/root/*" --exclude "/tmp/" --exclude "/usr/portage/*" /tmp/rsync-bak/ /
- done
-EOF
- [ $? -ne 0 ] && exit 1
- ;;
-*)
- exit 1
+
+ cp ${clst_sharedir}/targets/tinderbox/tinderbox-chroot.sh ${clst_chroot_path}/tmp
+ clst_tinderbox_packages="$*" ${clst_CHROOT} ${clst_chroot_path} /tmp/tinderbox-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/tinderbox-chroot.sh
+
+ [ $? -ne 0 ] && exit 1
;;
+
+ preclean)
+ cp ${clst_sharedir}/targets/grp/tinderbox-preclean-chroot.sh ${clst_chroot_path}/tmp
+ ${clst_CHROOT} ${clst_chroot_path} /tmp/tinderbox-preclean-chroot.sh
+ rm -f ${clst_chroot_path}/tmp/tinderbox-preclean-chroot.sh
+
+ [ $? -ne 0 ] && exit 1
+ ;;
+
+ clean)
+ exit 0
+ ;;
+
+ *)
+ exit 1
+ ;;
+
esac
exit 0