cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Participant
Participant
1,902 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
Highlighted
Participant
Participant
1,783 Views
Registered: ‎10-22-2018

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

View solution in original post

0 Kudos
3 Replies
Highlighted
Voyager
Voyager
1,880 Views
Registered: ‎10-21-2015

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
Highlighted
Participant
Participant
1,872 Views
Registered: ‎10-22-2018

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
Highlighted
Participant
Participant
1,784 Views
Registered: ‎10-22-2018

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

View solution in original post

0 Kudos