Skip to content

Commit

Permalink
overlay-backup: check for overlay partition
Browse files Browse the repository at this point in the history
  • Loading branch information
gtxaspec committed Sep 22, 2024
1 parent 102a1e5 commit c706484
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions package/thingino-devscripts/files/overlay-backup
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
BACKUP_VAR=overlay_backup
RESTORE_DIR=/overlay

overlay_check() {
grep -q upperdir=/overlay /proc/mounts || { echo "Overlay not mounted, exit"; exit; }
}

backup() {
overlay_check
# Calculate the free space in the U-Boot environment, rough estimate.
env_size=$(fw_printenv | wc -c)
total_size=$((64 * 1024))
Expand All @@ -27,6 +32,7 @@ backup() {
}

restore() {
overlay_check
# Get the base64-encoded tar.gz data from the environment variable '$BACKUP_VAR'
encoded_data=$(fw_printenv -n $BACKUP_VAR)

Expand Down

0 comments on commit c706484

Please sign in to comment.