workaround build failure on AWS M6g instances (#449)
This commit is contained in:
parent
be8daaa721
commit
d1596451b9
2 changed files with 52 additions and 4 deletions
|
@ -39,8 +39,32 @@ 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..."
|
||||
cnt=0
|
||||
until BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}"); do
|
||||
if [ $cnt -lt 5 ]; then
|
||||
cnt=$((cnt + 1))
|
||||
echo "Error in losetup for BOOT_DEV. Retrying..."
|
||||
sleep 5
|
||||
else
|
||||
echo "ERROR: losetup for BOOT_DEV failed; exiting"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Mounting ROOT_DEV..."
|
||||
cnt=0
|
||||
until ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}"); do
|
||||
if [ $cnt -lt 5 ]; then
|
||||
cnt=$((cnt + 1))
|
||||
echo "Error in losetup for ROOT_DEV. Retrying..."
|
||||
sleep 5
|
||||
else
|
||||
echo "ERROR: losetup for ROOT_DEV failed; exiting"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH"
|
||||
echo "/: offset $ROOT_OFFSET, length $ROOT_LENGTH"
|
||||
|
||||
|
|
|
@ -16,8 +16,32 @@ 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..."
|
||||
cnt=0
|
||||
until BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}"); do
|
||||
if [ $cnt -lt 5 ]; then
|
||||
cnt=$((cnt + 1))
|
||||
echo "Error in losetup for BOOT_DEV. Retrying..."
|
||||
sleep 5
|
||||
else
|
||||
echo "ERROR: losetup for BOOT_DEV failed; exiting"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Mounting ROOT_DEV..."
|
||||
cnt=0
|
||||
until ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}"); do
|
||||
if [ $cnt -lt 5 ]; then
|
||||
cnt=$((cnt + 1))
|
||||
echo "Error in losetup for ROOT_DEV. Retrying..."
|
||||
sleep 5
|
||||
else
|
||||
echo "ERROR: losetup for ROOT_DEV failed; exiting"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH"
|
||||
echo "/: offset $ROOT_OFFSET, length $ROOT_LENGTH"
|
||||
|
||||
|
|
Reference in a new issue