diff --git a/RaspberryMatic.adjusted.zip b/RaspberryMatic.adjusted.zip index ec5e43a..d77ec18 100644 --- a/RaspberryMatic.adjusted.zip +++ b/RaspberryMatic.adjusted.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c745bb688b1e22cc8adb057983df456397371d53d14dd4f83ebf5b0e76b939fc -size 205172546 +oid sha256:b97db9d972cca234cba9cf7a5cf82722071f7e6ef38f9f94613c025fda182233 +size 207776838 diff --git a/resize_image.sh b/resize_image.sh index b0a3531..88d1201 100755 --- a/resize_image.sh +++ b/resize_image.sh @@ -11,8 +11,16 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi -image_file="$1" -new_image_file="${1/\.img/\.adjusted\.img}" +image_file="$(realpath $1)" +new_image_file="${image_file/\.img/\.adjusted\.img}" + +if [[ ! $image_file =~ .*\.img ]]; then + echo "Not an image file: ${image_file}." 1>&2 + exit 1 +fi + +echo "image: ${image_file}" +echo "adjusted image: ${new_image_file}" echo "*** Creating new image file and partitions ***" dd if=/dev/zero of=$new_image_file bs=1M count=$((((${BOOT_SIZE}+${ROOT_SIZE}+${USR_LOCAL_SIZE})/1024/1024)+1))