summaryrefslogtreecommitdiffstats
path: root/remote/rootfs/rootfs-stage31/data/inc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'remote/rootfs/rootfs-stage31/data/inc/functions')
-rw-r--r--remote/rootfs/rootfs-stage31/data/inc/functions16
1 files changed, 16 insertions, 0 deletions
diff --git a/remote/rootfs/rootfs-stage31/data/inc/functions b/remote/rootfs/rootfs-stage31/data/inc/functions
index 5cc56dd7..b5d8f31d 100644
--- a/remote/rootfs/rootfs-stage31/data/inc/functions
+++ b/remote/rootfs/rootfs-stage31/data/inc/functions
@@ -43,7 +43,22 @@ download() {
local FILE_URL="$1"
local TARGET_PATH="$2"
+
+#Files from HD
+if [ "$HDD" = "yes" ]; then
+
+ cp /boot/$FILE_URL $TARGET_PATH
+ RET=$?
+ if [ "x$RET" != "x0" -o ! -e "$TARGET_PATH" ]; then
+ echo "Error - Copying '$FILE_URL' from HD failed. Exit Code: $RET"
+ usleep 50000 # 50ms
+ else
+ echo "Successfully copied '$FILE_URL' from HD."
+ return 0
+ fi
+
+else # Normal Download from server
# Shuffle server list
local SERVERS=$(for SERVER in $SLX_CONFIG_SERVERS $SLX_KCL_SERVERS; do echo "$RANDOM $SERVER"; done | sort -u | sed -r 's/^[0-9]+ //')
@@ -65,6 +80,7 @@ download() {
done
# Max retries reached, no success :-(
return 1
+fi
}
# Add benchmark event to var, including uptime as prefix