1
0
Fork 0

Use temporary directory to mount image to

This commit is contained in:
Braiden Vasco 2017-09-25 16:27:01 +00:00
parent d3e1b918de
commit 858cf0ecc8
3 changed files with 4 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,5 +1,4 @@
/deploy/
/mnt/
/rootfs/
.pc

View file

@ -55,6 +55,8 @@ if [ ! -d "$(dirname "$IMG_FILE")" ]; then
exit 1
fi
export MOUNT_DIR="$(mktemp --directory)"
##
# Prepare image file systems.
#
@ -134,3 +136,5 @@ umount "$MOUNT_DIR/boot/"
umount "$MOUNT_DIR"
zerofree -v "$ROOT_DEV"
unmount_image "$IMG_FILE"
rmdir "$MOUNT_DIR"

1
run
View file

@ -10,7 +10,6 @@ export PASSWORD='password'
export DEPLOY_DIR="$BASE_DIR/deploy"
export ROOTFS_DIR="$BASE_DIR/rootfs"
export MOUNT_DIR="$BASE_DIR/mnt"
export KEYS_DIR="$BASE_DIR/keys"
export FILES_DIR="$BASE_DIR/files"