From 55b352367cab1e234f5c0d1bd450fbb735a37eaf Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Mon, 12 Dec 2011 09:18:15 +0800 Subject: [PATCH] reflash_ben.sh, unnecessary re-download of .ubi.bz2 rootfs thanks to EdorFaus Signed-off-by: Xiangfu Liu --- nanonote-files/data/qi_lb60/scripts/reflash_ben.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nanonote-files/data/qi_lb60/scripts/reflash_ben.sh b/nanonote-files/data/qi_lb60/scripts/reflash_ben.sh index 06731f3..daf5d3b 100755 --- a/nanonote-files/data/qi_lb60/scripts/reflash_ben.sh +++ b/nanonote-files/data/qi_lb60/scripts/reflash_ben.sh @@ -1,6 +1,6 @@ #!/bin/bash # version of me -__VERSION__="2011-11-11" +__VERSION__="2011-12-12" # use 'http' to download and flash images, use 'file' to flash images present in the PROTOCOL="http" @@ -172,6 +172,11 @@ if [ "$PROTOCOL" == "http" ]; then MD5SUMS_SERVER=$(wget -O - ${BASE_URL_HTTP}/${VERSION}/md5sums 2> /dev/null | grep -E "(${LOADER}|${KERNEL}|${ROOTFS})" | sort) [ "${MD5SUMS_SERVER}" ] || abort "can't fetch files from server" + if [ ! -f "${WORKING_DIR}/${ROOTFS}" ] && [ -f "${WORKING_DIR}/${ROOTFS}.bz2" ] ; then + log "found .ubi.bz2 rootfs, decompressing to .ubi ..." + (cd "${WORKING_DIR}"; bzip2 -d "${ROOTFS}.bz2") + fi + MD5SUMS_LOCAL=$( (cd "${WORKING_DIR}" ; md5sum --binary "${LOADER}" "${KERNEL}" "${ROOTFS}" 2> /dev/null) | sort ) if [ "${MD5SUMS_SERVER}" == "${MD5SUMS_LOCAL}" ]; then @@ -254,7 +259,3 @@ if [ "$ALL" == "TRUE" ]; then fi log "done" - -########## ChangeLog ############### -### 2011-06-07 - # using -O in wget