The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1645

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
CentOS only has i386 and x86_64 listed in mirrorlist.centos.org,
use http://mirror.centos.org/altarch/ for all other arches instead

See: https://bugs.centos.org/view.php?id=11250

Signed-off-by: Evgeni Golov <[email protected]>
From 96c76924c2a946b0fb301de5dcfc306303dc5d8a Mon Sep 17 00:00:00 2001
From: Evgeni Golov <[email protected]>
Date: Sat, 24 Jun 2017 18:53:05 +0200
Subject: [PATCH] use altarch mirror for CentOS on arches other than i386 and
 x86_64

CentOS only has i386 and x86_64 listed in mirrorlist.centos.org,
use http://mirror.centos.org/altarch/ for all other arches instead

See: https://bugs.centos.org/view.php?id=11250

Signed-off-by: Evgeni Golov <[email protected]>
---
 templates/lxc-centos.in | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in
index e81d948ea..9f2dfe81b 100644
--- a/templates/lxc-centos.in
+++ b/templates/lxc-centos.in
@@ -424,6 +424,9 @@ download_centos()
     PKG_LIST="yum initscripts passwd rsyslog vim-minimal openssh-server 
openssh-clients dhclient chkconfig rootfiles policycoreutils cronie"
 
     # use temporary repository definition
+    # always prefer the repo given by the user
+    # if no repo given, use mirrorlist.centos.org for i386 and x86_64
+    # and http://mirror.centos.org/altarch/ otherwise
     REPO_FILE=$INSTALL_ROOT/etc/yum.repos.d/lxc-centos-temp.repo
     mkdir -p $(dirname $REPO_FILE)
     if [ -n "$repo" ]; then
@@ -432,7 +435,7 @@ download_centos()
 name=local repository
 baseurl="$repo"
 EOF
-else
+    elif [ ${basearch} = 'i386' ] || [ ${basearch} = 'x86_64' ]; then
        cat <<EOF > $REPO_FILE
 [base]
 name=CentOS-$release - Base
@@ -442,6 +445,15 @@ 
mirrorlist=http://mirrorlist.centos.org/?release=$release&arch=$basearch&repo=os
 name=CentOS-$release - Updates
 
mirrorlist=http://mirrorlist.centos.org/?release=$release&arch=$basearch&repo=updates
 EOF
+    else
+[base]
+name=CentOS-$release - Base
+baseurl=http://mirror.centos.org/altarch/7/os/$basearch/
+
+[updates]
+name=CentOS-$release - Updates
+baseurl=http://mirror.centos.org/altarch/7/updates/$basearch/
+EOF
     fi
 
     # create minimal device nodes, needed for "yum install" and "yum update" 
process
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to