TonyParker
TonyParker

Reputation: 2484

Yocto: postinstall intercept hook "update_desktop_database" error

I am trying to build custom linux image using yocto. The set up is;

It gives this error

NOTE: Exit code 127. Output: /home/user234/yocto-project/image/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/intercept_scripts-1bf6a9721f164ba99b8a07325a9c3fe0f21a700fea55c8351519b59cf02d0aca/update_desktop_database: 7: update-desktop-database: not found

ERROR: The postinstall intercept hook 'update_desktop_database' failed, details in /home/user234/yocto-project/image/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_rootfs

The problem only occures in Virtual Machine Environment, It works fine with native linux environment on my other machine.

I have installed the desktop-file-utils and I can run from my shell manually. Somehow, bitbake is unable to detect it. Does someone know the solution?

Upvotes: 4

Views: 4501

Answers (4)

danieltakeshi
danieltakeshi

Reputation: 939

The error can be:

update_desktop_database: 7: update-desktop-database: not found

or:

update_desktop_database: 7: update-desktop-database: command not found

Package

The command update-desktop-database is found on the package extra/desktop-file-utils.

So you must install the package if it is not installed on your OS, otherwise the command is not found.

Permissions

Check the permissions of the files located at poky/scripts/postinst-intercepts.

Normally, postinst_intercept should have the permission 755 or -rwxr-xr-x. And the other files 644 or -rw-rw-r--.

Upvotes: 0

Hemant Kumar
Hemant Kumar

Reputation: 21

it seems like issue with some package on the host (libgdk-pixbuf) and happens when you are building in container. commenting line works but it worked on wsl and virtual box

i commented below 5 files under scripts/postinst-intercepts/ update_desktop_database , update_gio_module_cache, update_gtk_icon_cache , update_mime_database ,update_pixbuf_cache ,update_gtk_immodules_cache

but it may be more depending on your build

Upvotes: 1

Mahdi_Sh
Mahdi_Sh

Reputation: 11

You can resolve this issue immediately by patching poky sources to skip execution of "update_desktop_database" in this path:

poky/scripts/postinst-intercepts/update_desktop_database

Just comment the line.

It may happen again for other scripts. Just do the same for the other scripts. Finally, the do_rootfs task will complete successfully.

Upvotes: 1

fault-tolerant
fault-tolerant

Reputation: 531

I had a similar problem (without virtual machine, you will see that this part is unrelated). The issue is with file permissions of the Yocto sources, or part of them. In my particular case the DevOps have set the POSIX file permissions on the entire Yocto source directory to 777, i.e. -rwxrwxrwx. Don't ask me why.

In the OP's case it seems like the Yocto sources may have been copied to the virtual machine with a help of some permission-less file system, like FAT32, which results in the same outcome. A good example is copying the sources with a USB flash drive formatted with FAT32. YMMV, this may probably be relevant for ACLs as well, I haven't tried to fiddle with that.

In my opinion, this should be considered as a bug in bitbake. If the source files permissions can cause such an unpredictable behavior, they have to be verified before or during the build, and the user must be informed by generating an error.

This is clearly irrelevant to the OP by now, hope somebody finds it useful.

Upvotes: 4

Related Questions