AMD Milan Mender Integration fails

Hi,

I am working on creating a yocto distro using standard x86 hardware and an amd Ryzen processor.

Yocto Branch: scarthgap

local.conf:

MENDER_ARTIFACT_NAME = "gha_autobuild"
INHERIT += "mender-full"

MENDER_FEATURES_ENABLE:append = " mender-grub mender-image-uefi"
MENDER_FEATURES_DISABLE:append = " mender-uboot mender-image-sd"

MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT = "16384"
MENDER_STORAGE_DEVICE = "/dev/nvme0n1"

IMAGE_FSTYPES = "hddimg mender"

machine.conf: milan.conf « machine « conf « meta-amd-bsp - meta-amd - Layer containing AMD hardware support metadata

My aim is to use the hddimg to create an USB installer.

The build fails with a circular import:

ERROR: Task /workspaces/yocto-distros/build/../meta-distro/recipes-images/images/ap-image.bb:do_bootimg has circular dependency on /workspaces/yocto-distros/build/../meta-distro/recipes-images/images/ap-image.bb:do_image_uefiimg

The culprit:
https://git.yoctoproject.org/meta-amd/tree/meta-amd-bsp/conf/machine/common.conf?h=scarthgap#n14

The modified version of the common.conf:

IMAGE_FSTYPES = "wic wic.bmap iso"
WKS_FILES ?= "amd-usbimage.wks"

# Contents of IMAGE_BOOT_FILES are deployed into "amd-usbimage.wks" wic image
IMAGE_BOOT_FILES = " \
        ${EFIIMGDIR}${EFIDIR}/*;EFI/BOOT/ \
        ${EFIIMGDIR}/startup.nsh;startup.nsh \
        ${KERNEL_IMAGETYPE} \
        ${INITRD_IMAGE_LIVE}-${MACHINE}.cpio.gz;initrd \
        ${ROOTFS};rootfs.img \
"

# This makes sure that boot files are deployed before do_image_wic starts execution
# do_image_wic[depends] += "${IMAGE_BASENAME}:do_bootimg"

IMAGE_TYPEDEP_wic = "ext4"
INITRD_IMAGE_LIVE="core-image-minimal-initramfs"
LABELS_LIVE = "boot install"
EFI_PROVIDER = "grub-efi"
do_image_wic[depends] += "${INITRD_IMAGE_LIVE}:do_image_complete"
do_rootfs[depends] += "virtual/kernel:do_deploy"
IMAGE_BOOT_FILES:append = "\
      ${KERNEL_IMAGETYPE} \
      ${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.rootfs.ext4;rootfs.img \
      ${@bb.utils.contains('EFI_PROVIDER', 'grub-efi', 'grub-efi-bootx64.efi;EFI/BOOT/bootx64.efi', '', d)} \
      ${@bb.utils.contains('EFI_PROVIDER', 'grub-efi', '${IMAGE_ROOTFS}/boot/EFI/BOOT/grub.cfg;EFI/BOOT/grub.cfg', '', d)} \
      ${@bb.utils.contains('EFI_PROVIDER', 'systemd-boot', 'systemd-bootx64.efi;EFI/BOOT/bootx64.efi', '', d)} \
      ${@bb.utils.contains('EFI_PROVIDER', 'systemd-boot', '${IMAGE_ROOTFS}/boot/loader/loader.conf;loader/loader.conf ', '', d)} \
      ${@bb.utils.contains('EFI_PROVIDER', 'systemd-boot', '${IMAGE_ROOTFS}/boot/loader/entries/boot.conf;loader/entries/boot.conf', '', d)} "

INIT_MANAGER = "systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
MACHINE_FEATURES_NATIVE:append = " efi"
MACHINE_FEATURES:append = " efi"
MACHINE_FEATURES:append = " pcbios util-linux-blkid"
IMAGE_INSTALL:append = " grub grub-efi"
# Double import of grub-bootconf
# IMAGE_INSTALL:append = " grub grub-efi grub-bootconf"
CORE_IMAGE_EXTRA_INSTALL:append = " kernel-modules"

