Work around Trusty ext4 metadata_csum errors on Bionic

As described inline, Bionic hosts will build invalid Trusty images.
Hack around this by disabling metadata_csum in the ext4 mkfs.

Change-Id: Ibd67d58ca830a9e60605d0700ee2b17906c804e6
This commit is contained in:
Ian Wienand 2019-12-11 11:50:00 +11:00
parent 4ca306cc0e
commit 801fa77a16
2 changed files with 20 additions and 2 deletions

View File

@ -14,7 +14,7 @@
- dib-nodepool-functional-openstack-centos-8-src
- dib-nodepool-functional-openstack-fedora-29-src
- dib-nodepool-functional-openstack-fedora-30-src
# - dib-nodepool-functional-openstack-ubuntu-trusty-src
- dib-nodepool-functional-openstack-ubuntu-trusty-src
- dib-nodepool-functional-openstack-ubuntu-xenial-src
- dib-nodepool-functional-openstack-ubuntu-bionic
- dib-nodepool-functional-openstack-ubuntu-bionic-src
@ -39,7 +39,7 @@
- dib-nodepool-functional-openstack-centos-8-src
- dib-nodepool-functional-openstack-fedora-29-src
- dib-nodepool-functional-openstack-fedora-30-src
# - dib-nodepool-functional-openstack-ubuntu-trusty-src
- dib-nodepool-functional-openstack-ubuntu-trusty-src
- dib-nodepool-functional-openstack-ubuntu-xenial-src
- dib-nodepool-functional-openstack-ubuntu-bionic
- dib-nodepool-functional-openstack-ubuntu-bionic-src

View File

@ -440,6 +440,24 @@ if [ "$DIB_ROOT_FSTYPE" = "ext4" ] ; then
# We set journal size to 64M so our journal is large enough when we
# perform an FS resize.
MKFS_OPTS="-i 4096 -J size=$journal_size $MKFS_OPTS"
# NOTE(ianw) 2019-12-11 : this is a terrible hack ... if building on
# >=Bionic hosts, mkfs sets "metadata_csum" for ext4 filesystems,
# which makes broken Trusty images as that era fsck doesn't
# understand this flag. The image will stop in early boot
# complaining:
#
# Serious errors were found while checking the disk drive for /.
#
# We do not really have any suitable hook points where one of the
# ubuntu elements or block-device-* could set this override flag for
# just Trusty. We probably should, but desire to implement more
# code to support the out-of-date trusty at this point is
# non-existant. So hack in disabling this here.
if [[ ${DIB_RELEASE} == "trusty" ]]; then
MKFS_OPTS="-O ^metadata_csum $MKFS_OPTS"
fi
# Grow the image size to account for the journal, only if the user
# has not asked for a specific size.
if [ -z "$DIB_IMAGE_SIZE" ]; then