Remove old backup OS image before moving new OS image to reduce disk space requirements.
This commit is contained in:
parent
8b704ea70f
commit
4ee6e24687
3
src/init
3
src/init
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue