Skip to content

Commit

Permalink
Remove old backup OS image before moving new OS image to reduce disk …
Browse files Browse the repository at this point in the history
…space requirements.
  • Loading branch information
jumperfly committed Nov 19, 2016
1 parent 95682c5 commit 103fecb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/init
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ if findfs $NEWIMG_DEVICE &> /dev/null; then
# Mount device containing current image RW and replace with updated image
echo "Detected a new OS image, copying to image partition..."
mount -t ext4 $IMG_DEVICE /mnt/img
if [[ -e /mnt/img/$OS_IMAGE-old ]]; then
rm -f /mnt/img/$OS_IMAGE-old
fi
mv -f /mnt/newimg/$OS_IMAGE /mnt/img/$OS_IMAGE-new
mv -f /mnt/img/$OS_IMAGE /mnt/img/$OS_IMAGE-old
mv /mnt/img/$OS_IMAGE-new /mnt/img/$OS_IMAGE
Expand Down

0 comments on commit 103fecb

Please sign in to comment.