UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant mberemand
Participant
561 Views
Registered: ‎10-22-2018

File Format not Recognized when packaging user app

Jump to solution

I'm encountering an unhelpful error when trying to build my rootfs to include a very basic pre-compiled app. The bitbake recipe is as follows:

#
# This file is the Demo recipe.
#

SUMMARY = "Demo"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://Demo.HEX \
       file://Demo2.out \
       file://test.bin \
       file://Demo1.out \
          "

S = "${WORKDIR}"

do_install() {
         install -d ${D}/home/root/Demo
         install -m 0755 ${S}/*.out ${D}/home/root/Demo
         install -m 0644 ${S}/Demo.HEX ${D}/home/root/Demo
         install -m 0644 ${S}/test.bin ${D}/home/root/Demo
}

This recipe is incredibly simple so I'm not sure why it results in this error:

arm-xilinx-linux-gnueabi-objcopy:/home/common/peta_proj_2017.2_secure/build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/Demo/1.0-r0/package/home/root/Demo/Demo1.out: File format not recognized

 I tried removing the .out files from the recipe, but then I got an equally confusing error:

WARNING: Demo-1.0-r0 do_package: QA Issue: Demo: Files/directories were installed but not shipped in any package:
  /home
  /home/root
  /home/root/Demo
  /home/root/Demo/Demo.HEX
  /home/root/Demo/test.bin

I have no idea what could possibly be wrong, seeing as a very similar recipe works just fine:

#
# This file is the openssl-libs recipe.
#

SUMMARY = "openssl-libs"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://libcrypto.so.1.1 \
           file://libssl.so.1.1 \
		  "

S = "${WORKDIR}"

do_install() {
	     install -d ${D}/usr/lib
	     install -m 0755 ${S}/*.1.1 ${D}/usr/lib
}
Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Participant mberemand
Participant
442 Views
Registered: ‎10-22-2018

Re: File Format not Recognized when packaging user app

Jump to solution

So my understanding is that bitbake is trying to be helpful by stripping unneeded symbols from the binary, but runs into this problem because of it. In order to override this default behavior, I had to add

INHIBIT_PACKAGE_STRIP = 1

to the recipe.

https://stackoverflow.com/questions/53765087/file-format-not-recognized-when-building-petalinux-app

0 Kudos
3 Replies
Explorer
Explorer
539 Views
Registered: ‎10-21-2015

Re: File Format not Recognized when packaging user app

Jump to solution

Hi

First of all, don't use uppercase characters for recipe name(bb file)

demo recipe builds several packages as default.

demo-dbg, demo-staticdev, demo-dev, demo-doc, demo-locale, demo

You have to describe each installed file belongs to which package like this

PN variable means demo, demo package includes all installed files

#
# This file is the Demo recipe.
#

SUMMARY = "Demo"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://Demo.HEX \
       file://Demo2.out \
       file://test.bin \
       file://Demo1.out \
          "

S = "${WORKDIR}"

FILES_${PN} = "/home/root/Demo/*"

do_install() {
         install -d ${D}/home/root/Demo
         install -m 0755 ${S}/*.out ${D}/home/root/Demo
         install -m 0644 ${S}/Demo.HEX ${D}/home/root/Demo
         install -m 0644 ${S}/test.bin ${D}/home/root/Demo
}

 

0 Kudos
Participant mberemand
Participant
531 Views
Registered: ‎10-22-2018

Re: File Format not Recognized when packaging user app

Jump to solution

I recreated the app under an all-lowercase name and added the FILES_${PN} assignment but I'm still getting the same "File format not recognized" error on the .out files. Why is bitbake concerned with the files' formats in the first place? I'm not compiling anything, just placing them in the rootfs.

0 Kudos
Participant mberemand
Participant
443 Views
Registered: ‎10-22-2018

Re: File Format not Recognized when packaging user app

Jump to solution

So my understanding is that bitbake is trying to be helpful by stripping unneeded symbols from the binary, but runs into this problem because of it. In order to override this default behavior, I had to add

INHIBIT_PACKAGE_STRIP = 1

to the recipe.

https://stackoverflow.com/questions/53765087/file-format-not-recognized-when-building-petalinux-app

0 Kudos