VIF_GUEST=eth0
##########
-FEDORA_MIRROR_BASE="http://mirror.onelab.eu/fedora/"
+FEDORA_MIRROR="http://mirror.onelab.eu/"
FEDORA_MIRROR_KEYS="http://mirror.onelab.eu/keys/"
FEDORA_PREINSTALLED="dnf dnf-yum passwd rsyslog vim-minimal dhclient chkconfig rootfiles policycoreutils openssh-server openssh-clients"
DEBIAN_PREINSTALLED="openssh-server openssh-client"
# copy yum config and repo files
cp /etc/yum.conf $INSTALL_ROOT/etc/
- cp /etc/yum.repos.d/fedora* $INSTALL_ROOT/etc/yum.repos.d/
+ cp /etc/yum.repos.d/fedora{,-updates}.repo $INSTALL_ROOT/etc/yum.repos.d/
# append fedora repo files with desired ${fedora_release} and $basearch
for f in $INSTALL_ROOT/etc/yum.repos.d/* ; do
sed -i "s/\$basearch/$arch/g; s/\$releasever/${fedora_release}/g;" $f
done
- MIRROR_URL=$FEDORA_MIRROR_BASE/releases/${fedora_release}/Everything/$arch/os
+ MIRROR_URL=$FEDORA_MIRROR/fedora/releases/${fedora_release}/Everything/$arch/os
# since fedora18 the rpms are scattered by first name
# first try the second version of fedora-release first
RELEASE_URLS=""
local subindex
for subindex in 3 2 1; do
- RELEASE_URLS="$RELEASE_URLS $MIRROR_URL/Packages/f/fedora-release-${fedora_release}-1.noarch.rpm"
+ RELEASE_URLS="$RELEASE_URLS $MIRROR_URL/Packages/f/fedora-release-${fedora_release}-${subindex}.noarch.rpm"
done
RELEASE_TARGET=$INSTALL_ROOT/fedora-release-${fedora_release}.noarch.rpm
echo "Initializing yum.repos.d in $lxc"
rm -f $lxc_root/etc/yum.repos.d/*
- cat > $lxc_root/etc/yum.repos.d/building.repo <<EOF
-[fedora]
-name=Fedora \$releasever - \$basearch
-baseurl=$FEDORA_MIRROR_BASE/releases/\$releasever/Everything/\$basearch/os/
-enabled=1
-metadata_expire=7d
-gpgcheck=1
-gpgkey=$FEDORA_MIRROR_KEYS/RPM-GPG-KEY-fedora-${fedora_release}-primary
-
-[updates]
-name=Fedora \$releasever - \$basearch - Updates
-baseurl=$FEDORA_MIRROR_BASE/updates/\$releasever/\$basearch/
-enabled=1
-metadata_expire=7d
-gpgcheck=1
-gpgkey=$FEDORA_MIRROR_KEYS/RPM-GPG-KEY-fedora-${fedora_release}-primary
-EOF
+ # use mirroring/ stuff instead of a hard-wired config
+ local repofile=$lxc_root/etc/yum.repos.d/building.repo
+ yumconf_mirrors $repofile ${DIRNAME} $fcdistro \
+ "" $FEDORA_MIRROR
+ # the keys stuff requires adjustment though
+ sed -i $repofile -e s,'gpgkey=.*',"gpgkey=${FEDORA_MIRROR_KEYS}/RPM-GPG-KEY-fedora-${fedora_release}-primary,"
# import fedora key so that gpgckeck does not whine or require stdin
# required since fedora24