Create a blank application component (auto enabled).
steve@Desktop:~/projects/zedboard_linux/os/petalinux$ petalinux-create --type apps --template install --name led-runner --enable
steve@Desktop:~/projects/zedboard_linux/os/petalinux$ cd ../..
Change the default source code to do something a little more obvious.
steve@Desktop:~/projects/zedboard_linux$ subl os/petalinux/project-spec/meta-user/recipes-apps/led-runner/files/led-runner
#!/bin/sh
poke 0x41200000 0x18
usleep 125000
poke 0x41200000 0x3C
usleep 125000
poke 0x41200000 0x7E
usleep 125000
poke 0x41200000 0xFF
usleep 125000
poke 0x41200000 0x7E
usleep 125000
poke 0x41200000 0x3C
usleep 125000
poke 0x41200000 0x18
usleep 125000
poke 0x41200000 0x00
Direct download available here :-
steve@Desktop:~/projects/zedboard_linux$ wget https://spacewire.co.uk/tutorial/shared/repos/0007/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/led-runner/files/led-runner -O os/petalinux/project-spec/meta-user/recipes-apps/led-runner/files/led-runner
Change the BitBake receipe to make it suitable for an auto-start application.
steve@Desktop:~/projects/zedboard_linux$ subl os/petalinux/project-spec/meta-user/recipes-apps/led-runner/led-runner.bb
#
# This file is the led-runner recipe.
#
SUMMARY = "Simple led-runner application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM ="file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://led-runner"
S = "${WORKDIR}"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
inherit update-rc.d
INITSCRIPT_NAME = "led-runner"
INITSCRIPT_PARAMS = "start 99 S ."
do_install() {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${S}/led-runner ${D}${sysconfdir}/init.d/led-runner
}
FILES_${PN} += "${sysconfdir}/*"
Direct download available here :-
steve@Desktop:~/projects/zedboard_linux$ wget https://spacewire.co.uk/tutorial/shared/repos/0007/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/led-runner/led-runner.bb -O os/petalinux/project-spec/meta-user/recipes-apps/led-runner/led-runner.bb