Verified Commit 176d0bf8 authored by Frederik Enste's avatar Frederik Enste
Browse files

reverted back to bionic because of a grub2 bug in focal

parent 998d4c86
......@@ -4,10 +4,10 @@ set -x
EXEC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BUILD_DIR=".build"
URL_SUM="https://cloud-images.ubuntu.com/focal/current/SHA256SUMS"
URL_SUM="https://cloud-images.ubuntu.com/bionic/current/SHA256SUMS"
FILE_SUM="SHA256SUMS"
URL_IMG="https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img"
FILE_IMG="focal-server-cloudimg-amd64.img"
URL_IMG="https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img"
FILE_IMG="bionic-server-cloudimg-amd64.img"
# cleanup old build dir
if [[ -d "${BUILD_DIR}" ]]; then
......@@ -24,7 +24,7 @@ curl --location --output "${FILE_IMG}" "${URL_IMG}"
sha256sum --ignore-missing --check SHA256SUMS
# convert image if necessary
if [[ "`qemu-img info focal-server-cloudimg-amd64.img | grep -c 'file format: qcow2'`" -eq "1" ]]; then
if [[ "`qemu-img info ${FILE_IMG} | grep -c 'file format: qcow2'`" -eq "1" ]]; then
FILE_TEMP="`mktemp --dry-run`"
mv -v "${FILE_IMG}" "${FILE_TEMP}"
qemu-img convert -f qcow2 -O raw "${FILE_TEMP}" "${FILE_IMG}"
......@@ -33,8 +33,8 @@ fi
# mount image
MOUNT_ROOT="`mktemp --directory`"
SECTOR_SIZE="`sfdisk -d focal-server-cloudimg-amd64.img | grep -Eo 'sector-size: *[0-9]+' | grep -Eo '[0-9]+'`"
SECTOR_OFFSET="`sfdisk -d focal-server-cloudimg-amd64.img | grep -Eo '1 *: *start=[ 0-9]+,' | grep -Eo '= *[0-9]+' | grep -Eo '[0-9]+'`"
SECTOR_SIZE="`sfdisk -d ${FILE_IMG} | grep -Eo 'sector-size: *[0-9]+' | grep -Eo '[0-9]+'`"
SECTOR_OFFSET="`sfdisk -d ${FILE_IMG} | grep -Eo '1 *: *start=[ 0-9]+,' | grep -Eo '= *[0-9]+' | grep -Eo '[0-9]+'`"
OFFSET="`expr ${SECTOR_SIZE} \* ${SECTOR_OFFSET}`"
sudo mount -o "loop,offset=${OFFSET}" "${FILE_IMG}" "${MOUNT_ROOT}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment