cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
paul12345
Observer
Observer
418 Views
Registered: ‎07-14-2020

UG1144 Application Auto Run at Startup difficulty

Jump to solution

I am confused by the example in UG1144 "Application Auto Run at Startup" (page 94 onwards).

In step 3: Shouldn't DAEMON=/usr/bin/myapp instead of DAEMON=/usr/bin/myapp-init?

In step 2: Where is myapp-init being installed into /usr/bin? It appears myapp-init is only being installed into /etc/init.d/, not into /usr/bin/.

I just want to run a shell script at startup and it is taking all day to figure out the magic incantations to get bitbake to do what I want.

1 Solution

Accepted Solutions
paul12345
Observer
Observer
279 Views
Registered: ‎07-14-2020

Ok, after a whole day wasted on this, I think the problem is that UG1144 is outdated. For Petalinux 2020 section "Steps for Application Auto Run at Startup", Step (2) is incorrect. The myapp-init.bb recipe should look like the following; notice that Xilinx's documentation was missing INITSCRIPT_PACKAGES and also the last line FILES_${PN} is different. Their actual shell script (myapp-init.sh) is fine though. I also have it enabled in menus in user-rootfsconfig (CONFIG_myapp-init) and enabled in rootfs_config (CONFIG_myapp-init=y).

SUMMARY = "Installs /etc/init.d/myapp-init.sh and runs it at startup"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit update-rc.d
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME = "myapp-init.sh"
INITSCRIPT_PARAMS = "start 99 S ."

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

SRC_URI += " \
file://myapp-init.sh \
"

do_install() {
install -Dm 0755 ${WORKDIR}/myapp-init.sh ${D}${sysconfdir}/init.d/myapp-init.sh
}

FILES_${PN} = "${sysconfdir}/init.d/myapp-init.sh"

View solution in original post

0 Kudos
5 Replies
paul12345
Observer
Observer
403 Views
Registered: ‎07-14-2020

to be more specific, I get any number of errors related to my app not being found:

No module defaults found No match for argument: myapp Error: Unable to find a match

0 Kudos
paul12345
Observer
Observer
366 Views
Registered: ‎07-14-2020

My issue seems to be similar to this:

https://forums.xilinx.com/t5/Embedded-Linux/Autostart-startup-script-in-Petalinux-HowTo/td-p/1097087

I think UG1144 is outdated and the examples it shows do not actually work in Petalinux 2020.

0 Kudos
hokim
Scholar
Scholar
338 Views
Registered: ‎10-21-2015
0 Kudos
paul12345
Observer
Observer
292 Views
Registered: ‎07-14-2020

Thanks for that link; it is similar in that rootfs step is failing, but I am not doing two files in a single recipe. I did not have the the line

PACKAGES =+ "${PN}"

If I add it, however, then I get the warning "{myapp-init} is listed in PACKAGES multiple times, this leads to packaging errors"

I assume by setting this variable, the inherited script already adds it to PACKAGES, but it does so incorrectly:

INITSCRIPT_PACKAGES = "${PN}"

I am trying all 4 combinations of including or not including those lines, but still no luck.

 

0 Kudos
paul12345
Observer
Observer
280 Views
Registered: ‎07-14-2020

Ok, after a whole day wasted on this, I think the problem is that UG1144 is outdated. For Petalinux 2020 section "Steps for Application Auto Run at Startup", Step (2) is incorrect. The myapp-init.bb recipe should look like the following; notice that Xilinx's documentation was missing INITSCRIPT_PACKAGES and also the last line FILES_${PN} is different. Their actual shell script (myapp-init.sh) is fine though. I also have it enabled in menus in user-rootfsconfig (CONFIG_myapp-init) and enabled in rootfs_config (CONFIG_myapp-init=y).

SUMMARY = "Installs /etc/init.d/myapp-init.sh and runs it at startup"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit update-rc.d
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME = "myapp-init.sh"
INITSCRIPT_PARAMS = "start 99 S ."

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

SRC_URI += " \
file://myapp-init.sh \
"

do_install() {
install -Dm 0755 ${WORKDIR}/myapp-init.sh ${D}${sysconfdir}/init.d/myapp-init.sh
}

FILES_${PN} = "${sysconfdir}/init.d/myapp-init.sh"

View solution in original post

0 Kudos