Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

secure-core-image failed to build hddimg. (mismatch in grub-efi output name) #229

Open
qorinator opened this issue Nov 2, 2021 · 0 comments

Comments

@qorinator
Copy link

qorinator commented Nov 2, 2021

Hi

I encountered this issue while building secure-core-image with .hddimg output.

NOTE: Trying to install /home/xxx/dev/dcfast_ipc_image/image/poky/build/tmp/deploy/images/genericx86-64/bzImage as /home/xxx/dev/dcfast_ipc_image/image/poky/build/tmp/work/genericx86_64-poky-linux/secure-core-image/1.0-r0/secure-core-image-1.0/hddimg/bzImage
install: cannot stat '/home/xxx/dev/dcfast_ipc_image/image/poky/build/tmp/deploy/images/genericx86-64/grub-efi-bootx64.efi': No such file or directory

What I have noticed is that

  • in deploy dir, grub-efi-grubx64.efi exists instead of grub-efi-bootx64.efi
  • there is a difference between the naming of grubimage found in grub-efi-efi-secure-boot.inc and grub-efi_%.bb(currently using 2.06 version)
    # meta-secure-core/meta-efi-secure-boot/recipes-bsp/grub/grub-efi-efi-secure-boot.inc
    74:        grubimage = "grubx64.efi"
    76:        grubimage = "grubia32.efi"
    80:    d.setVar("GRUB_IMAGE", grubimage)
    
    # conf/image-uefi.conf
    21:EFI_BOOT_IMAGE ?= "boot${EFI_ARCH}.efi"
    
    # poky/meta/recipes-bsp/grub/grub-efi_2.06.bb
    20:    prefix = "" if d.getVar('EFI_PROVIDER') == "grub-efi" else "grub-efi-"
    35:    grubimage = prefix + d.getVar("EFI_BOOT_IMAGE")
    37:    d.setVar("GRUB_IMAGE", grubimage)              
    meta-secure-core causes the grubimage to end up with grub-efi-grubx64.efi instead of the grub-efi-bootx64.efi that is expected by grub-efi_2.06.bb

For building, I followed the instruction written in meta-secure-core/meta/README with a few tweaks.

poky: honister
meta-openembedded: honister
meta-securecore: master:5fcb2f0e67fa3f3607f65e317330cc8e045f1106

Am I missing some configuration in the local.conf ? or is this a bug ?

local.conf

MACHINE ?= "qemux86-64"
DISTRO ?= "poky"
SDKMACHINE ?= "x86_64"
TARGET_ARCH ?= "x86_64"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"
CONF_VERSION = "2"
IMAGE_FSTYPES += " hddimg"
ROOT_HOME ??= "/home/root"
MACHINE_forcevariable= "genericx86-64"
INITRAMFS_IMAGE = "secure-core-image-initramfs"
DISTRO_FEATURES_NATIVE:append = " systemd ima tpm2 efi-secure-boot luks"
DISTRO_FEATURES:append = " systemd ima tpm2 efi-secure-boot luks modsign"
MACHINE_FEATURES_NATIVE:append = " efi"
MACHINE_FEATURES:append = " efi"
PACKAGE_CLASSES = "package_rpm"
SECURE_CORE_IMAGE_EXTRA_INSTALL ?= "\
    packagegroup-efi-secure-boot \
    packagegroup-tpm2 \
    packagegroup-ima \
    packagegroup-luks \
"
DEBUG_FLAGS:forcevariable = ""
IMAGE_INSTALL:append = " kernel-image-bzimage"

build script

cd /path/to/poky
source oe-init-build-env
bitbake-layers add-layer \
  $SCRIPTPATH/meta-openembedded/meta-oe \
  $SCRIPTPATH/meta-openembedded/meta-perl \
  $SCRIPTPATH/meta-secure-core/meta \
  $SCRIPTPATH/meta-secure-core/meta-signing-key \
  $SCRIPTPATH/meta-secure-core/meta-efi-secure-boot \
  $SCRIPTPATH/meta-secure-core/meta-tpm2 \
  $SCRIPTPATH/meta-secure-core/meta-integrity \
  $SCRIPTPATH/meta-secure-core/meta-encrypted-storage
bitbake secure-core-image
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant