OE4T / tegra-demo-distro

Reference/demonstration distro for meta-tegra
MIT License
73 stars 74 forks source link

failed to build custom distro with mender enabled #232

Closed hesmar closed 1 year ago

hesmar commented 1 year ago

Hi, I created a custom distro layer using the create-distro-layer script:

> ./scripts-setup/create-distro-layer -d my-mender -m

After that, I tried to build an image using this distro:

> . ./setup-env -m jetson-nano-devkit-emmc -d my-mender build-my-mender
> bitbake core-image-minimal

Bitbake gives me the following error:

NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
NOTE: Your conf/bblayers.conf has been automatically updated.
ERROR: Configuration has been re-parsed over 20 times, breaking out of the loop...
ERROR: Error parsing configuration files
Traceback (most recent call last):
  File "/home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/repos/poky/bitbake/lib/bb/cookerdata.py", line 281, in CookerDataBuilder.parseBaseConfiguration(worker=False):
                                      "breaking out of the loop...")
    >                    raise Exception("Too deep config re-parse loop. Check locations where "
                                         "BB_INVALIDCONF is being set (ConfigParsed event handlers)")
Exception: Too deep config re-parse loop. Check locations where BB_INVALIDCONF is being set (ConfigParsed event handlers)

If I create the distro without Mender (removing the -m argument), bitbake works fine. How can I make it work with Mender support enabled?

ichergui commented 1 year ago

Hello @hesmar

Please check you BBLAYERS_CONF_VERSION

dwalkes commented 1 year ago

Which branch? This sequence worked for me on dunfell.

hesmar commented 1 year ago

I am on kirkstone-l4t-r32.7.x.

@ichergui This is the bblayers.conf:

# Version of layers configuration, specific to
# each defined distro in the repository.
# Format: ${DISTRO}-<version>
TD_BBLAYERS_CONF_VERSION = "my-mender-7"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-tegra \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-tegra/contrib \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-oe \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-python \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-networking \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-filesystems \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-virtualization \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-tegra-community \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-mender-core \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-mender-tegra \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-tegra-support \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-demo-ci \
  /home/hesmar/Development/3dvisionlabs/embedded/yocto2/tegra-demo-distro/layers/meta-my-mender \
  "
dwalkes commented 1 year ago

I can reproduce.

I think the problem is at https://github.com/OE4T/tegra-demo-distro/blob/4f6b3291e07f51e94025348a8dfcc0ea924b03b6/scripts-setup/create-distro-layer#L79-L81 which is only appending to the distro.conf file but not updating REQUIRED_TD_BBLAYERS_CONF_VERSION. I'm not sure why it's doing the append as opposed to just copying the tegrademo-mender.conf from conf/distro/tegrademo-mender.conf as the distro default.

When I did that by hand using

cp layers/meta-tegrademo/conf/distro/tegrademo-mender.conf layers/meta-my-mender/conf/distro/my-mender.conf

I got past this error, then hit:

ERROR: ParseError at /home/dan/tegra-demo-distro/layers/meta-tegrademo/conf/distro/tegrademo.conf:34: Could not include required file conf/include/gstreamer-1.14.conf

Not sure where this is coming from - I see this file at

 find . -name "gstreamer-1.14.conf"
./repos/meta-tegra/contrib/conf/include/gstreamer-1.14.conf

and I see the corresponding layer in bblayers.conf

TD_BBLAYERS_CONF_VERSION = "my-mender-7"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /home/dan/tegra-demo-distro/layers/meta \
  /home/dan/tegra-demo-distro/layers/meta-tegra \
  /home/dan/tegra-demo-distro/layers/meta-tegra/contrib \

I removed the require conf/include/gstreamer-1.14.conf line and started the build, then added it back to attempt to reproduce but could not.

hesmar commented 1 year ago

Ok, it also helps to apply the following change in the layers/meta-my-mender/conf/distro/my-mender.conf after using the create-distro-layer script:

REQUIRED_TD_BBLAYERS_CONF_VERSION = "${DISTRO}-7"
ichergui commented 1 year ago

That was my suggestion :wink: earlier

ichergui commented 1 year ago

@dwalkes Any action from our side ? otherwise I will close this issue

madisongh commented 1 year ago

Sounds like the create-distro-layer script needs a fix.

ichergui commented 1 year ago

Okay I or @dwalkes will take it

dwalkes commented 1 year ago

I've got some hacks in https://github.com/OE4T/tegra-demo-distro/pull/233 which I think will fix it.

ichergui commented 1 year ago

Thanks @dwalkes

ichergui commented 1 year ago

I'm closing this issue since there is a fix already merged.