Skip to content

Instantly share code, notes, and snippets.

@fredldotme
Last active March 7, 2020 18:40
Show Gist options
  • Select an option

  • Save fredldotme/29b5176df53a16403559ae10bd8b5c8d to your computer and use it in GitHub Desktop.

Select an option

Save fredldotme/29b5176df53a16403559ae10bd8b5c8d to your computer and use it in GitHub Desktop.
Halium 7.1 Sparse Image Convert
#!/bin/bash
IMAGE_FILE="$1"
IMAGE_FILE_REAL="$1.real"
if [ ! -f "$IMAGE_FILE" ]; then
echo "File $IMAGE_FILE doesn't exist"
exit 1
fi
if [ -f "$IMAGE_FILE_REAL" ]; then
rm -f "$IMAGE_FILE_REAL"
fi
simg2img "$IMAGE_FILE" "$IMAGE_FILE_REAL"
e2fsck -fy "$IMAGE_FILE_REAL"
resize2fs -p -M "$IMAGE_FILE_REAL"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment