X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=mkfedora;h=6f01478cbcbe68c4558edd788c53b3b7276edf32;hb=b59769dcfe9e3b9de48b0ab05a1e5098db70af68;hp=c3ba05f823802a3bb75e6d667ac00db00250c7ef;hpb=4a6bd3950bf25b7d74375f3710159c96e15e324f;p=build.git diff --git a/mkfedora b/mkfedora index c3ba05f8..6f01478c 100755 --- a/mkfedora +++ b/mkfedora @@ -13,24 +13,25 @@ # Mark Huang # Copyright (C) 2004-2006 The Trustees of Princeton University # -# $Id: mkfedora,v 1.33 2007/08/31 02:23:08 mef Exp $ +# $Id$ # export PATH=/sbin:/bin:/usr/sbin:/usr/bin +echo "* Entering mkfedora " "$@" + # Verbosity verbose=0 # Default yum repositories to try mirrors=( file:///data/fedora -ftp://smoke.cs.princeton.edu/pub/mirrors/fedora +http://localhost/fedora +http://build.planet-lab.org/fedora http://coblitz.codeen.org/coblitz.planet-lab.org/pub/fedora ftp://mirror.cs.princeton.edu/pub/mirrors/fedora -http://coblitz.planet-lab.org/pub/fedora ftp://mirror.stanford.edu/pub/mirrors/fedora ftp://rpmfind.net/linux/fedora -http://fedora.laptop.org/fedora-linux-releases ) # Release and architecture to install @@ -53,6 +54,7 @@ exclude_kernel= if [ -f /etc/planetlab/plc_config ] ; then . /etc/planetlab/plc_config if [ -n "$PLC_DEVEL_FEDORA_URL" ] ; then + echo "* mkfedora : setting mirrors from /etc/planetlab/config" mirrors=($PLC_DEVEL_FEDORA_URL) fi fi @@ -133,50 +135,47 @@ fetch () curl --fail --silent --max-time 60 "$1" } +# hard to find two mirrors with a similar layout +# set list of attempted locations according to releasever +if [ $releasever -ge 7 ] ; then + attempts=" +linux/releases/$releasever/Everything/$basearch/os +$releasever/Everything/$basearch/os +core/$releasever/Everything/$basearch/os +linux/core/$releasever/$basearch/os +" +else + attempts=" +linux/core/$releasever/$basearch/os +core/$releasever/$basearch/os +$releasever/$basearch/os +" +fi + +echo "$0: candidate mirrors" for mirror in "${mirrors[@]}" ; do - if [ $releasever -ge 7 ] ; then - for baseurl in \ - $mirror/$releasever/Everything/$basearch/os ; do - if fetch $baseurl/repodata/repomd.xml >/dev/null ; then - break - fi - unset baseurl - done - else - for baseurl in \ - $mirror/linux/core/$releasever/$basearch/os \ - $mirror/core/$releasever/$basearch/os \ - $mirror/$releasever/$basearch/os ; do - if fetch $baseurl/repodata/repomd.xml >/dev/null ; then - break - fi - unset baseurl - done - fi - if [ -n "$baseurl" ] ; then - break - fi - unset baseurl + echo "* candidate mirror $mirror" +done +baseurl="" +for mirror in "${mirrors[@]}" ; do + for attempt in $attempts; do + attempturl=$mirror/$attempt + if fetch $attempturl/repodata/repomd.xml >/dev/null ; then + baseurl=$attempturl + break 2 + fi + done done if [ -z "$baseurl" ] ; then - if [ $releasever -ge 7 ] ; then - echo "Error: $releasever/Everything/$basearch/os/repodata/repomd.xml" - echo " could not be found in any of the following locations:" - echo - for mirror in ${mirrors[@]} ; do - echo $mirror/linux - done - else - echo "Error: $releasever/$basearch/os/repodata/repomd.xml" - echo " could not be found in any of the following locations:" - echo - for mirror in ${mirrors[@]} ; do - echo $mirror/linux/core - echo $mirror/core - echo $mirror - done - fi + echo "Error: $releasever/$basearch/os/repodata/repomd.xml" + echo " could not be found in any of the following locations:" + echo + for mirror in ${mirrors[@]} ; do + for attempt in $attempts ; do + echo $mirror/$attempt + done + done echo usage fi @@ -191,11 +190,22 @@ fi # Do not tolerate errors set -e -# Mount /dev/pts and /dev/shm in reference image +## make rpms ignore installing stuff to special fs entries like /proc +# Because of https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=52725 +# you have to use at least one language beside 'C' +# xxx fixme - this must be reviewed once we get the stuff running +cat > /etc/rpm/macros <$vroot/etc/fstab <