Commit 509140b0 by Reto Gantenbein

Various fixes for bootstrap image download via HTTPS

- Make sure mirror URL is queried for $FEDORA_RELEASE_DEFAULT - Fix image path for URLs queried via mirror list Signed-off-by: 's avatarReto Gantenbein <reto.gantenbein@linuxmonk.ch>
parent c898497d
...@@ -125,7 +125,7 @@ bootstrap_fedora() ...@@ -125,7 +125,7 @@ bootstrap_fedora()
fi fi
fi fi
echo "Setting up new Fedora ${FEDORA_RELEASE_DEFAULT} (${arch}) bootstrap environment." echo "Setting up new Fedora ${FEDORA_RELEASE_DEFAULT} (${basearch}) bootstrap environment."
[[ -d "${cache}" ]] || mkdir -p "${cache}" [[ -d "${cache}" ]] || mkdir -p "${cache}"
...@@ -137,29 +137,33 @@ bootstrap_fedora() ...@@ -137,29 +137,33 @@ bootstrap_fedora()
# download the LiveOS squashfs image # download the LiveOS squashfs image
if [ ! -f "${cache}/install.img" ] if [ ! -f "${cache}/install.img" ]
then then
local os_path="linux/releases/${FEDORA_RELEASE_DEFAULT}/Everything/${basearch}/os"
local image_path="/linux/releases/${FEDORA_RELEASE_DEFAULT}/Everything/${arch}/os/images/install.img" local image_path="images/install.img"
local ret=1 local ret=1
if [ -n "${rsync}" ] if [ -n "${rsync}" ]
then then
echo "Syncing LiveOS squashfs image from ${FEDORA_RSYNC_URL} ... " echo "Syncing LiveOS squashfs image from ${FEDORA_RSYNC_URL} ... "
rsync --archive --info=progress "${FEDORA_RSYNC_URL}${image_path}" . rsync --archive --info=progress "${FEDORA_RSYNC_URL}/${os_path}/${image_path}" .
ret=$? ret=$?
else else
if [ -z "${mirror}" ] if [ -z "${mirror}" ]
then then
get_mirrors "${basearch}" || return $? get_mirrors "${FEDORA_RELEASE_DEFAULT}" "${basearch}" || return $?
else
local mirror_url="${mirror}/${os_path}"
fi fi
for url in ${mirror:${mirror_urls}} for url in ${mirror:-${mirror_urls}}
do do
echo "Downloading LiveOS squashfs image from ${url} ... " echo "Downloading LiveOS squashfs image from ${url} ... "
if ! curl --silent --show-error --fail --remote-name "${mirror}${image_path}" curl --silent --show-error --fail --remote-name "${url}/${image_path}"
ret=$?
if [ ${ret} -ne 0 ]
then then
echo "Error: Image download failed."
continue continue
else
break
fi fi
ret=$?
done done
fi fi
...@@ -659,7 +663,8 @@ download_fedora() ...@@ -659,7 +663,8 @@ download_fedora()
# #
get_mirrors() get_mirrors()
{ {
local mirror_arch="${1}" local release="${1}"
local mirror_arch="${2}"
for trynumber in 1 2 3 4 for trynumber in 1 2 3 4
do do
...@@ -815,7 +820,7 @@ setup_repositories() ...@@ -815,7 +820,7 @@ setup_repositories()
# if no mirror given, get an appropriate mirror from the mirror list # if no mirror given, get an appropriate mirror from the mirror list
if [ -z "${mirror}" ] if [ -z "${mirror}" ]
then then
get_mirrors "${target_arch}" || return $? get_mirrors "${release}" "${target_arch}" || return $?
else else
# construct release-specific mirror url # construct release-specific mirror url
mirror="${mirror}/linux/releases/${release}/Everything/${target_arch}/os" mirror="${mirror}/linux/releases/${release}/Everything/${target_arch}/os"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment