Magellan Linux

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

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

trunk/bootstrap/mage-bootstrap.sh revision 1485 by niro, Thu Aug 4 13:09:44 2011 UTC trunk/bootstrap/mage-bootstrap.sh.in revision 3117 by niro, Wed Aug 7 18:36:52 2019 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.8 2008-06-23 19:26:40 niro Exp $  # $Id$
3    
4  TOOLCHAIN=""  TOOLCHAIN=""
5  BASESYSTEM=""  BASESYSTEM=""
# Line 79  add_initrc() Line 79  add_initrc()
79    
80  enter_chroot()  enter_chroot()
81  {  {
82   mount -t proc proc ${MROOT}/proc || die "mount proc"   is_loc_mounted "${MROOT}/proc" || mount -t proc proc ${MROOT}/proc
83   mount -o bind /dev ${MROOT}/dev || die "mount dev"   is_loc_mounted "${MROOT}/sys" || mount -t sysfs sysfs ${MROOT}/sys
84     is_loc_mounted "${MROOT}/dev" || mount -o bind /dev ${MROOT}/dev
85    
86   chroot ${MROOT} /bin/bash -i /.installrc || die "chr00ting"   chroot ${MROOT} /bin/bash -i /.installrc || die "chr00ting"
87    
88   umount ${MROOT}/dev ${MROOT}/proc || die "mount proc/dev"   is_loc_mounted "${MROOT}/dev" && umount ${MROOT}/dev
89     is_loc_mounted "${MROOT}/sys" && umount ${MROOT}/sys
90     is_loc_mounted "${MROOT}/proc" && umount ${MROOT}/proc
91    
92   [ -f ${MROOT}/.installrc ] && rm ${MROOT}/.installrc   [ -f ${MROOT}/.installrc ] && rm ${MROOT}/.installrc
93  }  }
# Line 105  trap_exit() Line 108  trap_exit()
108  {  {
109   is_loc_mounted "${MROOT}/dev" && umount ${MROOT}/dev   is_loc_mounted "${MROOT}/dev" && umount ${MROOT}/dev
110   is_loc_mounted "${MROOT}/proc" && umount ${MROOT}/proc   is_loc_mounted "${MROOT}/proc" && umount ${MROOT}/proc
111     is_loc_mounted "${MROOT}/sys" && umount ${MROOT}/sys
112   is_loc_mounted "${MY_MAGEDIR}" && umount ${MY_MAGEDIR}   is_loc_mounted "${MY_MAGEDIR}" && umount ${MY_MAGEDIR}
113   is_loc_mounted "${MY_PKGDIR}" && umount ${MY_PKGDIR}   is_loc_mounted "${MY_PKGDIR}" && umount ${MY_PKGDIR}
114   echo "bootstrap aborted"   echo "bootstrap aborted"
# Line 148  do Line 152  do
152   --root|-r) shift; MROOT="$1" ;;   --root|-r) shift; MROOT="$1" ;;
153   --stage1|-s1) ABORT_AFTER_STAGE1=true ;;   --stage1|-s1) ABORT_AFTER_STAGE1=true ;;
154   --magerc|-m) shift; MAGERC="$1" ;;   --magerc|-m) shift; MAGERC="$1" ;;
155   --update-tarball|-ut) shift; MAGEUPDATETARBALL=true ;;   --update-tarball|-ut) MAGEUPDATETARBALL=true ;;
156   --no-update|-u) shift; MAGEUPDATE=false ;;   --no-update|-u) MAGEUPDATE=false ;;
157   --help|-h) print_usage ;;   --help|-h) print_usage ;;
158   '') shift;;   '') shift;;
159   *) echo "Unkown option '$1', use --help or -h to get more info."; exit 1 ;;   *) echo "Unkown option '$1', use --help or -h to get more info."; exit 1 ;;
# Line 214  fi Line 218  fi
218  [ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< ${MY_MAGEDIR}/profiles/${PROFILE}/basesystem.defaults)"  [ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< ${MY_MAGEDIR}/profiles/${PROFILE}/basesystem.defaults)"
219    
220  # install toolchain  # install toolchain
221  CONFIG_PROTECT="-*" MROOT="${MROOT}" MAGERC="${MAGERC}" mage install ${TOOLCHAIN} || die "toolchain install"  if ! MROOT="${MROOT}" MAGERC="${MAGERC}" magequery -n ${TOOLCHAIN}
222    then
223     CONFIG_PROTECT="-*" MROOT="${MROOT}" MAGERC="${MAGERC}" mage install ${TOOLCHAIN} || die "toolchain install"
224    fi
225    
226  # umount dirs, they are not needed anymore  # umount dirs, they are not needed anymore
227  umount ${MY_MAGEDIR} ${MY_PKGDIR} || die "umount mage/pkgdir"  umount ${MY_MAGEDIR} ${MY_PKGDIR} || die "umount mage/pkgdir"
# Line 229  then Line 236  then
236   echo "Stage1 complete; user requested to abort after this step."   echo "Stage1 complete; user requested to abort after this step."
237   echo "Exiting ..."   echo "Exiting ..."
238   exit 0   exit 0
239    else
240     echo "Stage1 complete; continuing."
241  fi  fi
242    
243  # now create an initrc for the installation of the basesystem  # now create an initrc for the installation of the basesystem
# Line 240  add_initrc "export BASESYSTEM=${BASESYST Line 249  add_initrc "export BASESYSTEM=${BASESYST
249  add_initrc "export PROFILE=${PROFILE}"  add_initrc "export PROFILE=${PROFILE}"
250  add_initrc "export CONFIG_PROTECT=-*"  add_initrc "export CONFIG_PROTECT=-*"
251  add_initrc "export MY_MAGEDIR=${MY_MAGEDIR}"  add_initrc "export MY_MAGEDIR=${MY_MAGEDIR}"
252    if [[ -n ${MAGERC} ]]
253    then
254     # unset global MAGERC here (bash-5 inclusion issues)
255     add_initrc 'unset MAGERC'
256    fi
257    
258  # add proxies if defined  # add proxies if defined
259  [[ -n ${http_proxy} ]] && add_initrc "export http_proxy=${http_proxy}"  [[ -n ${http_proxy} ]] && add_initrc "export http_proxy=${http_proxy}"

Legend:
Removed from v.1485  
changed lines
  Added in v.3117