X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=mkfedora;h=a43496e9176c23d39a554e84be5769e5648adbe2;hb=9ec895047155840da75dfda900ddc559acae3240;hp=46cb22279dcf6001755e6af0445031673b8e8c19;hpb=ac3b764becf1f57ba72c229a7e5701b6c81ff590;p=build.git diff --git a/mkfedora b/mkfedora index 46cb2227..a43496e9 100755 --- a/mkfedora +++ b/mkfedora @@ -13,7 +13,7 @@ # 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 @@ -24,6 +24,7 @@ verbose=0 # Default yum repositories to try mirrors=( file:///data/fedora +http://localhost/fedora ftp://smoke.cs.princeton.edu/pub/mirrors/fedora http://coblitz.codeen.org/coblitz.planet-lab.org/pub/fedora ftp://mirror.cs.princeton.edu/pub/mirrors/fedora @@ -133,26 +134,30 @@ 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=" +$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 + 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 + for attempt in $attempts; do + baseurl=$mirror/$attempt + if fetch $baseurl/repodata/repomd.xml >/dev/null ; then + break + fi + unset baseurl + done if [ -n "$baseurl" ] ; then break fi @@ -160,23 +165,14 @@ for mirror in "${mirrors[@]}" ; do 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 @@ -195,13 +191,14 @@ set -e mount -t devpts none $vroot/dev/pts mount -t tmpfs none $vroot/dev/shm -# Mount /proc in reference image -mkdir -p $vroot/proc -mount -t proc none $vroot/proc +# why do we need this ? it prevents the 'filesystem' rpm from installing +## Mount /proc in reference image +#mkdir -p $vroot/proc +#mount -t proc none $vroot/proc cleanup () { - umount -l $vroot/proc +# umount -l $vroot/proc umount -l $vroot/dev/shm umount -l $vroot/dev/pts } @@ -212,8 +209,7 @@ trap "cleanup" ERR INT # Create a /var/lib dirs for yum & rpm mkdir -p $vroot/var/lib/yum mkdir -p $vroot/var/lib/rpm - - +mkdir -p $vroot/usr/share/info # Create a dummy /etc/fstab in reference image mkdir -p $vroot/etc