--- trunk/bootstrap/scripts/mage-bootstrap.sh 2006/02/23 16:46:43 339 +++ trunk/bootstrap/mage-bootstrap.sh 2009/05/03 17:10:39 835 @@ -1,5 +1,5 @@ #!/bin/bash -# $Header: /home/cvsd/magellan-cvs/magellan-src/bootstrap/scripts/mage-bootstrap.sh,v 1.4 2006-02-23 16:46:43 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/bootstrap/scripts/mage-bootstrap.sh,v 1.8 2008-06-23 19:26:40 niro Exp $ TOOLCHAIN="" BASESYSTEM="" @@ -55,6 +55,8 @@ local SMAGE2RSYNC # sanity checks + [ -f /etc/mage.rc.global ] && source /etc/mage.rc.global || \ + die "get_value_from_magefile: /etc/mage.rc.global not found." [ -f ${magerc} ] && source ${magerc} || \ die "get_value_from_magefile: ${magerc} not found." [ -z "${var}" ] && die "get_value_from_magefile: \$var not given." @@ -109,7 +111,7 @@ print_usage() { - echo "mage-bootstrap, version $Id: mage-bootstrap.sh,v 1.4 2006-02-23 16:46:43 niro Exp $" + echo "mage-bootstrap, version @VERSION@" echo "Usage: $(basename $0) --opt arg ..." echo echo "Options:" @@ -183,7 +185,7 @@ ln -snf ${MY_MAGEDIR}/profiles/${PROFILE} /etc/mage-profile || die "link profile" # update mage tree -mage update || die "update mage-tree" +MAGERC="${MAGERC}" mage update || die "update mage-tree" # now get the toolchain and the basesystem layout file # [ -z "${TOOLCHAIN}" ] && TOOLCHAIN="toolchain.defaults" @@ -192,13 +194,13 @@ # TOOLCHAIN="$(< /etc/mage-profile/${TOOLCHAIN})" # BASESYSTEM="$(< /etc/mage-profile/${BASESYSTEM})" -# this way toolchain and basesytem can be packages; +# this way toolchain and basesystem can be packages; # only if nothing set the layout files from the profile will be taken -[ -z "${TOOLCHAIN}" ] && TOOLCHAIN="$(< /etc/mage-profile/toolchain.defaults)" -[ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< /etc/mage-profile/basesystem.defaults)" +[ -z "${TOOLCHAIN}" ] && TOOLCHAIN="$(< ${MY_MAGEDIR}/profiles/${PROFILE}/toolchain.defaults)" +[ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< ${MY_MAGEDIR}/profiles/${PROFILE}/basesystem.defaults)" # install toolchain -CONFIG_PROTECT="-*" MROOT="${MROOT}" mage install ${TOOLCHAIN} || die "toolchain install" +CONFIG_PROTECT="-*" MROOT="${MROOT}" MAGERC="${MAGERC}" mage install ${TOOLCHAIN} || die "toolchain install" # umount dirs, they are not needed anymore umount ${MY_MAGEDIR} ${MY_PKGDIR} || die "umount mage/pkgdir" @@ -217,6 +219,7 @@ # now create an initrc for the installation of the basesystem :> ${MROOT}/.installrc +add_initrc "export MAGE_BOOTSTRAP=true" add_initrc "export HOME=/root" add_initrc "export PATH=/bin:/usr/bin:/sbin:/usr/sbin" add_initrc "export BASESYSTEM=${BASESYSTEM}" @@ -239,6 +242,4 @@ enter_chroot echo "System bootstrap to '${MROOT}' finished." - exit 0 -