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 835 by niro, Sun May 3 17:10:39 2009 UTC trunk/bootstrap/mage-bootstrap.sh.in revision 2181 by niro, Tue Oct 8 14:40:13 2013 UTC
# Line 8  MROOT="" Line 8  MROOT=""
8  ABORT_AFTER_STAGE1=false  ABORT_AFTER_STAGE1=false
9  MY_MAGEDIR=""  MY_MAGEDIR=""
10  MY_PKGDIR=""  MY_PKGDIR=""
11    MAGEUPDATE=true
12    MAGEUPDATETARBALL=false
13    
14  die()  die()
15  {  {
# Line 78  add_initrc() Line 80  add_initrc()
80  enter_chroot()  enter_chroot()
81  {  {
82   mount -t proc proc ${MROOT}/proc || die "mount proc"   mount -t proc proc ${MROOT}/proc || die "mount proc"
83     mount -t sysfs sysfs ${MROOT}/sys || die "mount sys"
84   mount -o bind /dev ${MROOT}/dev || die "mount dev"   mount -o bind /dev ${MROOT}/dev || die "mount 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"   umount ${MROOT}/dev ${MROOT}/sys ${MROOT}/proc || die "mount proc/sys/dev"
89    
90   [ -f ${MROOT}/.installrc ] && rm ${MROOT}/.installrc   [ -f ${MROOT}/.installrc ] && rm ${MROOT}/.installrc
91  }  }
# Line 103  trap_exit() Line 106  trap_exit()
106  {  {
107   is_loc_mounted "${MROOT}/dev" && umount ${MROOT}/dev   is_loc_mounted "${MROOT}/dev" && umount ${MROOT}/dev
108   is_loc_mounted "${MROOT}/proc" && umount ${MROOT}/proc   is_loc_mounted "${MROOT}/proc" && umount ${MROOT}/proc
109     is_loc_mounted "${MROOT}/sys" && umount ${MROOT}/sys
110   is_loc_mounted "${MY_MAGEDIR}" && umount ${MY_MAGEDIR}   is_loc_mounted "${MY_MAGEDIR}" && umount ${MY_MAGEDIR}
111   is_loc_mounted "${MY_PKGDIR}" && umount ${MY_PKGDIR}   is_loc_mounted "${MY_PKGDIR}" && umount ${MY_PKGDIR}
112   echo "bootstrap aborted"   echo "bootstrap aborted"
# Line 115  print_usage() Line 119  print_usage()
119   echo "Usage: $(basename $0) --opt arg ..."   echo "Usage: $(basename $0) --opt arg ..."
120   echo   echo
121   echo "Options:"   echo "Options:"
122   echo " --profile,    -p  --  select a profile (needed)"   echo " --profile,        -p  --  select a profile (needed)"
123   echo " --root,       -r  --  location to new root (needed)"   echo " --root,           -r  --  location to new root (needed)"
124   echo " --magerc,     -m  --  location of mage.rc (needed)"   echo " --magerc,         -m  --  location of mage.rc (needed)"
125   echo   echo
126   echo " --toolchain,  -t  --  select other toolchain than from profile"   echo " --toolchain,      -t  --  select other toolchain than from profile"
127   echo " --basesystem, -b  --  select other basesystem than from profile"   echo " --basesystem,     -b  --  select other basesystem than from profile"
128   echo " --stage1,     -s1 --  if set, abort after stage1 (toolchain)"   echo " --stage1,         -s1 --  if set, abort after stage1 (toolchain)"
129   echo " --help,       -h  --  prints this help"   echo " --update-tarball, -ut --  update via tarball not rsync"
130     echo " --no-update,      -u  --  do not update the mage tree"
131     echo " --help,           -h  --  prints this help"
132   echo   echo
133    
134   exit 1   exit 1
# Line 144  do Line 150  do
150   --root|-r) shift; MROOT="$1" ;;   --root|-r) shift; MROOT="$1" ;;
151   --stage1|-s1) ABORT_AFTER_STAGE1=true ;;   --stage1|-s1) ABORT_AFTER_STAGE1=true ;;
152   --magerc|-m) shift; MAGERC="$1" ;;   --magerc|-m) shift; MAGERC="$1" ;;
153     --update-tarball|-ut) MAGEUPDATETARBALL=true ;;
154     --no-update|-u) MAGEUPDATE=false ;;
155   --help|-h) print_usage ;;   --help|-h) print_usage ;;
156   '') shift;;   '') shift;;
157   *) 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 185  mount -o bind ${MROOT}/${MY_PKGDIR} ${MY Line 193  mount -o bind ${MROOT}/${MY_PKGDIR} ${MY
193  ln -snf ${MY_MAGEDIR}/profiles/${PROFILE} /etc/mage-profile || die "link profile"  ln -snf ${MY_MAGEDIR}/profiles/${PROFILE} /etc/mage-profile || die "link profile"
194    
195  # update mage tree  # update mage tree
196  MAGERC="${MAGERC}" mage update || die "update mage-tree"  if [[ ${MAGEUPDATE} = true ]]
197    then
198     if [[ ${MAGEUPDATETARBALL} = true ]]
199     then
200     MAGERC="${MAGERC}" mage update-tarball || die "update mage-tree"
201     else
202     MAGERC="${MAGERC}" mage update || die "update mage-tree"
203     fi
204    fi
205    
206  # now get the toolchain and the basesystem layout file  # now get the toolchain and the basesystem layout file
207  # [ -z "${TOOLCHAIN}" ] && TOOLCHAIN="toolchain.defaults"  # [ -z "${TOOLCHAIN}" ] && TOOLCHAIN="toolchain.defaults"
# Line 200  MAGERC="${MAGERC}" mage update || die "u Line 216  MAGERC="${MAGERC}" mage update || die "u
216  [ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< ${MY_MAGEDIR}/profiles/${PROFILE}/basesystem.defaults)"  [ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< ${MY_MAGEDIR}/profiles/${PROFILE}/basesystem.defaults)"
217    
218  # install toolchain  # install toolchain
219  CONFIG_PROTECT="-*" MROOT="${MROOT}" MAGERC="${MAGERC}" mage install ${TOOLCHAIN} || die "toolchain install"  if ! MROOT="${MROOT}" MAGERC="${MAGERC}" magequery -n ${TOOLCHAIN}
220    then
221     CONFIG_PROTECT="-*" MROOT="${MROOT}" MAGERC="${MAGERC}" mage install ${TOOLCHAIN} || die "toolchain install"
222    fi
223    
224  # umount dirs, they are not needed anymore  # umount dirs, they are not needed anymore
225  umount ${MY_MAGEDIR} ${MY_PKGDIR} || die "umount mage/pkgdir"  umount ${MY_MAGEDIR} ${MY_PKGDIR} || die "umount mage/pkgdir"

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