Yocto build problem

Hello everyone!
I am new on yocto currently making build for analog devices board. Actually i am encountring an error rn. in my opt folder i want the extracted files but tar.xz folders are included i tried every way but all in vain. I am curious if anyone can help me in this regard.

Regards
Uroosa Iftikhar

Providing you the recipe file that is this:
SUMMARY = “Install multiple tar files into /opt”
LICENSE = “CLOSED”

FILESEXTRAPATHS:prepend := “${THISDIR}/files:”

Prevent Yocto from decompressing the files

SRC_URI = “file://minecraft-pi.tar.xz;unpack=0
file://pigpio.tar.xz;unpack=0
file://plustone.tar.xz;unpack=0
file://vc.tar.xz;unpack=0”

do_install() {
# Create the /opt directory in the final image
install -d ${D}/opt

# Install each tar file into the /opt directory with appropriate permissions
install -m 0777 ${WORKDIR}/minecraft-pi.tar.xz ${D}/opt/
install -m 0777 ${WORKDIR}/pigpio.tar.xz ${D}/opt/
install -m 0777 ${WORKDIR}/plustone.tar.xz ${D}/opt/
install -m 0777 ${WORKDIR}/vc.tar.xz ${D}/opt/

tar -zxvf minecraft-pi.tar.xz -C /opt/

}

Include all the /opt contents in the package

FILES:${PN} = “/opt/*”
and the error is this:
NOTE: Executing Tasks
ERROR: opt-1.0-r0 do_install: ExecutionError(‘/home/uroosa/yocto/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/opt/1.0/temp/run.do_install.684652’, 2, None, None)
ERROR: Logfile of failure stored in: /home/uroosa/yocto/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/opt/1.0/temp/log.do_install.684652
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are [‘/home/uroosa/yocto/sources/poky/meta/recipes-core/glibc/glibc_2.39.bb:do_populate_sysroot’, ‘/home/uroosa/yocto/sources/poky/meta/recipes-devtools/gcc/gcc-cross_13.3.bb:do_populate_sysroot’, ‘/home/uroosa/yocto/sources/poky/meta/recipes-devtools/gcc/gcc-runtime_13.3.bb:do_populate_sysroot’, ‘/home/uroosa/yocto/sources/poky/meta/recipes-devtools/quilt/quilt-native_0.67.bb:do_populate_sysroot’, ‘virtual:native:/home/uroosa/yocto/sources/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot’, ‘virtual:native:/home/uroosa/yocto/sources/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot’, ‘virtual:native:/home/uroosa/yocto/sources/poky/meta/recipes-extended/xz/xz_5.4.6.bb:do_populate_sysroot’]
| NOTE: Installed into sysroot:
| NOTE: Skipping as already exists in sysroot: [‘gettext-minimal-native’, ‘glibc’, ‘binutils-cross-arm’, ‘gcc-cross-arm’, ‘gcc-runtime’, ‘libgcc’, ‘libtool-native’, ‘m4-native’, ‘quilt-native’, ‘texinfo-dummy-native’, ‘linux-libc-headers’, ‘zlib-native’, ‘flex-native’, ‘gnu-config-native’, ‘patch-native’, ‘pseudo-native’, ‘xz-native’, ‘zstd-native’, ‘attr-native’, ‘gmp-native’, ‘libmpc-native’, ‘mpfr-native’, ‘sqlite3-native’]
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| tar (child): minecraft-pi.tar.xz: Cannot open: No such file or directory
| tar (child): Error is not recoverable: exiting now
| tar: Child returned status 2
| tar: Error is not recoverable: exiting now
| WARNING: exit code 2 from a shell command.
ERROR: Task (/home/uroosa/yocto/sources/meta-custom/recipes-support/opt/opt.bb:do_install) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 835 tasks of which 834 didn’t need to be rerun and 1 failed.

Summary: 1 task failed:
/home/uroosa/yocto/sources/meta-custom/recipes-support/opt/opt.bb:do_install
Summary: There was 1 WARNING message.
Summary: There was 1 ERROR message, returning a non-zero exit code.
uroosa@uroosa27:~/yocto/build$

i tried many ways but same issues i am encountring.

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Based on the context provided, it seems like the issue you’re encountering is related to the tar command not being able to find the minecraft-pi.tar.xz file during the do_install task. Here are a few suggestions to troubleshoot and potentially resolve the issue:

  1. Check File Paths: Ensure that the minecraft-pi.tar.xz file and other tar files are indeed present in the ${WORKDIR} directory. The error message indicates that the file cannot be found, which suggests it might not be in the expected location.

  2. Verify SRC_URI: Double-check the SRC_URI in your recipe to ensure that the paths to the tar files are correct and that they are being fetched and unpacked properly. The unpack=0 option is used to prevent automatic unpacking, so make sure the files are being copied correctly to the ${WORKDIR}.

  3. Debugging: Add some debug statements in the do_install function to print the contents of ${WORKDIR} before the tar command is executed. This can help verify whether the files are present at that point in the build process.

  4. Permissions: Ensure that the build process has the necessary permissions to read the files in ${WORKDIR} and write to the /opt directory.

  5. Log Files: Check the log file mentioned in the error message for more detailed information about the failure. The log file is located at /home/uroosa/yocto/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/opt/1.0/temp/log.do_install.684652.

If these steps do not resolve the issue, you may need to provide more specific details or context to further diagnose the problem.

Please, also check if these links can help you solve your problem:

Failing to adding files to rotfs.

Hi @uroosa !

Were you able to check the ToradexAI answer? As it said, the error | tar (child): minecraft-pi.tar.xz: Cannot open: No such file or directory means that the file could not be found, so maybe it is not where it should be.

Best regards.
Lucas Azeituno

I am really confused too bcz all the tar.xz folder are there

Hi @uroosa!

I saw that you tried to unzip the minecraft-pi.tar.xz in the /opt folder. However, since you didn’t use the cd command, you cannot be sure where the Yocto is located during the build, so tar -zxvf minecraft-pi.tar.xz -C /opt/ will not find the file.

To fix this. you could use a cd command to the /opt folder and unzip it, or you could unzip it before you copy to the /opt.

I haven’t tested it yet, but as far as I understand, using the following lines would work:

# Install each tar file into the /opt directory with appropriate permissions
tar -zxvf $(WORKDIR)/minecraft-pi.tar.xz -C ${D}/opt
tar -zxvf $(WORKDIR)/pigpio.tar.xz -C ${D}/opt
tar -zxvf $(WORKDIR)/plustone.tar.xz -C ${D}/opt
tar -zxvf $(WORKDIR)/vc.tar.xz -C ${D}/opt

Can you test it and give me feedback?

Best regards.
Lucas Azeituno

I did this too is there any way while we install we unzip too in it ?
btw i change my recipe to some extent and that issue is gone now i am encountering more errors related to QA. NOTE: Executing Tasks
ERROR: opt-1.0-r0 do_package_qa: QA Issue: /opt/minecraft-pi/lib/mesa/libbcm_host.so.1.0 contained in package opt requires libGLESv1_CM.so.1, but no providers found in RDEPENDS:opt? [file-rdeps]
ERROR: opt-1.0-r0 do_package_qa: QA Issue: /opt/minecraft-pi/minecraft-pi contained in package opt requires libpng12.so.0(PNG12_0), but no providers found in RDEPENDS:opt? [file-rdeps]
ERROR: opt-1.0-r0 do_package_qa: QA Issue: /opt/minecraft-pi/minecraft-pi contained in package opt requires libGLESv2.so, but no providers found in RDEPENDS:opt? [file-rdeps]
ERROR: opt-1.0-r0 do_package_qa: QA Issue: /opt/minecraft-pi/minecraft-pi contained in package opt requires libEGL.so, but no providers found in RDEPENDS:opt? [file-rdeps]
ERROR: opt-1.0-r0 do_package_qa: QA Issue: /opt/minecraft-pi/minecraft-pi contained in package opt requires libpng12.so.0, but no providers found in RDEPENDS:opt? [file-rdeps]
ERROR: opt-1.0-r0 do_package_qa: Fatal QA errors were found, failing task.
ERROR: Logfile of failure stored in: /home/uroosa/yocto/build/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/opt/1.0/temp/log.do_package_qa.20554
ERROR: Task (/home/uroosa/yocto/sources/meta-custom/recipes-support/opt/opt.bb:do_package_qa) failed with exit code ‘1’

Hi @uroosa!

I just realized that you are not using Toradex’s Hardware or Software. Did I misunderstand something?

I see you enjoy Toradex customer support, therefore I invite you to send an email to support@toradex.com and share some more details with us about your project and your company. Maybe we can show you how Toradex could accelerate and bring more value to your project.

On the other hand, if you still need help with your device, I would recommend getting in touch with your vendor or going to Yocto’s mailing list, since this community is focused on Toradex’s hardware and software (customer support).

Best regards.
Lucas Azeituno.

1 Like