From: Laurent Vivier Date: Tue, 7 Apr 2015 19:17:37 +0000 (+0200) Subject: lxc-fedora: manage secondary architectures X-Git-Tag: lxc-1.1.3~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8721f7f43185208e0c1802ff2bc03108fd3e3204;p=thirdparty%2Flxc.git lxc-fedora: manage secondary architectures URL for packages and LiveOS differs from x86, x86_64 and ARM. This patch allows to select the good mirror URL according to the architecture. Primary architecture: http://mirrors.kernel.org/fedora Secondary architecture: http://mirrors.kernel.org/fedora-secondary The managed secondary architectures are only ppc64 and s390x, the secondary architectures for Fedora 20 (the base of initial bootstrap). Signed-off-by: Laurent Vivier Acked-by: Serge E. Hallyn --- diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in index 499685f3b..e33ba337e 100644 --- a/templates/lxc-fedora.in +++ b/templates/lxc-fedora.in @@ -586,7 +586,7 @@ Have a beer or a cup of coffee. This will take a bit (~300MB). # Right now, we are using Fedora 20 for the inial bootstrap. # We could make this the "current" Fedora rev (F > 15). - rsync -av mirrors.kernel.org::fedora/releases/20/Fedora/$basearch/os/LiveOS . + rsync -av ${mirrorurl}/releases/20/Fedora/$basearch/os/LiveOS . if [[ 0 == $? ]] then @@ -663,8 +663,8 @@ This will take a couple of minutes. Patience..." # of this LiveOS image we're camped out on. This is the beginning # of the butt ugly hack. Look close or you may missing it... - rsync -av mirrors.kernel.org::fedora/releases/20/Fedora/$basearch/os/Packages/r/rpm-[0-9]* \ - mirrors.kernel.org::fedora/releases/20/Fedora/$basearch/os/Packages/y/yum-[0-9]* . + rsync -av ${mirrorurl}/releases/20/Fedora/$basearch/os/Packages/r/rpm-[0-9]* \ + ${mirrorurl}/releases/20/Fedora/$basearch/os/Packages/y/yum-[0-9]* . # And here it is... # The --nodeps is STUPID but F15 had a bogus dependency on RawHide?!?! @@ -696,7 +696,7 @@ This will take a couple of minutes. Patience..." echo "Stage 1 creation complete. Building stage 2 Installation Bootstrap" mount -o bind ../bootstrap run/install - rsync -av mirrors.kernel.org::fedora/releases/20/Fedora/$basearch/os/Packages/f/fedora-release-20* . + rsync -av ${mirrorurl}/releases/20/Fedora/$basearch/os/Packages/f/fedora-release-20* . # The --nodeps is STUPID but F15 had a bogus dependency on RawHide?!?! chroot . rpm --root /run/install --nodeps -ivh fedora-release-* @@ -1232,7 +1232,6 @@ if [ ! -z "$clean" -a -z "$path" ]; then exit 0 fi - basearch=${arch} # Map a few architectures to their generic Fedora repository archs. # The two ARM archs are a bit of a guesstimate for the v5 and v6 @@ -1247,6 +1246,12 @@ armv6l|armv7l|armv8l) basearch=armhfp ;; *) ;; esac +mirrorurl="mirrors.kernel.org::fedora" +case "$basearch" in +ppc64|s390x) mirrorurl="mirrors.kernel.org::fedora-secondary" ;; +*) ;; +esac + # Somebody wants to specify an arch. This is very limited case. # i386/i586/i686 on i386/x86_64 # - or -