lots of changes to the bash backend
authorJohn P. Davis <zhen@gentoo.org>
Mon, 12 Apr 2004 14:38:26 +0000 (14:38 +0000)
committerJohn P. Davis <zhen@gentoo.org>
Mon, 12 Apr 2004 14:38:26 +0000 (14:38 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@347 d1e1f19c-881f-0410-ab34-b69fee027534

21 files changed:
ChangeLog
modules/catalyst_support.py
targets/embedded/cramfs-runscript.sh
targets/embedded/embedded-chroot.sh [new file with mode: 0755]
targets/embedded/embedded-preclean-chroot.sh [new file with mode: 0755]
targets/embedded/embedded.sh
targets/grp/grp-chroot.sh [new file with mode: 0755]
targets/grp/grp-preclean-chroot.sh [new file with mode: 0755]
targets/grp/grp.sh
targets/livecd-stage1/livecd-stage1-chroot.sh [new file with mode: 0755]
targets/livecd-stage1/livecd-stage1-preclean-chroot.sh [new file with mode: 0755]
targets/livecd-stage1/livecd-stage1.sh
targets/stage1/stage1-chroot.sh
targets/stage1/stage1-preclean1-chroot.sh [new file with mode: 0755]
targets/stage1/stage1-preclean2-chroot.sh [new file with mode: 0755]
targets/stage1/stage1.sh
targets/stage2/stage2-chroot.sh [new file with mode: 0755]
targets/stage2/stage2-preclean-chroot.sh [new file with mode: 0755]
targets/stage2/stage2.sh
targets/stage3/stage3.sh
targets/tinderbox/tinderbox.sh

index f25e5f713238129904fce2c9899f83b353f2e2aa..90c4ec8819f92aad2fdde72917df0d6f466fc69c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,21 @@
 # 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
index 0315978c9b36d60a22a4c74ed40ab8ddf9abe671..5bf5ac207f21f8fd1e5aa36d4c9265a57f64245a 100644 (file)
@@ -1,6 +1,6 @@
 # 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
 
@@ -14,8 +14,8 @@ def list_bashify(mylist):
                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"]
index 4f7fe481ae50da3a31c5219f379d0a5b25c48b8f..46a516b70aabfd1791aa35fa14ff1aeb5b42b556 100644 (file)
@@ -1,3 +1,4 @@
+#!/bin/bash
 # Copyright david@futuretel.com
 # puts a the embedded image into a cramfs
 
@@ -9,20 +10,19 @@ die() {
 }
 
 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
diff --git a/targets/embedded/embedded-chroot.sh b/targets/embedded/embedded-chroot.sh
new file mode 100755 (executable)
index 0000000..1611230
--- /dev/null
@@ -0,0 +1,49 @@
+#!/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
diff --git a/targets/embedded/embedded-preclean-chroot.sh b/targets/embedded/embedded-preclean-chroot.sh
new file mode 100755 (executable)
index 0000000..cd1e6c3
--- /dev/null
@@ -0,0 +1,13 @@
+#!/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
index 1cbbfaff2576fa0f68c5dc868eaf69316c93b723..61bc029149907f50db1a71c3d901a8f5858327e0 100644 (file)
@@ -1,58 +1,37 @@
+#!/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
diff --git a/targets/grp/grp-chroot.sh b/targets/grp/grp-chroot.sh
new file mode 100755 (executable)
index 0000000..2f3ba15
--- /dev/null
@@ -0,0 +1,63 @@
+#!/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
diff --git a/targets/grp/grp-preclean-chroot.sh b/targets/grp/grp-preclean-chroot.sh
new file mode 100755 (executable)
index 0000000..99be76c
--- /dev/null
@@ -0,0 +1,13 @@
+#!/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
index fd6b3e7afdf69135a85e3d2ecdc9a5f3845f9a3c..ff506c0340fe5ce893f2daf00d60c74dc44ecae7 100755 (executable)
@@ -1,70 +1,46 @@
+#!/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
diff --git a/targets/livecd-stage1/livecd-stage1-chroot.sh b/targets/livecd-stage1/livecd-stage1-chroot.sh
new file mode 100755 (executable)
index 0000000..bc164d1
--- /dev/null
@@ -0,0 +1,48 @@
+#!/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}
diff --git a/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh b/targets/livecd-stage1/livecd-stage1-preclean-chroot.sh
new file mode 100755 (executable)
index 0000000..656c6c6
--- /dev/null
@@ -0,0 +1,13 @@
+#!/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
index 3d015320e181aa293a907edde5f2108ada71103b..feecc217779b3abbe4299d59a5def0382829fcad 100755 (executable)
@@ -1,63 +1,41 @@
+#!/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
index 11635bc40a5b2ec0d09dc41fe79f0e7bb4b81d78..367054d42819418658a1fe66df3dda0519a4ece4 100755 (executable)
@@ -1,4 +1,7 @@
 #!/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
@@ -8,63 +11,45 @@ then
        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
diff --git a/targets/stage1/stage1-preclean1-chroot.sh b/targets/stage1/stage1-preclean1-chroot.sh
new file mode 100755 (executable)
index 0000000..2c67bcb
--- /dev/null
@@ -0,0 +1,13 @@
+#!/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
diff --git a/targets/stage1/stage1-preclean2-chroot.sh b/targets/stage1/stage1-preclean2-chroot.sh
new file mode 100755 (executable)
index 0000000..19308b9
--- /dev/null
@@ -0,0 +1,18 @@
+#!/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
index ee95008cff0029ac565460e2ffc77b0dd783c5a2..93058c47bc081fec8299ab663410138a331d0998 100755 (executable)
@@ -1,55 +1,80 @@
+#!/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
 
diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh
new file mode 100755 (executable)
index 0000000..4be1f19
--- /dev/null
@@ -0,0 +1,52 @@
+#!/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
diff --git a/targets/stage2/stage2-preclean-chroot.sh b/targets/stage2/stage2-preclean-chroot.sh
new file mode 100755 (executable)
index 0000000..f92d3dd
--- /dev/null
@@ -0,0 +1,21 @@
+#!/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
index 0ed8f6d81dec3098b377363293d8a2304e4ffb11..751b1b2a639214b79d42d63d26abb82f1d11b73f 100755 (executable)
@@ -1,72 +1,41 @@
+#!/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
index 4eb9ffa73385fb77f4791005f0b9a5a9d4a019f7..c1e84c475236aa05ec9fb8cb06d88e2cef352e2a 100755 (executable)
@@ -1,73 +1,39 @@
+#!/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
index edd51ee6f145653102bcabc5c172b57daf00b88d..7cfda32f7becebaa7998c80d52195f2e86d9a22f 100755 (executable)
@@ -1,57 +1,39 @@
+#!/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