Comment 10 for bug 1627402

Revision history for this message
Tom Luong (meetom) wrote :

This issue is probably related to this: https://bugs.launchpad.net/diskimage-builder/+bug/1659578

I'm able to build a Xenial image using DiB 2.2 but not without a few hacks. I got the same errors above until I did this following.

I added back the following codes which have been removed from here: https://github.com/openstack/diskimage-builder/commit/003fc17208e645b453ccb7c7ad27d332bdae490c

1. added the following codes back to diskimage_builder/elements/grub2/install.d/02-grub-install-spec
#!/bin/bash

if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
    set -x
fi
set -eu
set -o pipefail

# grub-efi-amd64-signed in ubuntu post will try to call grub-efi-amd64 to install grub into root
# device which definitely fail at this stage
# the workaround is to skip error and remove postinst script
if [[ "ubuntu" =~ "$DISTRO_NAME" ]]; then
    if ! install-packages grub-efi-amd64-signed; then
        rm -f /var/lib/dpkg/info/grub-efi-amd64-signed.postinst
        rm -f /var/lib/dpkg/info/grub-efi-amd64.postinst
    fi
    dpkg --configure grub-efi-amd64
    dpkg --configure grub-efi-amd64-signed
fi

2. added the following codes back to diskimage_builder/elements/grub2/pkg-map
  "distro":{
    "ubuntu":{
    "signed_grub_efi": "",
    "signed_shim_efi": "shim-signed",
    "grub_bios": "grub-pc-bin"
     }
   },

The Xenial build successfully but there seems to be an issue with cloud-init failing to initialize the hostname. The hostname of my bare metal node comes up at "Ubuntu."