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 1075 by niro, Mon Jun 28 17:22:52 2010 UTC trunk/bootstrap/mage-bootstrap.sh.in revision 3116 by niro, Wed Aug 7 18:35:34 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 124  print_usage() Line 128  print_usage()
128   echo " --toolchain,      -t  --  select other toolchain than from profile"   echo " --toolchain,      -t  --  select other toolchain than from profile"
129   echo " --basesystem,     -b  --  select other basesystem than from profile"   echo " --basesystem,     -b  --  select other basesystem than from profile"
130   echo " --stage1,         -s1 --  if set, abort after stage1 (toolchain)"   echo " --stage1,         -s1 --  if set, abort after stage1 (toolchain)"
131   echo "  --update-tarball, -ut -- update via tarball not rsync"   echo " --update-tarball, -ut --  update via tarball not rsync"
132   echo " --no-update,      -u  --  do not update the mage tree"   echo " --no-update,      -u  --  do not update the mage tree"
133   echo " --help,           -h  --  prints this help"   echo " --help,           -h  --  prints this help"
134   echo   echo
# 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 240  add_initrc "export BASESYSTEM=${BASESYST Line 247  add_initrc "export BASESYSTEM=${BASESYST
247  add_initrc "export PROFILE=${PROFILE}"  add_initrc "export PROFILE=${PROFILE}"
248  add_initrc "export CONFIG_PROTECT=-*"  add_initrc "export CONFIG_PROTECT=-*"
249  add_initrc "export MY_MAGEDIR=${MY_MAGEDIR}"  add_initrc "export MY_MAGEDIR=${MY_MAGEDIR}"
250    if [[ -n ${MAGERC} ]]
251    then
252     # unset global MAGERC here (bash-5 inclusion issues)
253     add_initrc 'unset MAGERC'
254    fi
255    
256  # add proxies if defined  # add proxies if defined
257  [[ -n ${http_proxy} ]] && add_initrc "export http_proxy=${http_proxy}"  [[ -n ${http_proxy} ]] && add_initrc "export http_proxy=${http_proxy}"

Legend:
Removed from v.1075  
changed lines
  Added in v.3116