--- trunk/bootstrap/mage-bootstrap.sh 2009/05/03 17:10:39 835 +++ trunk/bootstrap/mage-bootstrap.sh.in 2013/10/08 14:40:13 2181 @@ -8,6 +8,8 @@ ABORT_AFTER_STAGE1=false MY_MAGEDIR="" MY_PKGDIR="" +MAGEUPDATE=true +MAGEUPDATETARBALL=false die() { @@ -78,11 +80,12 @@ enter_chroot() { mount -t proc proc ${MROOT}/proc || die "mount proc" + mount -t sysfs sysfs ${MROOT}/sys || die "mount sys" mount -o bind /dev ${MROOT}/dev || die "mount dev" chroot ${MROOT} /bin/bash -i /.installrc || die "chr00ting" - umount ${MROOT}/dev ${MROOT}/proc || die "mount proc/dev" + umount ${MROOT}/dev ${MROOT}/sys ${MROOT}/proc || die "mount proc/sys/dev" [ -f ${MROOT}/.installrc ] && rm ${MROOT}/.installrc } @@ -103,6 +106,7 @@ { is_loc_mounted "${MROOT}/dev" && umount ${MROOT}/dev is_loc_mounted "${MROOT}/proc" && umount ${MROOT}/proc + is_loc_mounted "${MROOT}/sys" && umount ${MROOT}/sys is_loc_mounted "${MY_MAGEDIR}" && umount ${MY_MAGEDIR} is_loc_mounted "${MY_PKGDIR}" && umount ${MY_PKGDIR} echo "bootstrap aborted" @@ -115,14 +119,16 @@ echo "Usage: $(basename $0) --opt arg ..." echo echo "Options:" - echo " --profile, -p -- select a profile (needed)" - echo " --root, -r -- location to new root (needed)" - echo " --magerc, -m -- location of mage.rc (needed)" + echo " --profile, -p -- select a profile (needed)" + echo " --root, -r -- location to new root (needed)" + echo " --magerc, -m -- location of mage.rc (needed)" echo - echo " --toolchain, -t -- select other toolchain than from profile" - echo " --basesystem, -b -- select other basesystem than from profile" - echo " --stage1, -s1 -- if set, abort after stage1 (toolchain)" - echo " --help, -h -- prints this help" + echo " --toolchain, -t -- select other toolchain than from profile" + echo " --basesystem, -b -- select other basesystem than from profile" + echo " --stage1, -s1 -- if set, abort after stage1 (toolchain)" + echo " --update-tarball, -ut -- update via tarball not rsync" + echo " --no-update, -u -- do not update the mage tree" + echo " --help, -h -- prints this help" echo exit 1 @@ -144,6 +150,8 @@ --root|-r) shift; MROOT="$1" ;; --stage1|-s1) ABORT_AFTER_STAGE1=true ;; --magerc|-m) shift; MAGERC="$1" ;; + --update-tarball|-ut) MAGEUPDATETARBALL=true ;; + --no-update|-u) MAGEUPDATE=false ;; --help|-h) print_usage ;; '') shift;; *) echo "Unkown option '$1', use --help or -h to get more info."; exit 1 ;; @@ -185,7 +193,15 @@ ln -snf ${MY_MAGEDIR}/profiles/${PROFILE} /etc/mage-profile || die "link profile" # update mage tree -MAGERC="${MAGERC}" mage update || die "update mage-tree" +if [[ ${MAGEUPDATE} = true ]] +then + if [[ ${MAGEUPDATETARBALL} = true ]] + then + MAGERC="${MAGERC}" mage update-tarball || die "update mage-tree" + else + MAGERC="${MAGERC}" mage update || die "update mage-tree" + fi +fi # now get the toolchain and the basesystem layout file # [ -z "${TOOLCHAIN}" ] && TOOLCHAIN="toolchain.defaults" @@ -200,7 +216,10 @@ [ -z "${BASESYSTEM}" ] && BASESYSTEM="$(< ${MY_MAGEDIR}/profiles/${PROFILE}/basesystem.defaults)" # install toolchain -CONFIG_PROTECT="-*" MROOT="${MROOT}" MAGERC="${MAGERC}" mage install ${TOOLCHAIN} || die "toolchain install" +if ! MROOT="${MROOT}" MAGERC="${MAGERC}" magequery -n ${TOOLCHAIN} +then + CONFIG_PROTECT="-*" MROOT="${MROOT}" MAGERC="${MAGERC}" mage install ${TOOLCHAIN} || die "toolchain install" +fi # umount dirs, they are not needed anymore umount ${MY_MAGEDIR} ${MY_PKGDIR} || die "umount mage/pkgdir"