BuildSystem: image sh

mount in build dir

Signed-off-by: Sinipelto <sinipelto@noreply.bananymous.com>
This commit is contained in:
Sinipelto 2023-11-20 14:12:35 +02:00
parent 6cfa56dcec
commit d72db1f81c
1 changed files with 9 additions and 4 deletions

View File

@ -10,15 +10,20 @@ if [[ -z $BANAN_SYSROOT_TAR ]]; then
exit 1 exit 1
fi fi
if [[ -z $BANAN_BUILD_DIR ]]; then
echo "You must set the BANAN_BUILD_DIR environment variable" >&2
exit 1
fi
if [[ "$1" == "full" ]] || [[ ! -f $BANAN_DISK_IMAGE_PATH ]]; then if [[ "$1" == "full" ]] || [[ ! -f $BANAN_DISK_IMAGE_PATH ]]; then
$BANAN_SCRIPT_DIR/image-create.sh $BANAN_SCRIPT_DIR/image-create.sh
fi fi
LOOP_DEV=$(sudo losetup --show -f "$BANAN_DISK_IMAGE_PATH") LOOP_DEV="$(sudo losetup --show -f $BANAN_DISK_IMAGE_PATH)"
sudo partprobe $LOOP_DEV sudo partprobe $LOOP_DEV
ROOT_PARTITION=${LOOP_DEV}p2 ROOT_PARTITION="${LOOP_DEV}p2"
MOUNT_DIR="${MOUNT_DIR:-/bananmnt}" MOUNT_DIR="${MOUNT_DIR:-$BANAN_BUILD_DIR/bananmnt}"
sudo mkdir -p $MOUNT_DIR || { echo "Failed to create mount point dir."; exit 1; } sudo mkdir -p $MOUNT_DIR || { echo "Failed to create mount point dir."; exit 1; }
@ -32,4 +37,4 @@ sudo umount $MOUNT_DIR || { echo "Failed to unmount banan mount."; exit 1; }
sudo losetup -d $LOOP_DEV || { echo "Failed to remove loop device for banan mount."; exit 1; } sudo losetup -d $LOOP_DEV || { echo "Failed to remove loop device for banan mount."; exit 1; }
sudo rm -rf $MOUNT_DIR sudo rm -rf "$MOUNT_DIR"