mirror of
git://soft.sys114.com/odroid-stamper
synced 2025-12-19 00:18:42 +09:00
functions: improve to download base image tarball
Signed-off-by: Dongjin Kim <tobetter@gmail.com> Change-Id: Ia22288243e3bb85c35ddcbba7c80931ad6e80938
This commit is contained in:
19
functions
19
functions
@@ -671,6 +671,7 @@ do_custom_installer() {
|
||||
[ "x${url}" = "x" ] && panic "E: invalid URL - ${url}"
|
||||
|
||||
local cloudimage=${download_dir}/$(basename ${url})
|
||||
local pass_download_image=false
|
||||
|
||||
if [ -f ${cloudimage} ]; then
|
||||
local hash_bits=256
|
||||
@@ -691,14 +692,16 @@ do_custom_installer() {
|
||||
|
||||
local hash1=$(cat ${hashfile} | grep $(basename ${url})$ | awk '{print $1}')
|
||||
|
||||
if [ ${hash1} != ${hash2} ]; then
|
||||
#
|
||||
# Download official Cloud Image
|
||||
#
|
||||
echo "I: download official Cloud Image"
|
||||
wget ${url} -O ${cloudimage} \
|
||||
|| panic "failed to download cloudimage '${url}'"
|
||||
fi
|
||||
[ ${hash1} == ${hash2} ] && pass_download_image=true
|
||||
fi
|
||||
|
||||
if [ "x${pass_download_image}" == "xfalse" ]; then
|
||||
#
|
||||
# Download official Cloud Image
|
||||
#
|
||||
echo "I: download official Cloud Image"
|
||||
wget ${url} -O ${cloudimage} \
|
||||
|| panic "failed to download cloudimage '${url}'"
|
||||
fi
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user