Magellan Linux

Diff of /trunk/bootstrap/mage-bootstrap.sh.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/bootstrap/scripts/mage-bootstrap.sh revision 339 by niro, Thu Feb 23 16:46:43 2006 UTC trunk/bootstrap/mage-bootstrap.sh revision 835 by niro, Sun May 3 17:10:39 2009 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2  # $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 $
3    
4  TOOLCHAIN=""  TOOLCHAIN=""
5  BASESYSTEM=""  BASESYSTEM=""
# Line 55  read_magerc() Line 55  read_magerc()
55   local SMAGE2RSYNC   local SMAGE2RSYNC
56    
57   # sanity checks   # sanity checks
58     [ -f /etc/mage.rc.global ] && source /etc/mage.rc.global || \
59     die "get_value_from_magefile: /etc/mage.rc.global not found."
60   [ -f ${magerc} ] && source ${magerc} || \   [ -f ${magerc} ] && source ${magerc} || \
61   die "get_value_from_magefile: ${magerc} not found."   die "get_value_from_magefile: ${magerc} not found."
62   [ -z "${var}" ] && die "get_value_from_magefile: \$var not given."   [ -z "${var}" ] && die "get_value_from_magefile: \$var not given."
# Line 109  trap_exit() Line 111  trap_exit()
111    
112  print_usage()  print_usage()
113  {  {
114   echo "mage-bootstrap, version $Id: mage-bootstrap.sh,v 1.4 2006-02-23 16:46:43 niro Exp $"   echo "mage-bootstrap, version @VERSION@"
115   echo "Usage: $(basename $0) --opt arg ..."   echo "Usage: $(basename $0) --opt arg ..."
116   echo   echo
117   echo "Options:"   echo "Options:"
# Line 183  mount -o bind ${MROOT}/${MY_PKGDIR} ${MY Line 185  mount -o bind ${MROOT}/${MY_PKGDIR} ${MY
185  ln -snf ${MY_MAGEDIR}/profiles/${PROFILE} /etc/mage-profile || die "link profile"  ln -snf ${MY_MAGEDIR}/profiles/${PROFILE} /etc/mage-profile || die "link profile"
186    
187  # update mage tree  # update mage tree
188  mage update || die "update mage-tree"  MAGERC="${MAGERC}" mage update || die "update mage-tree"
189    
190  # now get the toolchain and the basesystem layout file  # now get the toolchain and the basesystem layout file
191  # [ -z "${TOOLCHAIN}" ] && TOOLCHAIN="toolchain.defaults"  # [ -z "${TOOLCHAIN}" ] && TOOLCHAIN="toolchain.defaults"
# Line 192  mage update || die "update mage-tree" Line 194  mage update || die "update mage-tree"
194  # TOOLCHAIN="$(< /etc/mage-profile/${TOOLCHAIN})"  # TOOLCHAIN="$(< /etc/mage-profile/${TOOLCHAIN})"
195  # BASESYSTEM="$(< /etc/mage-profile/${BASESYSTEM})"  # BASESYSTEM="$(< /etc/mage-profile/${BASESYSTEM})"
196    
197  # this way toolchain and basesytem can be packages;  # this way toolchain and basesystem can be packages;
198  # only if nothing set the layout files from the profile will be taken  # only if nothing set the layout files from the profile will be taken
199  [ -z "${TOOLCHAIN}" ] && TOOLCHAIN="$(< /etc/mage-profile/toolchain.defaults)"  [ -z "${TOOLCHAIN}" ] && TOOLCHAIN="$(< ${MY_MAGEDIR}/profiles/${PROFILE}/toolchain.defaults)"
200  [ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< /etc/mage-profile/basesystem.defaults)"  [ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< ${MY_MAGEDIR}/profiles/${PROFILE}/basesystem.defaults)"
201    
202  # install toolchain  # install toolchain
203  CONFIG_PROTECT="-*" MROOT="${MROOT}" mage install ${TOOLCHAIN} || die "toolchain install"  CONFIG_PROTECT="-*" MROOT="${MROOT}" MAGERC="${MAGERC}" mage install ${TOOLCHAIN} || die "toolchain install"
204    
205  # umount dirs, they are not needed anymore  # umount dirs, they are not needed anymore
206  umount ${MY_MAGEDIR} ${MY_PKGDIR} || die "umount mage/pkgdir"  umount ${MY_MAGEDIR} ${MY_PKGDIR} || die "umount mage/pkgdir"
# Line 217  fi Line 219  fi
219    
220  # now create an initrc for the installation of the basesystem  # now create an initrc for the installation of the basesystem
221  :> ${MROOT}/.installrc  :> ${MROOT}/.installrc
222    add_initrc "export MAGE_BOOTSTRAP=true"
223  add_initrc "export HOME=/root"  add_initrc "export HOME=/root"
224  add_initrc "export PATH=/bin:/usr/bin:/sbin:/usr/sbin"  add_initrc "export PATH=/bin:/usr/bin:/sbin:/usr/sbin"
225  add_initrc "export BASESYSTEM=${BASESYSTEM}"  add_initrc "export BASESYSTEM=${BASESYSTEM}"
# Line 239  add_initrc "mage clean" Line 242  add_initrc "mage clean"
242  enter_chroot  enter_chroot
243    
244  echo "System bootstrap to '${MROOT}' finished."  echo "System bootstrap to '${MROOT}' finished."
   
245  exit 0  exit 0
   

Legend:
Removed from v.339  
changed lines
  Added in v.835