Try to autorun an application at the bootup

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Try to autorun an application at the bootup

404 Views
andyfung
Contributor I

Hello,

I am using the iMX6UL on ConnectCore. I am trying to create a service file that able to autorun the application on Linux. 

Added the following script in the .bb file:

inherit systemd
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE_${PN} = "apix-gpio-example-custom.service"

SRC_URI_append += " file://apix-gpio-example-custom.service "
FILES_${PN} += "\${systemd_unitdir}/system/apix-gpio-example-custom.service"

do_install_append() {
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/apix-gpio-example-custom.service ${D}${systemd_unitdir}/system
}

REQIORED_DISTRO_FEATURES="systemd"

In the service file, added the following scripts:

[Unit]
Description=apio-gpio-example-custom service file
After=multi-user.target
[Service]
ExecStart=/usr/bin/apix-gpio-example-custom
Restart=always
[Install]
WantedBy=multi-user.target

 

I bitbake the image without any error. After deploying the image, the application doesn't start. And there is no such a directory of ${systemd_unitdir}/system.

Did I install the service file to the incorrect path? Do I need to create the system directory?

Could you give me any advice regarding this?

Thanks

Andy 

 

 

Labels (1)
Tags (1)
0 Kudos
2 Replies

386 Views
andyfung
Contributor I

Found out the DEY doesn't support systemd. So I need to create a startup script in /etc/init.s with symlink to /etc/rc.d.

Created the following .bbappend in the same directory as image .bb:

FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"

SRC_URI += " \
file://vektrex.sh \
"
do_install_append() {
# The extra files need to go in the respective directories
install -m 0755 ${WORKDIR}/vektrex.sh ${D}${sysconfdir}/init.d
# Create the symbolic links
update-rc.d -r ${D} vektrex.sh start 03 S
}

 

Looks like the installation path is not correct. Can you provide some suggestions? 

ERROR: cert-tools-1.0-r0 do_install: Execution of '/home/andyfung/workspace/ccimx6ulsbc/tmp/work/cortexa7t2hf-neon-dey-linux-gnueabi/cert-tools/1.0-r0/temp/run.do_install.6294' failed with exit code 1:
install: cannot create regular file '/home/andyfung/workspace/ccimx6ulsbc/tmp/work/cortexa7t2hf-neon-dey-linux-gnueabi/cert-tools/1.0-r0/image/etc/init.d': No such file or directory

 
 
0 Kudos

390 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Did you append this package into local.conf?

0 Kudos