Navigation Menu

Skip to content

Commit

Permalink
Add Ubuntu 18.04 support
Browse files Browse the repository at this point in the history
Use squashfs for more recent Ubuntu releases

Change-Id: I80df28be6e2a5e03ae1450e84fc05715f21a7750
Closes-bug: 1766850
  • Loading branch information
stamak authored and ianw committed May 18, 2018
1 parent a8df61e commit 2e6a19a
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 6 deletions.
Expand Up @@ -23,6 +23,7 @@ release_numbers[wily]=15.10
release_numbers[xenial]=16.04
release_numbers[yakkety]=16.10
release_numbers[zesty]=17.04
release_numbers[bionic]=18.04

numeric_release=${release_numbers[$DIB_RELEASE]}
DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cdimage.ubuntu.com/ubuntu-core/releases/$numeric_release/release}
Expand Down
12 changes: 10 additions & 2 deletions diskimage_builder/elements/ubuntu/root.d/10-cache-ubuntu-tarball
Expand Up @@ -14,7 +14,11 @@ shopt -s extglob

DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cloud-images.ubuntu.com}
DIB_RELEASE=${DIB_RELEASE:-trusty}
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH-root.tar.gz}
if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH.squashfs}
else
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$DIB_RELEASE-server-cloudimg-$ARCH-root.tar.gz}
fi
SHA256SUMS=${SHA256SUMS:-https://${DIB_CLOUD_IMAGES##http?(s)://}/$DIB_RELEASE/current/SHA256SUMS}
CACHED_FILE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE
CACHED_FILE_LOCK=$DIB_LOCKFILES/$BASE_IMAGE_FILE.lock
Expand Down Expand Up @@ -47,7 +51,11 @@ function get_ubuntu_tarball() {
fi
# Extract the base image (use --numeric-owner to avoid UID/GID mismatch between
# image tarball and host OS e.g. when building Ubuntu image on an openSUSE host)
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE
if [ $DIB_RELEASE != "trusty" ] && [ $DIB_RELEASE != "xenial" ]; then
sudo unsquashfs -f -d $TARGET_ROOT $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE
else
sudo tar -C $TARGET_ROOT --numeric-owner -xzf $DIB_IMAGE_CACHE/$BASE_IMAGE_FILE
fi
}

(
Expand Down
@@ -0,0 +1,4 @@
Verify we can build a ubuntu image.

Note this test includes the vm element to test the bootloader install,
and specifies to output a .qcow2
@@ -0,0 +1,4 @@
block-device-mbr
openstack-ci-mirrors
vm

@@ -0,0 +1 @@
export DIB_RELEASE=bionic
@@ -0,0 +1 @@
tar,qcow2
Expand Up @@ -67,8 +67,8 @@
opensuse/build-succeeds \
opensuse/opensuse423-build-succeeds \
fedora/build-succeeds \
ubuntu/trusty-build-succeeds \
ubuntu/xenial-build-succeeds
ubuntu/xenial-build-succeeds \
ubuntu/bionic-build-succeeds
set +u
deactivate
Expand Down
4 changes: 2 additions & 2 deletions playbooks/legacy/dib-dsvm-functests-python3-image/run.yaml
Expand Up @@ -67,8 +67,8 @@
opensuse/build-succeeds \
opensuse/opensuse423-build-succeeds \
fedora/build-succeeds \
ubuntu/trusty-build-succeeds \
ubuntu/xenial-build-succeeds
ubuntu/xenial-build-succeeds \
ubuntu/bionic-build-succeeds
set +u
deactivate
Expand Down
1 change: 1 addition & 0 deletions tests/run_functests.sh
Expand Up @@ -44,6 +44,7 @@ DEFAULT_SKIP_TESTS=(
fedora/build-succeeds
ubuntu/trusty-build-succeeds
ubuntu/xenial-build-succeeds
ubuntu/bionic-build-succeeds

# No longer reasonable to test upstream (lacks a mirror in infra)
# Note this is centos6 and should probably be removed
Expand Down

0 comments on commit 2e6a19a

Please sign in to comment.