嵌入式linux下的USB自动挂载问题
现在在做嵌入式linux下的USB自动挂载。
在系统启动的时候,首先加载USB驱动。加载过程中出现如下错误:
usb 1-2: new full speed USB device using hisilicon-ohci and address 2
usb 1-2: device descriptor read/64, error -110
usb 1-2: device descriptor read/64, error -110
usb 1-2: new full speed USB device using hisilicon-ohci and address 3
usb 1-2: device descriptor read/64, error -110
usb 1-2: device descriptor read/64, error -110
usb 1-2: new full speed USB device using hisilicon-ohci and address 4
usb 1-2: device not accepting address 4, error -110
usb 1-2: new full speed USB device using hisilicon-ohci and address 5
usb 1-2: device not accepting address 5, error -110
这是怎么回事?
虽然出现上述错误。但是当系统起来以后在控制台下还是能发现USB设备。我现在用的是U盘
能在/dev/scsi/host0/bus0/target0/lun0/目录下发现disc和part1
然后可以手动挂载。
现在我想让U盘自动挂载。写了个脚本。在加载完驱动以后马上执行挂载U盘脚本。但是挂载的时候提示
mount: Mounting /dev/scsi/host0/bus0/target0/lun0/part1 on /mnt/usb failed: No such file or directory
下面是脚本的内容:
load_usb_drv
sleep 10
if[ -r /dev/scsi/host0/bus0/target0/lun0/part1 ]
then
mount /dev/scsi/host0/bus0/target0/lun0/part1 /mnt/usb
fi
相关文档:
main.c
//初始化队列
void InitQueue(LiQueue *q)
{
q=(LiQueue*)malloc(sizeof(LiQueue));
q->front=q->rear=NULL;
}
//判断是否为空
int QueueEmpty(LiQueue *q)
{
if(q->rear==NULL)
{
return 1;
}
else
{
......
Linux下查看支持的信号列表:
~$ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE
9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2
13) SIGPIPE 14) SIGALRM 15) SIGTERM 17) SIGCHLD
18) SIGCONT 19) SIGSTOP 20) SIGTSTP 21) SIGTTIN
22) SIGTTOU 23) SIGUR ......
linux下几种服务器的配置使用之一:nfs tftp
安装nfs需要在服务器端关闭iptables防火墙,关闭方法如下
查看防火墙状态:
/etc/init.d/iptables status
暂时关闭防火墙:
/etc/init.d/iptables stop
禁止防火墙在系统启动时启动
/sbin/chkconfig --level 2345 iptables off
重启iptables:
/etc/init.d/iptabl ......
st='abcd'
1.字符串长度
expr length $st 或者 ${#st}
2.取字符串的substring
expr substr "$var" startpos length 或者 ${var:m} ${var:m:len}
${var:m}中的m的取值从0到${#var}-1,其返回的是从第m个字符到最后的部分;例如echo ${st:1}的结果是'bcd'
expr substr "$var" startpos length 中的startpos取值范围是 ......
~/test
|
|
|------main.c
|------lib
| |
| |------StringLen.h
| |------Strlen.c
| |------Strnlen.c
----------------StringLen.h:
#ifndef _STRING ......