Skip to content

Commit

Permalink
resize after ready
Browse files Browse the repository at this point in the history
  • Loading branch information
salembream committed Jan 3, 2025
1 parent 3bc7d68 commit a4700a4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions mount_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ loopdev=$(losetup --find --show --partscan ${image})
echo "Created loopback device ${loopdev}"
echo "loopdev=${loopdev}" >> "$GITHUB_OUTPUT"

if [ ${additional_mb} -gt 0 ]; then
if ( (parted --script $loopdev print || false) | grep "Partition Table: gpt" > /dev/null); then
sgdisk -e "${loopdev}"
fi
parted --script "${loopdev}" resizepart ${rootpartition} 100%
e2fsck -p -f "${loopdev}p${rootpartition}"
resize2fs "${loopdev}p${rootpartition}"
echo "Finished resizing disk image."
fi

waitForFile() {
maxRetries=60
Expand Down Expand Up @@ -89,6 +80,16 @@ fi
rootdev=$(waitForFile "${loopdev}p${rootpartition}")


if [ ${additional_mb} -gt 0 ]; then
if ( (parted --script $loopdev print || false) | grep "Partition Table: gpt" > /dev/null); then
sgdisk -e "${loopdev}"
fi
parted --script "${loopdev}" resizepart ${rootpartition} 100%
e2fsck -p -f "${loopdev}p${rootpartition}"
resize2fs "${loopdev}p${rootpartition}"
echo "Finished resizing disk image."
fi

# Mount the image
mount=${RUNNER_TEMP:-/home/actions/temp}/arm-runner/mnt
mkdir -p ${mount}
Expand Down

0 comments on commit a4700a4

Please sign in to comment.