Auto-run application on start up- P4080DS

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

Auto-run application on start up- P4080DS

Jump to solution
2,947 Views
appalanaidug
Contributor II

Hello,

We are working on P4080DS board using SDK 2.0 installed on Ubuntu 14.04

Any help is requested on the following points, after the board boots up:

1. Auto-login on startup (without typing "root" manually)

(we tried modifying the file /etc/inittab, but ended up in errors)

2. How to run custom application by default on startup (without typing the application name)

Thanks in advance.

0 Kudos
Reply
1 Solution
2,764 Views
yipingwang
NXP TechSupport
NXP TechSupport

You could use merge-files package.

1. Please go to sources/meta-freescale/recipes-extended/merge-files/merge-files/merge/

$mkdir -p etc/rcS.d/

Please copy your program to folder etc/rcS.d/ and rename it as "S100hello".

2. Please add merge-files to IMAGE_INSTALL_append in meta-freescale/recipes-fsl/images/fsl-image-core.bb.

IMAGE_INSTALL_append = " \
packagegroup-fsl-tools-core \
packagegroup-fsl-benchmark-core \
packagegroup-fsl-networking-core \
merge-files \
"

3. Please add the following line in build_p4080ds/conf/local.conf

    MERGED_DST = "/"

4. $ bitbake fsl-image-core

View solution in original post

0 Kudos
Reply
7 Replies
2,764 Views
appalanaidug
Contributor II

Hello Yiping,

Thank you for the help.

Auto login issue is solved.

For Auto run of application "hello1" after booting, I created a script file as follows

#!/bin/sh
DAEMON=/usr/bin/hello1
start ()
{
echo " Starting hello1"
start-stop-daemon -S -o -x $DAEMON
}
stop ()
{
echo " Stoping hello1"
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 $?

I copied this file into rc5.d in the path 

"/QorIQ-SDK-V2.0-20160527-yocto/build_p4080ds/tmp/work/p4080ds-fsl-linux/fsl-image-core/1.0-r0/rootfs/etc/rc5.d"

But on rebuilding the image, this file gets overwritten.

Please help on the following points

1. correct path to place the file in the directory

2. any changes to the script as required

Thankyou in advance.

0 Kudos
Reply
2,765 Views
yipingwang
NXP TechSupport
NXP TechSupport

You could use merge-files package.

1. Please go to sources/meta-freescale/recipes-extended/merge-files/merge-files/merge/

$mkdir -p etc/rcS.d/

Please copy your program to folder etc/rcS.d/ and rename it as "S100hello".

2. Please add merge-files to IMAGE_INSTALL_append in meta-freescale/recipes-fsl/images/fsl-image-core.bb.

IMAGE_INSTALL_append = " \
packagegroup-fsl-tools-core \
packagegroup-fsl-benchmark-core \
packagegroup-fsl-networking-core \
merge-files \
"

3. Please add the following line in build_p4080ds/conf/local.conf

    MERGED_DST = "/"

4. $ bitbake fsl-image-core

0 Kudos
Reply
2,764 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello appalanaidu g,

1. Auto-login, please modify /etc/inittab to add the following

S0:12345:respawn:/bin/start_getty  -a root  -L ttyS0 115200 vt102

2. Run your application automatically, please put your application in /etc/rcS.d/, please refer to the following thread.

https://community.nxp.com/thread/442477?commentID=867646#comment-867646 

Thanks,

Yiping

0 Kudos
Reply
2,764 Views
appalanaidug
Contributor II

Hello Yiping,

Thankyou for the response.

1.  For Auto-login issue,

            I added the above line to  "QorIQ-SDK-V2.0-20160527-yocto/sources/poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab", and ran "bitbake fsl-image-core", I get the following errors on booting

 INIT: cannot execute "/bin/start_getty"
INIT: cannot execute "/bin/start_getty"
INIT: cannot execute "/bin/start_getty"
INIT: cannot execute "/bin/start_getty"
INIT: cannot execute "/bin/start_getty"
INIT: cannot execute "/bin/start_getty"
INIT: cannot execute "/bin/start_getty"
INIT: cannot execute "/bin/start_getty"
INIT: cannot execute "/bin/start_getty"
INIT: cannot execute "/bin/start_getty"
INIT: Id "S0" respawning too fast: disabled for 5 minutes
INIT: no more processes left in this runlevel

I added the above line to "QorIQ-SDK-V2.0-20160527-yocto/build_p4080ds/tmp/work/p4080ds-fsl-linux/fsl-image-core/1.0-r0/rootfs/etc/inittab" and ran "bitbake fsl-image-core", the added line gets overwritten.

I get the usual login on booting.

Please suggest on the following points: 

1. What is the correct path to add the line "S0:12345:respawn:/bin/start_getty  -a root  -L ttyS0 115200 vt102" ?

2. Should I run "bitbake fsl-image-core" after this addition.

Thanks in advance.

0 Kudos
Reply
2,763 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please add the following line at last  in poky/meta/recipes-core/sysvinit/sysvinit-inittab/inittab

S0:12345:respawn:/sbin/getty --autologin root  -L ttyS0 115200  vt100

Then rebuild sysvinit and rootfs

$ bitbake sysvinit -c cleansstate

$ bitbake fsl-image-core

2,763 Views
appalanaidug
Contributor II

Hello Yiping,

Thank you for the response.

After modifying "fsl-image-core.bb" and "inittab" files as suggested above and regenerating files , I still get the login prompt on booting.

No errors are seen.

Any help is requested.

Thank you in advance.

0 Kudos
Reply
2,763 Views
yipingwang
NXP TechSupport
NXP TechSupport

I have verified my above procedure, it worked on my target board.

Please remember to execute "bitbake sysvinit -c cleansstate" before running "bitbake fsl-image-core".

On your target board, in Linux please execute "/sbin/getty --autologin root  -L ttyS0 115200  vt100" to check whether you can login the console automatically.

If you problem remains, please provide /etc/inittab file on your target board.

Thanks,

Yiping

0 Kudos
Reply