export PATH=/sbin:/bin:/usr/sbin:/usr/bin
+echo "* Entering mkfedora " "$@"
+
# Verbosity
verbose=0
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
# 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 \
+core/$releasever/Everything/$basearch/os
linux/core/$releasever/$basearch/os
"
else
"
fi
+echo "$0: candidate mirrors"
+for mirror in "${mirrors[@]}" ; do
+ echo "* candidate mirror $mirror"
+done
+baseurl=""
for mirror in "${mirrors[@]}" ; do
for attempt in $attempts; do
- baseurl=$mirror/$attempt
- if fetch $baseurl/repodata/repomd.xml >/dev/null ; then
- break
+ attempturl=$mirror/$attempt
+ if fetch $attempturl/repodata/repomd.xml >/dev/null ; then
+ baseurl=$attempturl
+ break 2
fi
- unset baseurl
done
- if [ -n "$baseurl" ] ; then
- break
- fi
- unset baseurl
done
if [ -z "$baseurl" ] ; then
# 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 <<EOF
+%_install_langs C:de:en:es:fr
+%_netsharedpath /proc:/dev/pts
+%_excludedocs yes
+EOF
+# copy to the vserver's rpm macros
+mkdir -p $vroot/etc/rpm
+cp /etc/rpm/macros $vroot/etc/rpm/macros
+
+# Mount in reference image
mount -t devpts none $vroot/dev/pts
mount -t tmpfs none $vroot/dev/shm
-
-# make rpms ignore installing stuff to /proc
-mkdir -p $vroot/etc/rpm
-echo "%_netsharedpath /proc" > $vroot/etc/rpm/macros
-# Mount /proc in reference image
mkdir -p $vroot/proc
mount -t proc none $vroot/proc