易截截图软件、单文件、免安装、纯绿色、仅160KB

嵌入式Linux中程序自启动问题

买来的开发板一启动就进入Qtopia的界面,很像个手机,但我想让它开机就执行我的程序,怎么办呢?
在网上查找关于Linux启动的文章,发现这个文件配置了启动所做的操作:/etc/inittab.
# This is run first except when booting
::sysinit:/etc/init.d/rcS
# Start an "askfirst" shell on the console
# shell routine
::askfirst:/bin/bash
# Stuff to do when restarting the init process
# init routine
::restart:/sbin/init
# a routine
::once:/usr/sbin/inetd
::once:/usr/etc/rc.local
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
 
仔细看这段代码发现很有意思,语法挺简单:sysinit(系统初始化)时执行/etc/init.d/rcS;askfirst(不知道什么意思)时执行/bin/bash;restart(重启)时执行/sbin/init;once(执行一次,我猜的,我指正)的有/usr/sbin/inetd和/usr/etc/rc.local;按下Ctrl+Alt+Del时执行/sbin/reboot;shutdown(关机时执行)/bin/umount。
了解了这些,我就一个一个文件去深度遍历,最终找到了——/usr/etc/rc.local
#!/bin/bash
. /usr/etc/profile
/sbin/ifconfig lo 127.0.0.1 up
#/sbin/ifconfig eth0 192.168.2.223 netmask 255.255.255.0 up
#/bin/route add default gw 192.168.2.1 eth0
#/sbin/inetd
/usr/sbin/makelinks
source /.bashrc
/bin/cp -rf /Qtopia/qtopia-free-1.7.0/wjluv/* /tmp/
/bin/cp -rf /Qtopia/ppp/resolv.conf /tmp
/bin/mkdir /tmp/udisk
/bin/mkdir /tmp/images
/bin/mkdir /tmp/flashdisk
/bin/mkdir /tmp/sdcard
cd /tmp
. /testshell
 
最下面一行就是正主了,testshell中包含了启动qtopia的脚本,修改后烧入开发板,成功。
将嵌入式设备的文件系统挂载到计算机时,要注意路径问题,不要使用vim /usr/etc/rc.local这样的命令,你会打开了本地计算机的rc.local,我就是因为这个问题咪了一上午。


相关文档:

Linux设备模型之input子系统详解

一:前言
最近在研究android的sensor driver,主要是E-compass,其中用到了Linux input子系统.在网上也看了很多这方面的资料,感觉还是这篇分析的比较细致透彻,因此转载一下以便自己学习,同时和大家分享!
(这篇博客主要是以键盘驱动为例的,不过讲解的是Linux Input Subsystem,可以仔细的研究一下!)
键盘驱动将检 ......

linux内核升级步骤

1。下载2.6.9的内核
2。在/usr/src目录下解压内核
tar zvxf /下载的路径/linux-2.6.0.tar.gz
 
3。配置
# make mrproper
# make menuconfig
make mrproper 是清理代码树的动作,保证源代码是干净的
4.编译
make
5。安装
make modules_install
make install
 
看来2。6的编译确实比以 ......

关于Linux静态库和动态库的分析


 
查看文章
 
 
关于Linux静态库和动态库的分析
2009-12-15 11:44
1.什么是库
在windows平台和linux平台下都大量存在着库。
本质上来说库是一种可执行代码的二进制形式,可以被操作系统载入内存执行。
由于windows和linux的本质不同,因此二者库的二进制是不兼容的。
本文仅限于介绍linux下的库 ......

Make Linux Resources


 
  Resources on the site
• Interactive map of GNU/Linux OS and FOSS
• "GNU/Linux is my home" - map of GNU/Linux system
• Interactive map of Linux kernel
• Linux inside
• Linux Technology Reference (single page view)
• Linux kernel diagram
• Li ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号