Skip to content

Commit

Permalink
workaround build failure on AWS M6g instances
Browse files Browse the repository at this point in the history
  • Loading branch information
kdoren committed Sep 22, 2020
1 parent be8daaa commit 49cff38
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions export-image/prerun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,19 @@ BOOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^1:' | cut -d':' -f 4 | tr -d B)
ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^2:' | cut -d':' -f 2 | tr -d B)
ROOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^2:' | cut -d':' -f 4 | tr -d B)

BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}")
ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}")

echo "Mounting BOOT_DEV..."
until BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}"); do
echo "Error in losetup for BOOT_DEV. Retrying..."
sleep 5
done

echo "Mounting ROOT_DEV..."
until ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}"); do
echo "Error in losetup for ROOT_DEV. Retrying..."
sleep 5
done

echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH"
echo "/: offset $ROOT_OFFSET, length $ROOT_LENGTH"

Expand Down

0 comments on commit 49cff38

Please sign in to comment.