How to automatically run a specific program after ARMLinux is started

Source: Internet
Author: User
& Nbsp; after the startup, the user's application or command for starting the system service is automatically run and saved in the/usr/etc/rc. local file of the Development Board root file system. Some development boards automatically run the graphic interface program after startup. press ctrl + c to open the Development Board to the SHELL prompt interface in linux. In fact, you can comment out rc. local  

After the system is started, the user's application or command to start the system service is automatically run and saved in the/usr/etc/rc. local file of the Development Board root file system. Some development boards automatically run the graphic interface program after startup. press ctrl + c to open the Development Board to the SHELL prompt interface in linux. In fact, you can comment out the graphic interface commands in the rc. local file and add commands to run your application to automatically run your application at startup.

The following uses my experiment as an example to describe the specific implementation steps. This method originated from the network. I verified it and made some modifications. This article is equivalent to reprinting.

1. go to the Linux operating system of the PC, and run the mkdir lz command under/nfs/usr/to create a folder named lz and enter the lz folder, create a new hello folder using mkdir hello to store the hello folder we will write. c files and executable files generated by compilation.

2. run the "vi hello. c" command under "/nfs/usr/lz/hello" to create the "hello. c" file and edit the following test program:

# Include

Int main (){

Printf ("Hello, test arm-linux! ");

Return 0;

}

After editing, save and exit with: wq.

3. the host uses the following command to cross-compile the environment to compile hello. c:

# Arm-linux-gcc? O hello. c

4. through the ls command, we can see that the hello executable file has been generated under/nfs/usr/lz/hello/. we can go through it on the development board. /hello to test your prepared hello. c execution

5. modify the rc. local file and use '#' at the end of the file to release the command for starting the graphic interface and add the command for executing the hello user application. the specific implementation is as follows:

# Export PATH = $ QPEDIR/bin: $ PATH

# Qtopia

#/Usr/qtopia/bin/qtopia

/Usr/lz/hello/./hello

Note: the first three lines comment out the startup GUI, and the last line is the added hello testing program.

6. restart the development board and use the vivi parameter configuration to mount the file system on the host through nfs on the development board. then we can see that the development board has run the hello program we have compiled through the super terminal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.