Rootfs/packages folder does not exist, build fail imx8mp

Hi Community,

My bitbake build failed at the last step with the following error Logs, which mentioned the “…/rootfs/packages/” folder is missing during “update_mime_database”. Any idea to solve it?

My build is under Ubuntu 20.04 :

verdin_imx8mp-tdx-linux/tdx-reference-minimal-image/1.0-r0

My build/bitbake command:

repo init -u https://git.toradex.com/toradex-manifest.git -b dunfell-5.x.y -m tdxref/default.xml
bitbake tdx-reference-minimal-image

As I checked the “rootfs” folder, there is no/missing “packages” inside:

builder@jeffreyx:/dockervolume/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/tdx-reference-minimal-image/1.0-r0/rootfs$ ls
bin  boot  dev  etc  home  lib  media  mnt  proc  run  sbin  sys  tmp  usr  var

Error Logs:


Configuring connman-client.
Configuring run-postinsts.
Configuring udev-extraconf.

NOTE: Running [‘oe-pkgdata-util’, ‘-p’, ‘/dockervolume/oe-core/build/tmp/pkgdata/verdin-imx8mp’, ‘glob’, ‘/tmp/installed-pkgssovs1n53’, ’ *-locale-en *-locale-en-us’]
NOTE: Installing complementary packages … (skipped already provided packages )
NOTE: /dockervolume/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/tdx-reference-minimal-image/1.0-r0/recipe-sysroot-native/usr/bin/opkg --volatile-cache -f /dockervolume/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/tdx-reference-minimal-image/1.0-r0/opkg.conf -t /dockervolume/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/tdx-reference-minimal-image/1.0-r0/temp/ipktemp/ -o /dockervolume/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/tdx-reference-minimal-image/1.0-r0/rootfs --force_postinstall --prefer-arch-to-version --force-depends remove glibc-binary-localedata-en-us
NOTE: Removing glibc-binary-localedata-en-us (2.31) from root…

NOTE: Running intercept scripts:
NOTE: > Executing update_mime_database intercept …
NOTE: Exit code 1. Output:
Updating MIME database… this may take a while.
Directory ‘/dockervolume/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/tdx-reference-minimal-image/1.0-r0/rootfs/packages’ does not exist!

ERROR: The postinstall intercept hook ‘update_mime_database’ failed, details in /dockervolume/oe-core/build/tmp/work/verdin_imx8mp-tdx-linux/tdx-reference-minimal-image/1.0-r0/temp/log.do_rootfs
DEBUG: Python function do_rootfs finished

I found a solution: Copy codes from “mime.bbclass” to “update_mime_database”.

In the file “layers/openembedded-core/meta/classes/mime.bbclass”, someone left a workaround note:

        # $D${MIMEDIR}/packages belong to package shared-mime-info-data,
        # packages like libfm-mime depend on shared-mime-info-data.
        # after shared-mime-info-data uninstalled, $D${MIMEDIR}/packages
        # is removed, but update-mime-database need this dir to update
        # database, workaround to create one and remove it later
        if [ ! -d $D${MIMEDIR}/packages ]; then
                mkdir -p $D${MIMEDIR}/packages
                update-mime-database $D${MIMEDIR}
                rmdir --ignore-fail-on-non-empty $D${MIMEDIR}/packages
        else
                update-mime-database $D${MIMEDIR}

So copy this whole segment to the file “layers/openembedded-core/scripts/postinst-intercepts/update_mime_database” , and replace the capital MIMEDIR to lower case mimedir

Problem solved.