Vivado Petalinux版本:2018.3
1. 按照UG1144 -> Chapter 7 Customizing the Rootfs -> Including Prebuilt Applications建立mygpio,结果编译无法通过,解决方法
1. Create an application with the following command.
$ petalinux-create -t apps --template install --name myapp --enable
2. Change to the newly created application directory.
$ cd <plnx-proj-root>/project-spec/meta-user/recipes-apps/myapp/files/
3. Remove existing myapp app and copy the prebuilt myapp into myapp/files directory.
$ rm myapp
$ cp <path-to-prebuilt-app> ./
编译rootfs
cmd:petalinux-build -c rootfs
如下报错:
ERROR: mygpio-1.0-r0 do_package: QA Issue: File '/usr/bin/mygpio' from mygpio was already stripped, this will prevent future debugging! [already-stripped]
ERROR: mygpio-1.0-r0 do_package: Fatal QA errors found, failing task.
ERROR: mygpio-1.0-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /home/Kevin/petaprojects/xilinx-zc706-2018.3/build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/mygpio/1.0-r0/temp/log.do_package.50070
ERROR: Task (/home/Kevin/petaprojects/xilinx-zc706-2018.3/project-spec/meta-user/recipes-apps/mygpio/mygpio.bb:do_package) failed with exit code '1'
解决方法:
mygpio.bb 添加如下string
INSANE_SKIP_mygpio = "ldflags" //备注:mygpio为客户自己建立的app名称,在此example中为mygpio
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
完整的mygpio.bb 如下:
# This file is the mygpio recipe.
#
SUMMARY = "Simple mygpio application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://mygpio
"
S = "${WORKDIR}"
INSANE_SKIP_mygpio = "ldflags"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
do_install() {
install -d ${D}/${bindir}
install -m 0755 ${S}/mygpio ${D}/${bindir}
}
重新编译rootfs,通过了
cmd:petalinux-build -c rootfs
End