1赞

1回答

0收藏

[求助] 树莓派 程序无法自启动

Raspberry Pi Raspberry Pi 5001 人阅读 | 1 人回复 | 2013-03-28

小弟在做项目时往树莓派移植一定的算法,现在想让程序在系统上电后自动运行;
以我的理解首先需要能够自动登录,然后是需要自动启动程序,但是一直失败;

我是参照以下过程:
RPi Debian Auto Login[size=0.8em]

This guide will show you how to login to a Debian image and start LXDE by simply powering the Pi on.
Auto Login:
In Terminal:
sudo nano /etc/inittab
Scroll down to:
1:2345:respawn:/sbin/getty 115200 tty1
and change to
#1:2345:respawn:/sbin/getty 115200 tty1
Under that line add:
1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
Ctrl+X to exit, Y to save followed by enter twice
Auto StartX (Run LXDE)
In Terminal:
sudo nano /etc/rc.local
Scroll to the bottom and add the following above exit 0:
su -l pi -c startx
(where pi is the username you want to run X as). Press Ctrl+X to exit, Y to save followed by Enter twice.
(Note: The previous method indicated that you should add startx to /etc/profile. The updated method is better, since it will cause startx to run only when necessary, and it will not launch the X server as root.)


但是一直不能自动登录,还望高手指教















国内的ubuntu的更新源还是上海交大最给力
分享到:
回复

使用道具 举报

回答|共 1 个

倒序浏览

沙发

ukonline2000

发表于 2013-3-28 23:37:03 | 只看该作者

把程序的执行命令行,添加到rc.local文件中,试试
博客站点:http://ukonline2000.com
网店:http://ukonline2000.taobao.com
您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条