+ -
当前位置:首页 → 问答吧 → 【求助】[求助]嵌入式linux系统2440板如何上电自动挂载硬盘

【求助】[求助]嵌入式linux系统2440板如何上电自动挂载硬盘

时间:2006-05-13

来源:互联网

我的2440板,linux 2.4.18内核
上电后可通过串口控制台手动输入mount 命令挂载
不知道怎么做才能上电后自动挂载到某个目录中去,修改/etc/fstab可以做到吗?
望各位大虾告知,急!!!!!!!!!!!      

作者: huangyx98   发布时间: 2006-05-13

这个……启动时运行的命令可以写在rc里吧      

作者: flag   发布时间: 2006-05-13

我在root上修改/usr/etc/rc.local文件,想上电自动挂载硬盘



在l文件倒数第二行添加:



/bin/mkdir  /var/tmp/ide



/bin/mount -t vfat /dev/ide/host0/bus0/target0/lun0/part1 /tmp/ide

倒数第一行不变:/qtopia/qtopia-free-1.7.0/bin/qpe  -qws

后面运行系统,无法进入qt,系统提示:



......................................



......................................



Initializing USB Mass Storage driver...



usb.c: registered new driver usb-storage



USB Mass Storage support registered.



Linux video capture interface: v1.00



video_dev: unable to get major 81



insmod: init_module: videodev: Input/output error
usb.c: registered new driver ov511



ov511.c: v1.48a for Linux 2.4 : OV511 USB Camera Driver



mount: Mounting none on /proc/bus/usb failed: No such file or directory
cramfs: wrong magic



mount: Mounting /dev/mtdblock/3 on /tmp/disk3 failed: Invalid argument



init started:  BusyBox v0.60.5 (2003.05.12-11:53+0000) multi-cal binary
modprobe: modprobe: Can't open dependencies file /lib/modules/2.4.18-rmk7-pxa1/modules.dep (No such file or directory)



modprobe: modprobe: Can't open dependencies file /lib/modules/2.4.18-rmk7-pxa1/modules.dep (No such file or directory)




Please press Enter to activate this console. /usr/etc/rc.local: line 9: /.bashrc: No such file or directory
/bin/cp: will not create hard link `/tmp/Applications/Network/modules' to directory `/tmp/Applications/AlarmServer'
/bin/cp: will not create hard link `/tmp/Documents' to directory `/tmp/Applications/qimpen'
Could not open mime.types file, "etc/mime.types", for reading
/Qtopia/qtopia-free-1.7.0/bin/qpe: error whileloading shared libraries: libqpe.so.1: cannot open
Please press Enter to activate this console.



提示按回车进入控制台,我按下后,输入命令查看挂载的文件



bash-2.05b# ls
Qtopia dev  home  linuxrc   proc     sbin  usr
bin etc  lib   linuxrc~  ramdisk  tmp   var
bash-2.05b# ls tmp
Applications  qcop-msg-language   qcop-msg-systemtime
Settings      qcop-msg-launchersettings  qtembedded-unknown
disk3       qcop-msg-qpe   udisk
ide       qcop-msg-quicklauncher
bash-2.05b# ls /tmp/ide
ls: /tmde: No such file or directory
bash-2.05b# ls /tmp/ide/
?? - ???.mp3     ???? ???.mp3
?? ???.mp3     ????.mp3
?? ???.mp3     Recycled



文件内是正确内容,为什么qt就无法启动了呢?      

作者: huangyx98   发布时间: 2006-05-13

/Qtopia/qtopia-free-1.7.0/bin/qpe: error whileloading shared libraries: libqpe.so.1: cannot open
问题不是很清楚吗      

作者: flag   发布时间: 2006-05-15

求教斑竹:那我应该改哪个部分呢?
现在我就是不知道从哪里下手?
我还有个疑问,我在tmp目录下新建文件夹挂载硬盘不是应该不会对qt的启动有影响的吗?因为我没有改动qt库的路径指定,也没有改动库所在路径啊      

作者: huangyx98   发布时间: 2006-05-16

不管你怎么弄,至少要能在lib的路径里找到需要的文件,这就是你要改的目标。      

作者: flag   发布时间: 2006-05-17

找到问题了,是因为我制作根文件系统的时候是用demo的根文件系统cramfs,把这个根文件系统挂载到一个文件夹,然后用鼠标将文件夹的内容复制粘贴到另一个文件夹下修改,然后mkcranfs的,这样内核运行就找不到bashrc文件,也找不到所有的库文件了(虽然我到现在还不明白这个文件是干什么的)。
我现在先将挂载文件夹打包成tar,然后解压到另一个文件,修改,制作,ok了。
在这里感谢斑竹的提示,也提醒大家做技术要细心。      

作者: huangyx98   发布时间: 2006-05-18