Remi45
Remi45

Reputation: 41

how to execute automatically an application after petalinux boot

I have a prebuild application (AcqCamNoTemp.elf) I'd like to run when petalinux has finished to boot.

I had it to my petalinux with the command petalinux-create -t apps -n acqcam --enable

Then I have copied the AcqCamNoTemp.elf file into the acqcam/files directory

I have also modified the acqcam.bb file like this:

    #
# This file is the acqcam recipe.
#
 
SUMMARY = "Simple acqcam application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 
SRC_URI = "file://AcqCamNoTemp.elf \
          "
S = "${WORKDIR}"
 
do_install() {
         install -d ${D}${bindir}
         install -m 0755 AcqCamNoTemp.elf ${D}${bindir}
}


 

My petalinux is buiding and after boot I can see that AcqCamNoTemp.elf file is in the /usr/bin/ directory

Now I want this program to automatically run when boot is finished so I modify the acqcam.bb like this

 #
# This file is the acqcam recipe.
#
 
SUMMARY = "Simple acqcam application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 
SRC_URI = "file://AcqCamNoTemp.elf \
          "
 
S = "${WORKDIR}"
 
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
 
inherit update-rc.d
 
INITSCRIPT_NAME = "AcqCamNoTemp.elf"
 
INITSCRIPT_PARAMS = "Start 99 S ."
 
do_install() {
         install -d ${D}${sysconfdir}/init.d
         install -m 0755 AcqCamNoTemp.elf ${D}${sysconfdir}/init.d/AcqCamNoTemp.elf
}
#FILES_$ += "${sysconfdir}"
 

But when I build petalinux I have this error:

ERROR: Postinstall scriptlets of ['acqcam'] have failed. If the intention is to defer them to first boot,then please place them into pkg_postinst_ontarget_${PN} (). Deferring to first boot via 'exit 1' is no longer supported.

As I am a newbie to petalinux I don't understand this error. So if some body can help.

Upvotes: 0

Views: 217

Answers (0)

Related Questions