But now the folder EFI/BOOT/ folder is not populated and I get this error:

| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-core/glibc/cross-localedef-native_2.39.bb:do_populate_sysroot', '/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb:do_populate_sysroot', '/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb:do_populate_sysroot', '/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb:do_populate_sysroot', 'virtual:native:/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb:do_populate_sysroot', 'virtual:native:/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-devtools/dosfstools/dosfstools_4.2.bb:do_populate_sysroot', 'virtual:native:/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb:do_populate_sysroot', 'virtual:native:/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-devtools/mtools/mtools_4.0.43.bb:do_populate_sysroot', 'virtual:native:/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-devtools/opkg-utils/opkg-utils_0.6.3.bb:do_populate_sysroot', 'virtual:native:/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-devtools/opkg/opkg_0.6.3.bb:do_populate_sysroot', 'virtual:native:/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', 'virtual:native:/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-extended/pigz/pigz_2.8.bb:do_populate_sysroot', 'virtual:native:/workspaces/yocto-distros/build/../openembedded-core/meta/recipes-support/bmaptool/bmaptool_git.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['gettext-minimal-native', 'cross-localedef-native', 'ldconfig-native', 'systemd-systemctl-native', 'cmake-native', 'libtool-native', 'qemu-native', 'qemuwrapper-cross', 'texinfo-dummy-native', 'depmodwrapper-cross', 'openssl-native', 'coreutils-native', 'expat-native', 'gettext-native', 'glib-2.0-native', 'libxml2-native', 'ncurses-native', 'update-rc.d-native', 'util-linux-libuuid-native', 'util-linux-native', 'zlib-native', 'dosfstools-native', 'libedit-native', 'make-native', 'makedevs-native', 'mtools-native', 'opkg-utils-native', 'opkg-native', 'perl-native', 'pseudo-native', 'python3-build-native', 'python3-flit-core-native', 'python3-installer-native', 'python3-packaging-native', 'python3-pyproject-hooks-native', 'python3-setuptools-native', 'python3-six-native', 'python3-wheel-native', 'python3-native', 'bzip2-native', 'libarchive-native', 'libnsl2-native', 'libsolv-native', 'libtirpc-native', 'pigz-native', 'shadow-native', 'unzip-native', 'xz-native', 'zstd-native', 'freetype-native', 'mkfontscale-native', 'font-util-native', 'libfontenc-native', 'xorgproto-native', 'util-macros-native', 'kmod-native', 'libpng-native', 'acl-native', 'attr-native', 'bmaptool-native', 'debianutils-native', 'gdbm-native', 'itstool-native', 'libbsd-native', 'libcap-ng-native', 'libffi-native', 'libmd-native', 'libpcre2-native', 'shared-mime-info-native', 'sqlite3-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing python function set_image_size
| DEBUG: 1665144.000000 = 1280880 * 1.300000
| DEBUG: 8306688.000000 = max(1665144.000000, 8306688)[8306688.000000] + 0
| DEBUG: 8306688.000000 = int(8306688.000000)
| DEBUG: 8306688 = aligned(8306688)
| DEBUG: returning 8306688
| DEBUG: Python function set_image_size finished
| DEBUG: Executing shell function do_image_bootimg
| cp: cannot stat '/workspaces/yocto-distros/build/tmp-glibc/deploy/images/ap-milan//workspaces/yocto-distros/build/tmp-glibc/work/swan_ap_milan-oe-linux/ap-image/1.0/ap-image-1.0/efi_img/EFI/BOOT/*': No such file or directory

I actually only need the .mender and the .hddimg to create a bootable usb installer.

What would be the path forward ?

Thanks

Hi @Austriker,

That indeed sounds like not a lot of fun. :frowning:
Unfortunately I’m not very much experienced in x86 nor such an installer process. But I know that @annalenamarx and @moto-timo have done similar things at occasion. Maybe they can point you to some ideas?

Greetz,
Josef

Hi @TheYoctoJester

Any news regarding this issue ?

I have started from scratch the amd base image builds as expected. I have been inspecting the issue a bit more but it seems that it comes from this mender class meta-mender/meta-mender-core/classes/mender-part-images.bbclass at master · mendersoftware/meta-mender · GitHub

Here is the dependency chain:

{
    "tasks": [
        "do_patch",
        "do_populate_sysroot_setscene",
        "do_prepare_recipe_sysroot",
        "do_listtasks",
        "do_clean",
        "do_checkuri",
        "do_fetch",
        "do_unpack",
        "do_deploy_source_date_epoch_setscene",
        "do_deploy_source_date_epoch",
        "do_configure",
        "do_compile",
        "do_install",
        "do_build",
        "do_cleansstate",
        "do_cleanall",
        "do_recipe_qa",
        "do_recipe_qa_setscene",
        "do_devshell",
        "do_pydevshell",
        "do_populate_lic_setscene",
        "do_collect_spdx_deps",
        "do_create_spdx",
        "do_create_spdx_setscene",
        "do_create_runtime_spdx",
        "do_create_runtime_spdx_setscene",
        "do_populate_sdk_setscene",
        "do_populate_sdk",
        "do_rootfs",
        "do_image",
        "do_image_complete",
        "do_image_complete_setscene",
        "do_image_qa",
        "do_image_qa_setscene",
        "do_rootfs_wicenv",
        "do_populate_lic_deploy",
        "do_sdk_depends",
        "do_populate_sdk_ext",
        "do_bootimg",
        "do_flush_pseudodb",
        "do_image_wic",
        "do_image_ext4",
        "do_image_mender",
        "do_image_uefiimg",
        "do_image_dataimg",
        "do_image_bootstrap_artifact",
        "do_image_bootimg"
    ],
    "parents": {
        "do_patch": [
            "do_unpack"
        ],
        "do_populate_sysroot_setscene": [],
        "do_prepare_recipe_sysroot": [
            "do_fetch"
        ],
        "do_listtasks": [],
        "do_clean": [],
        "do_checkuri": [],
        "do_fetch": [
            "do_recipe_qa"
        ],
        "do_unpack": [
            "do_fetch"
        ],
        "do_deploy_source_date_epoch_setscene": [],
        "do_deploy_source_date_epoch": [
            "do_patch"
        ],
        "do_configure": [
            "do_deploy_source_date_epoch",
            "do_prepare_recipe_sysroot",
            "do_patch"
        ],
        "do_compile": [
            "do_configure"
        ],
        "do_install": [
            "do_compile"
        ],
        "do_build": [
            "do_populate_lic_deploy",
            "do_image_complete",
            "do_create_runtime_spdx",
            "do_create_spdx",
            "do_recipe_qa"
        ],
        "do_cleansstate": [
            "do_clean"
        ],
        "do_cleanall": [
            "do_cleansstate"
        ],
        "do_recipe_qa": [],
        "do_recipe_qa_setscene": [],
        "do_devshell": [
            "do_patch",
            "do_prepare_recipe_sysroot"
        ],
        "do_pydevshell": [
            "do_patch"
        ],
        "do_populate_lic_setscene": [],
        "do_collect_spdx_deps": [
            "do_unpack"
        ],
        "do_create_spdx": [
            "do_unpack",
            "do_collect_spdx_deps"
        ],
        "do_create_spdx_setscene": [],
        "do_create_runtime_spdx": [
            "do_create_spdx"
        ],
        "do_create_runtime_spdx_setscene": [],
        "do_populate_sdk_setscene": [],
        "do_populate_sdk": [
            "do_create_spdx"
        ],
        "do_rootfs": [
            "do_prepare_recipe_sysroot"
        ],
        "do_image": [
            "do_flush_pseudodb",
            "do_image_qa",
            "do_rootfs"
        ],
        "do_image_complete": [
            "do_image_bootimg",
            "do_image_bootstrap_artifact",
            "do_image_dataimg",
            "do_image_uefiimg",
            "do_image_mender",
            "do_image_ext4",
            "do_image_wic",
            "do_bootimg",
            "do_image"
        ],
        "do_image_complete_setscene": [],
        "do_image_qa": [
            "do_flush_pseudodb",
            "do_rootfs"
        ],
        "do_image_qa_setscene": [],
        "do_rootfs_wicenv": [
            "do_image"
        ],
        "do_populate_lic_deploy": [
            "do_image_complete"
        ],
        "do_sdk_depends": [],
        "do_populate_sdk_ext": [
            "do_sdk_depends"
        ],
        "do_bootimg": [
            "do_rootfs"
        ],
        "do_flush_pseudodb": [
            "do_rootfs"
        ],
        "do_image_wic": [
            "do_rootfs_wicenv",
            "do_image"
        ],
        "do_image_ext4": [
            "do_image"
        ],
        "do_image_mender": [
            "do_image",
            "do_image_ext4"
        ],
        "do_image_uefiimg": [
            "do_rootfs_wicenv",
            "do_image",
            "do_image_dataimg",
            "do_image_bootimg",
            "do_image_ext4"
        ],
        "do_image_dataimg": [
            "do_image",
            "do_image_bootstrap_artifact"
        ],
        "do_image_bootstrap_artifact": [
            "do_image",
            "do_image_ext4"
        ],
        "do_image_bootimg": [
            "do_image"
        ]
    },
    "mcdepends": {},
    "depends": {
        "do_patch": "quilt-native:do_populate_sysroot patch-replacement-native:do_populate_sysroot",
        "do_prepare_recipe_sysroot": " virtual/fakeroot-native:do_populate_sysroot",
        "do_install": " virtual/fakeroot-native:do_populate_sysroot",
        "do_build": " virtual/kernel:do_deploy",
        "do_devshell": " virtual/fakeroot-native:do_populate_sysroot",
        "do_collect_spdx_deps": " quilt-native:do_populate_sysroot patch-replacement-native:do_populate_sysroot",
        "do_create_spdx": " quilt-native:do_populate_sysroot patch-replacement-native:do_populate_sysroot",
        "do_populate_sdk": " virtual/fakeroot-native:do_populate_sysroot xz-native:do_populate_sysroot cross-localedef-native:do_populate_sysroot nativesdk-qemuwrapper-cross:do_populate_sysroot qemuwrapper-cross:do_populate_sysroot nativesdk-glibc-locale:do_populate_sysroot virtual/kernel:do_deploy makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ldconfig-native:do_populate_sysroot virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot     virtual/kernel:do_packagedata  opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot bmaptool-native:do_populate_sysroot pigz-native:do_populate_sysroot opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot",
        "do_rootfs": " virtual/kernel:do_deploy makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ldconfig-native:do_populate_sysroot virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot virtual/kernel:do_packagedata opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot bmaptool-native:do_populate_sysroot pigz-native:do_populate_sysroot",
        "do_image_complete": "",
        "do_sdk_depends": "ap-image:do_image_bootimg ap-image:do_image_bootstrap_artifact ap-image:do_image_dataimg ap-image:do_image_uefiimg ap-image:do_image_mender ap-image:do_image_ext4 ap-image:do_image_wic ap-image:do_bootimg ap-image:do_image virtual/kernel:do_deploy virtual/kernel:do_deploy makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ldconfig-native:do_populate_sysroot virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot virtual/kernel:do_packagedata opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot bmaptool-native:do_populate_sysroot pigz-native:do_populate_sysroot meta-extsdk-toolchain:do_populate_sysroot",
        "do_populate_sdk_ext": " virtual/fakeroot-native:do_populate_sysroot xz-native:do_populate_sysroot cross-localedef-native:do_populate_sysroot nativesdk-qemuwrapper-cross:do_populate_sysroot qemuwrapper-cross:do_populate_sysroot nativesdk-glibc-locale:do_populate_sysroot virtual/kernel:do_deploy makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ldconfig-native:do_populate_sysroot virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot     virtual/kernel:do_packagedata  opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot bmaptool-native:do_populate_sysroot pigz-native:do_populate_sysroot opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot buildtools-tarball:do_populate_sdk meta-extsdk-toolchain:do_locked_sigs",
        "do_bootimg": " dosfstools-native:do_populate_sysroot mtools-native:do_populate_sysroot cdrtools-native:do_populate_sysroot virtual/kernel:do_deploy syslinux:do_populate_sysroot syslinux-native:do_populate_sysroot ap-image:do_image_uefiimg syslinux:do_populate_sysroot syslinux-native:do_populate_sysroot core-image-minimal-initramfs:do_image_complete",
        "do_image_wic": " ap-image:do_bootimg core-image-minimal-initramfs:do_image_complete parted-native:do_populate_sysroot gptfdisk-native:do_populate_sysroot dosfstools-native:do_populate_sysroot mtools-native:do_populate_sysroot",
        "do_image_ext4": " e2fsprogs-native:do_populate_sysroot",
        "do_image_mender": " mender-artifact-native:do_populate_sysroot",
        "do_image_uefiimg": "ap-image:do_bootimg core-image-minimal-initramfs:do_image_complete parted-native:do_populate_sysroot gptfdisk-native:do_populate_sysroot dosfstools-native:do_populate_sysroot mtools-native:do_populate_sysroot coreutils-native:do_populate_sysroot wic-tools:do_populate_sysroot dosfstools-native:do_populate_sysroot mtools-native:do_populate_sysroot syslinux-native:do_populate_sysroot bmaptool-native:do_populate_sysroot cdrtools-native:do_populate_sysroot btrfs-tools-native:do_populate_sysroot squashfs-tools-native:do_populate_sysroot e2fsprogs-native:do_populate_sysroot erofs-utils-native:do_populate_sysroot virtual/x86_64-oe-linux-binutils:do_populate_sysroot syslinux:do_populate_sysroot grub-efi:do_populate_sysroot systemd-boot:do_populate_sysroot os-release:do_populate_sysroot gptfdisk-native:do_populate_sysroot",
        "do_image_dataimg": "   e2fsprogs-native:do_populate_sysroot ",
        "do_image_bootstrap_artifact": " mender-artifact-native:do_populate_sysroot",
        "do_image_bootimg": " dosfstools-native:do_populate_sysroot     mtools-native:do_populate_sysroot "
    },
    "rdepends": {
        "do_populate_sdk": "packagegroup-core-standalone-sdk-target:do_package_write_ipk packagegroup-core-standalone-sdk-target:do_packagedata target-sdk-provides-dummy:do_package_write_ipk target-sdk-provides-dummy:do_packagedata packagegroup-core-boot:do_package_write_ipk packagegroup-core-boot:do_packagedata packagegroup-base-extended:do_package_write_ipk packagegroup-base-extended:do_packagedata kernel-modules:do_package_write_ipk kernel-modules:do_packagedata grub:do_package_write_ipk grub:do_packagedata grub-efi:do_package_write_ipk grub-efi:do_packagedata mender-auth:do_package_write_ipk mender-auth:do_packagedata mender-update:do_package_write_ipk mender-update:do_packagedata less:do_package_write_ipk less:do_packagedata nvidia-container-toolkit:do_package_write_ipk nvidia-container-toolkit:do_packagedata procps:do_package_write_ipk procps:do_packagedata sshfs-fuse:do_package_write_ipk sshfs-fuse:do_packagedata systemd-analyze:do_package_write_ipk systemd-analyze:do_packagedata packagegroup-swan:do_package_write_ipk packagegroup-swan:do_packagedata docker:do_package_write_ipk docker:do_packagedata iptables:do_package_write_ipk iptables:do_packagedata fuse-overlayfs:do_package_write_ipk fuse-overlayfs:do_packagedata run-postinsts:do_package_write_ipk run-postinsts:do_packagedata packagegroup-core-ssh-openssh:do_package_write_ipk packagegroup-core-ssh-openssh:do_packagedata packagegroup-core-tools-debug:do_package_write_ipk packagegroup-core-tools-debug:do_packagedata nativesdk-packagegroup-sdk-host:do_package_write_ipk nativesdk-packagegroup-sdk-host:do_packagedata packagegroup-cross-canadian-ap-milan:do_package_write_ipk packagegroup-cross-canadian-ap-milan:do_packagedata",
        "do_sdk_depends": "meta-environment-extsdk-ap-milan:do_package_write_ipk meta-environment-extsdk-ap-milan:do_packagedata",
        "do_populate_sdk_ext": " ap-image:do_build"
    },
    "deptask": {
        "do_prepare_recipe_sysroot": "do_populate_sysroot",
        "do_collect_spdx_deps": "do_create_spdx",
        "do_image_wic": " do_image_complete"
    },
    "rdeptask": {
        "do_build": " do_package_write_ipk",
        "do_create_runtime_spdx": "do_create_spdx"
    },
    "recrdeptask": {
        "do_build": " do_deploy",
        "do_populate_sdk": " do_create_spdx do_create_runtime_spdx do_packagedata do_package_write_rpm do_package_write_ipk do_package_write_deb",
        "do_rootfs": " do_create_spdx do_create_runtime_spdx do_packagedata do_package_write_ipk do_package_qa do_populate_lic",
        "do_populate_lic_deploy": " do_populate_lic do_deploy",
        "do_sdk_depends": " do_create_spdx do_create_runtime_spdx do_packagedata do_package_write_rpm do_package_write_ipk do_package_write_deb do_populate_lic do_package_qa do_populate_sysroot do_deploy ",
        "do_image_wic": " do_deploy"
    },
    "recideptask": {},
    "nostamp": {
        "do_listtasks": "1",
        "do_clean": "1",
        "do_checkuri": "1",
        "do_cleansstate": "1",
        "do_cleanall": "1",
        "do_devshell": "1",
        "do_pydevshell": "1",
        "do_populate_sdk_ext": "1"
    },
    "fakeroot": {
        "do_install": "1",
        "do_populate_sdk": "1",
        "do_rootfs": "1",
        "do_image": "1",
        "do_image_complete": "1",
        "do_image_qa": "1",
        "do_populate_sdk_ext": "1",
        "do_image_wic": "1",
        "do_image_ext4": "1",
        "do_image_mender": "1",
        "do_image_uefiimg": "1",
        "do_image_dataimg": "1",
        "do_image_bootstrap_artifact": "1",
        "do_image_bootimg": "1"
    },
    "noexec": {
        "do_patch": "1",
        "do_fetch": "1",
        "do_unpack": "1",
        "do_configure": "1",
        "do_compile": "1",
        "do_install": "1",
        "do_build": "1"
    },
    "umask": {}
}

Cheers

Hi @Austriker,

Found time to look at this in more detail, and here are some thoughts/hints.

First, when building with the Mender integration, you almost certainly do not want something hddimg. I don’t know where this exactly comes from, but in any case you should use the .uefiimg which meta-mender provides, as it is exactly what you seem to want: an image to be put onto the SSD.

Second, the problem, at least to my early testing, is that this common.conf makes a lot of assumptions about the IMAGE_FSTYPES that you want, as it unconditionally adds wic wic.bmap iso, which again is not exactly meaningful in a Mender context.

So my stab at this is the following modified common.conf:

# we want to define IMAGE_FSTYPES ourselves
# IMAGE_FSTYPES = "wic wic.bmap iso"
WKS_FILES ?= "amd-usbimage.wks"

# Contents of IMAGE_BOOT_FILES are deployed into "amd-usbimage.wks" wic image
IMAGE_BOOT_FILES = " \
        ${EFIIMGDIR}${EFIDIR}/*;EFI/BOOT/ \
        ${EFIIMGDIR}/startup.nsh;startup.nsh \
        ${KERNEL_IMAGETYPE} \
        ${INITRD_IMAGE_LIVE}-${MACHINE}.cpio.gz;initrd \
        ${ROOTFS};rootfs.img \
"

# This makes sure that boot files are deployed before do_image_wic starts execution
# we disabled the wic type, so this doesn't make sense
# do_image_wic[depends] += "${IMAGE_BASENAME}:do_bootimg"


IMAGE_TYPEDEP_wic = "ext4"
INITRD_IMAGE_LIVE="core-image-minimal-initramfs"
LABELS_LIVE = "boot install"
EFI_PROVIDER = "grub-efi"
do_image_wic[depends] += "${INITRD_IMAGE_LIVE}:do_image_complete"
do_rootfs[depends] += "virtual/kernel:do_deploy"
IMAGE_BOOT_FILES:append = "\
      ${KERNEL_IMAGETYPE} \
      ${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.rootfs.ext4;rootfs.img \
      ${@bb.utils.contains('EFI_PROVIDER', 'grub-efi', 'grub-efi-bootx64.efi;EFI/BOOT/bootx64.efi', '', d)} \
      ${@bb.utils.contains('EFI_PROVIDER', 'grub-efi', '${IMAGE_ROOTFS}/boot/EFI/BOOT/grub.cfg;EFI/BOOT/grub.cfg', '', d)} \
      ${@bb.utils.contains('EFI_PROVIDER', 'systemd-boot', 'systemd-bootx64.efi;EFI/BOOT/bootx64.efi', '', d)} \
      ${@bb.utils.contains('EFI_PROVIDER', 'systemd-boot', '${IMAGE_ROOTFS}/boot/loader/loader.conf;loader/loader.conf ', '', d)} \
      ${@bb.utils.contains('EFI_PROVIDER', 'systemd-boot', '${IMAGE_ROOTFS}/boot/loader/entries/boot.conf;loader/entries/boot.conf', '', d)} "

INIT_MANAGER = "systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
MACHINE_FEATURES_NATIVE:append = " efi"
MACHINE_FEATURES:append = " efi"
MACHINE_FEATURES:append = " pcbios util-linux-blkid"
IMAGE_INSTALL:append = " grub grub-efi grub-bootconf"
CORE_IMAGE_EXTRA_INSTALL:append = " kernel-modules"

This seems to fix the circular dependency without additional magic, but I can’t judge right now if it builds (bitbake still running, and its late), or the resulting .uefiimg boots fine. Just from looking at it, I think it might also be necessary to comment the IMAGE_BOOT_FILES assignments out, but more testing on that tomorrow.

Greetz,
Josef

Hi @Austriker,

More digging, more news. The common.conf really sets a lot of opinionated stuff, most of it booting related and therefore conflicting with the Mender integration. Gave it an aggressive reduction now, as far as I can tell this is the only stuff that you should keep.

INIT_MANAGER = "systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"

MACHINE_FEATURES_NATIVE:append = " efi"
MACHINE_FEATURES:append = " efi"
MACHINE_FEATURES:append = " pcbios util-linux-blkid"

CORE_IMAGE_EXTRA_INSTALL:append = " kernel-modules"

Then it builds fine, and hopefully also boots - but that’s for you to find out once you put the .uefiimg onto storage. Please let me know how its going :slight_smile:

Greetz,
Josef