cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
3,620 Views
Registered: ‎09-19-2017

init scripts (2017.4)

Jump to solution

I'm following "Steps for Application Auto Run at Startup" in UG1144 (2017.4) and I am not getting the link being made into the rcS.d directory.  The script is there in /etc/init.d/

 

Is this working for other people?

 

Capture.PNG

 

Capture.PNG

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
4,638 Views
Registered: ‎09-19-2017

Re: init scripts (2017.4)

Jump to solution

I moved udev from rcS.d to rc5.d and now I can boot without a PL in QSPI.  I have a bit.bin in my image.ub and it is loaded in rc.5 before udev.  The boot no longer hangs.  

 

Just letting people know what I had to do in case there was anyone else needing the same thing.

 

 

 

View solution in original post

0 Kudos
10 Replies
Highlighted
Moderator
Moderator
3,600 Views
Registered: ‎04-24-2017

Re: init scripts (2017.4)

Jump to solution

Hi mark@bish.net,

 

I don't see any problem with 2017.4 Can you post your loadPL content?

 

test-init.PNG

 

test-init.bb content

 

#
# This file is the test-init recipe.
#

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

SRC_URI = "file://test-init \
	"
inherit update-rc.d

INITSCRIPT_NAME = "test-init"
INITSCRIPT_PARAMS = "start 99 S ."

S = "${WORKDIR}"

do_install() {
	     install -d ${D}${sysconfdir}/init.d
	     install -m 0755 ${S}/test-init ${D}${sysconfdir}/init.d/test-init
}

FILES_${PN} += "${sysconfdir}/*"

test-init content

 

#!/bin/sh

DAEMON=/usr/bin/test
start ()
{
	echo " Starting test"
	start-stop-daemon -S -o --background -x $DAEMON
}
stop ()
{
	echo " Stoping test"
	start-stop-daemon -K -x $DAEMON
}
restart()
{
	stop
	start
}
[ -e $DAEMON ] || exit 1
	case "$1" in
		start)
			start; ;;
		stop)
			stop; ;;
		restart)
			restart; ;;
		*)
			echo "Usage: $0 {start|stop|restart}"
			exit 1
	esac
exit $?
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Highlighted
Adventurer
Adventurer
3,570 Views
Registered: ‎09-19-2017

Re: init scripts (2017.4)

Jump to solution

I put the same script you have into my recipe and still no luck.  Is petalinux/Yocto trying to use the update-rc.d that is native to the host?

 

I am using Debian.  And I have copied update-rc.d into /opt/pkg/petalinux/2017.4/tools/linux-i386/petalinux/bin/ just in case it was looking for it. 

0 Kudos
Highlighted
Moderator
Moderator
3,563 Views
Registered: ‎04-24-2017

Re: init scripts (2017.4)

Jump to solution

Hi mark@bish.net,

 

This is not native to host. You don't need to add any packages to petalinux installer.

 

Their is a recipe for this https://github.com/openembedded/openembedded-core/blob/morty/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb.

 

Also you can try updating manually like this.

 

root@xilinx-zcu102-zu9-es2-rev1_0-2017:~# update-rc.d test-init defaults
 System startup links for /etc/init.d/test-init already exist.
root@xilinx-zcu102-zu9-es2-rev1_0-2017:~#

 

 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Highlighted
Adventurer
Adventurer
3,559 Views
Registered: ‎09-19-2017

Re: init scripts (2017.4)

Jump to solution

If I don't need to add it, any advice on debugging why it isn't working then?

0 Kudos
Highlighted
Adventurer
Adventurer
3,558 Views
Registered: ‎09-19-2017

Re: init scripts (2017.4)

Jump to solution

@sandeepg Also, is there  a way I change the init levels of scripts in /etc/rcS.d/  I want to move S05modutils.sh to S15modutils.sh

0 Kudos
Highlighted
Moderator
Moderator
3,542 Views
Registered: ‎04-24-2017

Re: init scripts (2017.4)

Jump to solution

Hi mark@bish.net,

 

You can override in modutils-initscripts.bbappend as shown below.

 

$ mkdir -p <plnx-proj-root>/project-spec/meta-user/recipes-kernel/modutils-initscripts/
$ touch <plnx-proj-root>/project-spec/meta-user/recipes-kernel/modutils-initscripts/modutils-initscripts.bbappend

# Add this content INITSCRIPT_PARAMS = "start 15 S ."
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Highlighted
Adventurer
Adventurer
3,537 Views
Registered: ‎09-19-2017

Re: init scripts (2017.4)

Jump to solution

@sandeepg  Thank you for that.

 

Also, is there a way to get past udev when booting into a zynq system that doesn't have a PL loaded by either uboot or the FSBL.

 

I'm using a dts for the PL I am eventually going to load after I boot.  This dts has some AXI GPIOs defined for PL that will be loaded after I boot.  I have narrowed it down to "udevadm settle" in the udev bootscript, which doesn't return if the PL hasn't been programmed.  I am assuming I can program the PL before the udev script starts and things will just work.

 

Any ideas?

0 Kudos
Moderator
Moderator
3,520 Views
Registered: ‎04-24-2017

Re: init scripts (2017.4)

Jump to solution

Hi mark@bish.net,

 

I would suggest not to use this flow.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Highlighted
Adventurer
Adventurer
4,639 Views
Registered: ‎09-19-2017

Re: init scripts (2017.4)

Jump to solution

I moved udev from rcS.d to rc5.d and now I can boot without a PL in QSPI.  I have a bit.bin in my image.ub and it is loaded in rc.5 before udev.  The boot no longer hangs.  

 

Just letting people know what I had to do in case there was anyone else needing the same thing.

 

 

 

View solution in original post

0 Kudos
Highlighted
Contributor
Contributor
1,879 Views
Registered: ‎01-20-2008

Re: init scripts (2017.4)

Jump to solution

I know this isn't directly tied to what you listed as the solution but I came across this post when having a problem very similar to what you described in the opening post. I also followed the "Steps for Application Auto Run at Startup" from p60 of UG1144, saw my script in /etc/init.d and did not see it run.

 

After a lot of trial and error I found that everything worked when I made sure I used all lowercase letters for my application names. I only thought of this when comparing your code with mine and the Xilinx example in UG1144. I suspect your app would work if named "loadpl" instead of "loadPL."

 

I hope this saves someone else some time!

Jim

0 Kudos