only sync root fs when a new one is available

This commit is contained in:
Simon Bruder 2018-02-12 16:41:30 +00:00
parent c6f9589e20
commit 1f0f0bc064

View file

@ -115,9 +115,33 @@ aria2c --allow-overwrite --check-integrity --seed-time=0 --summary-interval=0 --
rm dht.dat
print_done
print_waiting "Extracting root filesystem image"
tar xzf rootfs.tar.gz
print_done
print_waiting "Comparing installed and remote image"
if [ -f /tmp_root/.build_uuid ];then
cd /tmp
tar xzf /tmp_root/rootfs.tar.gz .build_uuid
if [ $(cat .build_uuid) == $(cat /tmp_root/.build_uuid) ];then
sync=false
else
sync=true
print_done
print_waiting "Deleting old filesystem"
cd /tmp_root
rm -rf $(tar tzf rootfs.tar.gz|grep '^[^/]*/$' )
cd /tmp
print_done
fi
rm .build_uuid
cd /tmp_root
else
sync=true
print_done
fi
if [ $sync == "true" ];then
print_waiting "Extracting root filesystem image"
tar xzf rootfs.tar.gz
print_done
fi
##
# UNMOUNT TEMPORARY ROOTFS