Bug 15313

Summary: Custom recipes not working
Product: [Build System, Metadata & Runtime] OE-Core Reporter: lucio.liu <lucio.liux>
Component: oe-core otherAssignee: Unassigned <unassigned>
Status: CLOSED NOTABUG QA Contact:
Severity: normal    
Priority: Undecided CC: eddy.aubineau, randy.macleod
Version: unspecified   
Target Milestone: 0.0.0   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description lucio.liu 2023-12-08 07:32:01 UTC
When I create my own meta layer and add it to bblayers.conf for compilation, I found that the recipes in my own meta layer are not applied to the image after successful compilation. 
Initially, I attempted to add a system user in my custom recipes without success. Later, I also tried the recipes-skeleton/hello-single from meta-skeleton (placing recipes-skeleton under meta-example), but it was not successful either. Did I miss something?


My meta layer (meta-example) structure is as follows:

-poky
  + bitbake
  - build
    - bblayers.conf
    - local.conf
    - ...
  - meta-example
    - conf
      - layer.conf
    - recipes-core
      - images
        - core-image-user.bb
  + ...


My layer.conf

# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "meta-example"
BBFILE_PATTERN_meta-example = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-example = "6"

LAYERDEPENDS_meta-example = "core"
LAYERSERIES_COMPAT_meta-example = "nanbield"


My core-iamge-user.bb:

SUMMARY = "Root and user"
DESCRIPTION = "Recipe for root and user"
LICENSE = "MIT"

inherit image
IMAGE_INSTALL = "sudo"

inherit extrausers
EXTRA_USERS_PARAMS += "\
    useradd epiroc; \
    usermod -p '$(openssl passwd -6 Epiroc24680)' epiroc; \
    usermod -a -G wheel epiroc; \
    usermod -p '$(openssl passwd -6 lucio13570)' root \
    "

update_sudoers() {
    sed -i 's/# %sudo/%sudo/' ${IMAGE_ROOTFS}/etc/sudoers
}

ROOTFS_POSTPROCESS_COMMAND += "update_sudoers;"


It's quite strange that throughout the compilation process, there were no errors, and even when intentionally modifying my custom recipes (changing "inherit extausers" to "inherit extrauser"), an error is still reported. This indicates that the .bb files have been successfully loaded.
Comment 1 Eddy AUBINEAU 2023-12-09 10:00:05 UTC
Hi Lucio,

Since you added your own layer its contents is being parsed (that's why the format / typo errors are reported), but it doesn't mean that its contents will be added to your image.

There is no custom recipe being added to your image. You can use IMAGE_INSTALL:append = "custom-recipe" or something similar to add it.
Comment 2 Randy MacLeod 2023-12-14 15:34:26 UTC
This sort of thing is best discussed on the email list until there's an indication that there is actually a bug.
Comment 3 lucio.liu 2023-12-15 07:23:30 UTC
OK