From 801fa77a1618f041896e095b087b34fe3ecf2f11 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 11 Dec 2019 11:50:00 +1100 Subject: [PATCH] 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 --- .zuul.d/project.yaml | 4 ++-- diskimage_builder/lib/disk-image-create | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.zuul.d/project.yaml b/.zuul.d/project.yaml index 304d361f..5a589600 100644 --- a/.zuul.d/project.yaml +++ b/.zuul.d/project.yaml @@ -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 diff --git a/diskimage_builder/lib/disk-image-create b/diskimage_builder/lib/disk-image-create index 1de310cb..a1333682 100644 --- a/diskimage_builder/lib/disk-image-create +++ b/diskimage_builder/lib/disk-image-create @@ -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