cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
4,138 Views
Registered: ‎03-13-2014

Run a script at startup using Petalinux 2017.4

Jump to solution

Hi

 

I am migrating from Petalinux 2014.4  to 2017.4, target is a Zynq . One thing I have is a shell script that runs at startup. I followed the AR#55998 recommendations which work fine in 2014.4 but error during petalinux-build in 2017.4.

 

The make file (as per AR#55998)

 

 

APP = lstart.sh

pre-build:

post-build:

pre-install:

post-install:

all:

build:

clean:

.PHONY: install image

install:
$(TARGETINST) -d $(APP) /etc/init.d/$(APP)
$(TARGETINST) -s /etc/init.d/$(APP) /etc/rc5.d/S99$(APP)

 

 

 

The log file

 

DEBUG: Executing shell function do_install
install: cannot stat 'lstart': No such file or directory
WARNING: /home/dave/Projects/Lu250/build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/lstart/1.0-r0/temp/run.do_install.3288:1 exit 1 from 'install -m 0755 lstart /home/dave/Projects/Lu250/build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/lstart/1.0-r0/image/usr/bin'
ERROR: Function failed: do_install (log file is located at /home/dave/Projects/Lu250/build/tmp/work/cortexa9hf-neon-xilinx-linux-gnueabi/lstart/1.0-r0/temp/log.do_install.3288)

 

Can anyone help?

 

Thanks 

 

Dave

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
4,821 Views
Registered: ‎03-22-2016

There are some fairly major changes between 2014 and 2017 - to the point where your petalinux application is just not going to work at all. The entire build and package management system has changed.

 

Here's a post I wrote about how to run a custom script at boot time, which may help you:

 

https://forums.xilinx.com/t5/Embedded-Linux/Not-able-to-config-IP-and-other-configuations-over-Linux-OS-boot/m-p/830704#M24220

View solution in original post

6 Replies
Highlighted
Explorer
Explorer
4,822 Views
Registered: ‎03-22-2016

There are some fairly major changes between 2014 and 2017 - to the point where your petalinux application is just not going to work at all. The entire build and package management system has changed.

 

Here's a post I wrote about how to run a custom script at boot time, which may help you:

 

https://forums.xilinx.com/t5/Embedded-Linux/Not-able-to-config-IP-and-other-configuations-over-Linux-OS-boot/m-p/830704#M24220

View solution in original post

Highlighted
Explorer
Explorer
4,102 Views
Registered: ‎10-04-2017

Did you start with a working petalinux bsp for 17.4?  In 17.2 there is a recipe in meta-user/recipe-apps/startup that does exactly what you want.

 

jeff

 

 

 

#
# This file is the startup recipe.
#

SUMMARY = "Simple startup application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://startup.c \
       file://Makefile \
       file://startup.sh \
          "
INITSCRIPT_NAME = "startup"
INITSCRIPT_PARAMS = "defaults"

S = "${WORKDIR}"

inherit update-rc.d

do_compile() {
         oe_runmake
}

do_install() {
         install -d ${D}${bindir}
         install -m 0755 startup ${D}${bindir}
         install -d ${D}${sysconfdir}/init.d/
         install -m 0755 startup.sh ${D}${sysconfdir}/init.d/startup
}
Highlighted
Moderator
Moderator
4,095 Views
Registered: ‎04-24-2017

Hi @davewarren,

 

Refer UG1144 section "Application Auto Run at Startup" page 60.

 

Also refer the migration AR's https://www.xilinx.com/support/answers/68370.html https://www.xilinx.com/support/answers/68440.html

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Highlighted
Explorer
Explorer
4,067 Views
Registered: ‎03-13-2014

Jeff & Jeff & Sandeep,

 

Thanks all Yocto Petalinux is quite different from the original, I am weighing up as too using the simple or comprehensive startup script method. In any case I need to forget about makefiles and instead play with 'bit-baking' .

 

 

0 Kudos
Highlighted
Visitor
Visitor
3,679 Views
Registered: ‎01-04-2018

Hi,I am also having problem to auto run at startup.

I have followed 'Refer UG1144 section "Application Auto Run at Startup" page 60'

and the mystartup.sh file is not running automatically,although the  its appears in /etc/init.d/ folder  .

 

Any suggestion?

 

Thanks Ahead.

Avidan.

0 Kudos
Highlighted
Visitor
Visitor
3,432 Views
Registered: ‎07-10-2018

Hello, I do as ug1144, but it doesn't work! 

Help me, Thanks!

 

 

startUp.bb File

 

#
# This file is the startUp recipe.
#

SUMMARY = "Simple startUp application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://startUp \
"
S = "${WORKDIR}"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

inherit update-rc.d
INITSCRIPT_NAME = "startUp"
INITSCRIPT_PARAMS = "defaults"


do_install() {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${S}/startUp ${D}${sysconfdir}/init.d/startUp
}
FILES_${PN} +="${sysconfdir}/*"

 

startUp File:

#!/bin/sh

echo "Usage: give me a hello! Is't oK!"

 

boot contents

EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
Populating dev cache
random: dd: uninitialized urandom read (512 bytes read)
hwclock: can't open '/dev/misc/rtc': No such file or directory
Thu Aug 9 06:43:32 UTC 2018
hwclock: can't open '/dev/misc/rtc': No such file or directory
Starting internet superserver: inetd.
Running postinst /etc/rpm-postinsts/100-sysvinit-inittab...
update-rc.d: /etc/init.d/run-postinsts exists during rc.d purge (continuing)
Removing any system startup links for run-postinsts ...
/etc/rcS.d/S99run-postinsts
INIT: Entering runlevel: 5
Configuring network interfaces... IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
udhcpc (v1.24.1) started
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background
done.
Starting Dropbear SSH server: random: dropbearkey: uninitialized urandom read (32 bytes read)
Generating key, this may take a while...
random: dropbearkey: uninitialized urandom read (32 bytes read)
random: dropbearkey: uninitialized urandom read (32 bytes read)
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN/a3QXPDXWbG4bh4EAGi6tRAlbN0TxNXccx3oQsRecDJ4UXUpdtQqelHh36IQFYqmfvrandom: dropbear: uninitialized urandom read (32 bytes read)
gIr/mOg4+Xa130tv7aKoRKhnM3192UQtsP4f6kYsXUgTOoK3VVaETsgD2vcqZGzp3nGMnFBdE9KssU/wXGl9qYspcAb7V4bcJP91vp8pO8wrZUv+dt92RvuADkgDt3D/5Tbn6eDAa5z9gvBMmGFm5B/+2wj9RWJJPZoTobmv0XFVdOkg/sqjwbxZTZrwz/EpG7DBiw2SUa8rUy0fbzYcLXtoVuE9s03UyaASYTSpECze3ZcBs3zT50UKrwJM0VuYpdq6RAR4yuzkV9/QfT root@MT_platform
Fingerprint: md5 cf:cb:31:1b:26:2c:b2:8f:50:0d:7e:36:6f:3e:4b:1a
dropbear.
hwclock: can't open '/dev/misc/rtc': No such file or directory
Starting syslogd/klogd: done
Starting tcf-agent: random: tcf-agent: uninitialized urandom read (16 bytes read)
OK

/bin/autologin: line 1: -e: command not found
root@MT_platform:~# #!/bin/sh
root@MT_platform:~#
root@MT_platform:~#

 

0 Kudos