uclinux-2.6为什么能看到shell了还有问题!

[复制链接]
3003|12
手机看帖
扫描二维码
随时随地手机跟帖
letter|  楼主 | 2007-2-1 19:56 | 显示全部楼层 |阅读模式
经过一段时间的煎熬,终于看到shell了,可是shell总是过几分钟输出:
init: /bin/sh respawning too fast
我看了启动信息,发现运行脚本rc时,/bin/expand命令出错:
Command: /bin/expand /etc/ramfs.img /dev/ram1                
/bin/expand: Bad command or file name
认为shell出错和这个有关,望高指点,多谢。
     
以下是我的启动信息:
U-Boot 1.1.4 (Jan 22 2007 - 16:40:53)                                     
U-Boot code: 0C700000 -> 0C719EF8  BSS: -> 0C71E99C                                                   
RAM Configuration:                  
Bank #0: 0c000000  8 MB                       
Flash:  2 MB            
In:    serial             
Out:   serial             
Err:   serial             
Hit any key to stop autoboot:  0                                
## Booting image at 00040000 ...                                
   Image Name:   Linux-2.6.9                            
   Created:      2007-01-26   2:50:16 UTC                                         
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                      
   Data Size:    659816 Bytes = 644.4 kB                                        
   Load Address: 0c008000                         
   Entry Point:  0c008000                         
   Verifying Checksum ... OK                            
OK  
Starting kernel ...                   
Uncompressing Linux................................................ done, bootin                                                                                
g the kernel.             
Linux version 2.6.9-hsc0 (root@localhost.localdomain) (gcc version 2.95.3 200103                                                                                
15 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClin                                                                                
ux XIP and shared lib patches from http://www.snapgear.com/)) #48 Fri Jan 26 10:                                                                                
47:23 CST 2007              
CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T)                                                    
Machine: S3C44B0X Development Board                                   
Built 1 zonelists                 
Kernel command line: root=/dev/ram0 initrd=0x0c13c53c,120k console=ttyS0,115200                                                                               
PID hash table entries: 64 (order: 6, 1024 bytes)                                                 
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)                                                            
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)                                                           
Memory: 8MB = 8MB total                       
Memory: 6592KB available (1297K code, 132K data, 56K init)                                                          
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)                                                          
checking if image is initramfs...it isn't (ungzip failed); looks like an initrd                                                                               
Freeing initrd memory: 120K                           
NET: Registered protocol family 16                                  
init_module           
Samsung S3C44B0 Rtl8019as driver version 0.1 (2002-02-20) <hzh12@163.net>                                                                         
init    
eth0: 12:34:56:78:90:ab                       
get_stats         
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)                                                      
devfs: boot_options: 0x1                        
ttyS0 at I/O 0x1d00000 (irq = 3) is a Samsung S3C44B0 Internal UART                                                                   
ttyS1 at I/O 0x1d04000 (irq = 2) is a Samsung S3C44B0 Internal UART                                                                   
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize                                                                     
loop: loaded (max 8 devices)                            
Using anticipatory io scheduler                               
nbd: registered device at major 43                                  
NET: Registered protocol family 2                                 
IP: routing cache hash table of 512 buckets, 4Kbytes                                                    
TCP: Hash tables configured (established 512 bind 512)                                                      
NET: Registered protocol family 1                                 
NET: Registered protocol family 17                                  
RAMDISK: romfs filesystem found at block 0                                          
RAMDISK: Loading 120KiB [1 disk] into ram disk... done.                                                       
VFS: Mounted root (romfs filesystem) readonly.                                              
Mounted devfs on /dev                     
Freeing init memory: 56K                        
Shell invoked to run file: /etc/rc                                  
Command: hostname Samsung                         
Command: /bin/expand /etc/ramfs.img /dev/ram1                                             
/bin/expand: Bad command or file name                                     
Command: mount -t proc proc /proc                                 
Command: mount -t ext2 /dev/ram1 /var                                     
mount failed: No such file or directory                                       
Command: mkdir /var/config                          
/var/config: Read-only file system                                  
Command: mkdir /var/tmp                       
/var/tmp: Read-only file system                               
Command: mkdir /var/log                       
/var/log: Read-only file system                               
Command: mkdir /var/run                       
/var/run: Read-only file system                               
Command: mkdir /var/lock                        
/var/lock: Read-only file system                                
Command: mkdir /var/empty                         
/var/empty: Read-only file system                                 
Command: cat /etc/motd                      
Welcome to          
          ____ _  _                   
         /  __| ||_|                    
    _   _| |  | | _ ____  _   _  _  _                                     
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|
For further information check:
http://www.uclinux.org/
Command: ifconfig lo 127.0.0.1
ifconfig: Bad command or file name
Command: route add -net 127.0.0.0 netmask 255.255.255.0 lo
route: Bad command or file name
Command: dhcpcd &
dhcpcd: Bad command or file name
sh 10: Child 14 died
[14]
Execution Finished, Exiting
init: exec rc failed
init: /bin/firewall failed!init: exec rc failed
Sash command shell (version 1.1.1)
/>init: /bin/sh respawning too fast
init: /bin/sh respawning too fast

相关帖子

wangkj| | 2007-2-1 20:28 | 显示全部楼层

文件系统的问题

使用特权

评论回复
letter|  楼主 | 2007-2-1 20:52 | 显示全部楼层

该如何解决?内核是2.6.9的。

使用特权

评论回复
wangkj| | 2007-2-1 21:10 | 显示全部楼层

换个文件系统,可能是inittab的问题或者init的问题

使用特权

评论回复
letter|  楼主 | 2007-2-1 21:44 | 显示全部楼层

我的inittab是空的。

inittab:
#inet:unknown:/bin/inetd
#boa:unknown:/bin/boa

使用特权

评论回复
wangkj| | 2007-2-2 08:32 | 显示全部楼层

我只是给你提示

问题还需要你自己解决,这是一个常见问题。
我是直接换的文件系统,没找具体原因。

使用特权

评论回复
letter|  楼主 | 2007-2-2 16:03 | 显示全部楼层

今天换了一个文件系统,还是expand有问题。

今天自己做了一ramdisk, Read-only file system问题没了,但是还是有二处问题。
第一处:
Command: /bin/expand /etc/ramfs.img /dev/ram1
Can't open expanded file /dev/ram1
pid 11: failed 768
第二处:
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram1 /var
mount failed: No such file or directory
都和ram1有关,我想ram1是不是有问题?

全部信息:

U-Boot 1.1.4 (Jan 22 2007 - 16:40:53)

U-Boot code: 0C700000 -> 0C719EF8  BSS: -> 0C71E99C
RAM Configuration:
Bank #0: 0c000000  8 MB
Flash:  2 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0 
=>  bootm 40000 140000
## Booting image at 00040000 ...
   Image Name:   Linux-2.6.9
   Created:      2007-02-02  18:21:43 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    605444 Bytes = 591.3 kB
   Load Address: 0c008000
   Entry Point:  0c008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 00140000 ...
   Image Name:   Ramdisk
   Created:      2007-02-02  19:02:09 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    77798 Bytes = 76 kB
   Load Address: 0c600000
   Entry Point:  0c600000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux............................................ done, booting the kernel.
Linux version 2.6.9-hsc0 (root@localhost.localdomain) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #62 Fri Feb 2 13:08:52 EST 2007
CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T)
Machine: S3C44B0X Development Board
Built 1 zonelists
Kernel command line: root=/dev/ram0 rw initrd=0x0c600000,800k console=ttyS0,115200
PID hash table entries: 64 (order: 6, 1024 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 8MB = 8MB total
Memory: 5864KB available (1194K code, 164K data, 56K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 800K
NET: Registered protocol family 16
init_module
Samsung S3C44B0 Rtl8019as driver version 0.1 (2002-02-20) <hzh12@163.net>
init
eth0: 12:34:56:78:90:ab 
get_stats
devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
ttyS0 at I/O 0x1d00000 (irq = 3) is a Samsung S3C44B0 Internal UART
ttyS1 at I/O 0x1d04000 (irq = 2) is a Samsung S3C44B0 Internal UART
RAMDISK driver initialized: 16 RAM disks of 2048K size 1024 blocksize
loop: loaded (max 8 devices)
Using anticipatory io scheduler
nbd: registered device at major 43
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
NET: Registered protocol family 1
NET: Registered protocol family 17
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem).
Mounted devfs on /dev
Freeing init memory: 56K
Shell invoked to run file: /etc/rc
Command: hostname Samsung
Command: /bin/expand /etc/ramfs.img /dev/ram1
Can't open expanded file /dev/ram1
pid 11: failed 768
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram1 /var
mount failed: No such file or directory
Command: mkdir /var/config
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: mkdir /var/empty
Command: cat /etc/motd
Welcome to
          ____ _  _
         /  __| ||_|                 
    _   _| |  | | _ ____  _   _  _  _ 
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|

For further information check:
http://www.uclinux.org/

Command: ifconfig lo 192.168.1.8
ifconfig: Bad command or file name
Command: route add -net 192.168.1.1 netmask 255.255.255.0 lo
route: Bad command or file name
Execution Finished, Exiting

Sash command shell (version 1.1.1)
/> init: /bin/sh respawning too fast

使用特权

评论回复
wangkj| | 2007-2-2 16:33 | 显示全部楼层

4510-romfs.tgz

试试看吧。
qq 

使用特权

评论回复
letter|  楼主 | 2007-2-2 22:03 | 显示全部楼层

好的。wangkj,非常感谢你。

使用特权

评论回复
wangkj| | 2007-2-3 09:15 | 显示全部楼层

如果运行几个命令后core dump不要奇怪

这个好像没也没完全作好,但也可能是内核的问题(这个和sst flash有关,可能)。

使用特权

评论回复
letter|  楼主 | 2007-2-7 16:04 | 显示全部楼层

原来是配置不对

原来是配置不对而以至文件系统有问题,具体问题我还不知道出在那里。我导入一个现成的内核配置文件就好了,可是shell不能输入任何字符,这又是什么原因?串口驱动(因为串口驱动是自己搞上去的)?

---------------------------------------------------------------------
bootm 0x0c500000
## Booting image at 0c500000 ...
   Image Name:   Linux-2.6.9
   Created:      2007-02-07  20:51:00 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1088276 Bytes =  1 MB
   Load Address: 0c008000
   Entry Point:  0c008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux......................................................................... done, booting the kernel.
Linux version 2.6.9-hsc0 (root@localhost.localdomain) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #62 Wed Feb 7 15:43:21 EST 2007
CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T)
Machine: S3C44B0X Development Board
Built 1 zonelists
Kernel command line: root=/dev/ram0 initrd=0x0c136600,969k console=ttyS0,115200
PID hash table entries: 64 (order: 6, 1024 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 8MB = 8MB total
Memory: 5776KB available (2126K code, 122K data, 52K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
checking if image is initramfs...it isn't (ungzip failed); looks like an initrd
Freeing initrd memory: 969K
NET: Registered protocol family 16
init_module
Samsung S3C44B0 Rtl8019as driver version 0.1 (2002-02-20) <hzh12@163.net>
init
eth0: 12:34:56:78:90:ab 
get_stats
ttyS0 at I/O 0x1d00000 (irq = 3) is a Samsung S3C44B0 Internal UART
ttyS1 at I/O 0x1d04000 (irq = 2) is a Samsung S3C44B0 Internal UART
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
loop: loaded (max 8 devices)
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
NET: Registered protocol family 1
NET: Registered protocol family 17
RAMDISK: romfs filesystem found at block 0
RAMDISK: Loading 969KiB [1 disk] into ram disk... done.
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 52K
Shell invoked to run file: /etc/rc
Command: hostname senglen
Command: /bin/expand /etc/ramfs.img /dev/ram1
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram1 /var
Command: mkdir /var/config
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: mkdir /var/empty
Command: cat /etc/motd
Welcome to
          ____ _  _
         /  __| ||_|                 
    _   _| |  | | _ ____  _   _  _  _ 
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|

For further information check:
http://www.uclinux.org/

Execution Finished, Exiting

Sash command shell (version 1.1.1)
/> (不能接受任何字符,怪)

使用特权

评论回复
letter|  楼主 | 2007-2-8 10:24 | 显示全部楼层

原来是串口驱动问题

现在问题解决了,是串口的中断的接收入口不对,改为正确的就好了。谢谢wangkj的帮助。

---------------------------------------------------------------------
U-Boot 1.1.4 (Jan 22 2007 - 16:40:53)

U-Boot code: 0C700000 -> 0C719EF8  BSS: -> 0C71E99C
RAM Configuration:
Bank #0: 0c000000  8 MB
Flash:  2 MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0 
## Booting image at 00040000 ...
   Image Name:   Linux-2.6.9
   Created:      2007-02-08  14:54:44 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1086152 Bytes =  1 MB
   Load Address: 0c008000
   Entry Point:  0c008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux......................................................................... done, booting the kernel.
Linux version 2.6.9-hsc0 (root@localhost.localdomain) (gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)) #63 Thu Feb 8 09:36:06 EST 2007
CPU: Samsung-S3C44B0x [44b07700] revision 0 (ARMv4T)
Machine: S3C44B0X Development Board
Built 1 zonelists
Kernel command line: root=/dev/ram0 initrd=0x0c136600,968k console=ttyS0,115200
PID hash table entries: 64 (order: 6, 1024 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 8MB = 8MB total
Memory: 5776KB available (2125K code, 123K data, 52K init)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
checking if image is initramfs...it isn't (ungzip failed); looks like an initrd
Freeing initrd memory: 968K
NET: Registered protocol family 16
init_module
Samsung S3C44B0 Rtl8019as driver version 0.1 (2002-02-20) <hzh12@163.net>
init
eth0: 12:34:56:78:90:ab 
get_stats
ttyS0 at I/O 0x1d00000 (irq = 3) is a Samsung S3C44B0 Internal UART
ttyS1 at I/O 0x1d04000 (irq = 2) is a Samsung S3C44B0 Internal UART
RAMDISK driver initialized: 16 RAM disks of 1024K size 1024 blocksize
loop: loaded (max 8 devices)
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 512)
NET: Registered protocol family 1
NET: Registered protocol family 17
RAMDISK: romfs filesystem found at block 0
RAMDISK: Loading 968KiB [1 disk] into ram disk... done.
VFS: Mounted root (romfs filesystem) readonly.
Freeing init memory: 52K
Shell invoked to run file: /etc/rc
Command: hostname ucan
Command: /bin/expand /etc/ramfs.img /dev/ram1
Command: mount -t proc proc /proc
Command: mount -t ext2 /dev/ram1 /var
Command: mkdir /var/config
Command: mkdir /var/tmp
Command: mkdir /var/log
Command: mkdir /var/run
Command: mkdir /var/lock
Command: mkdir /var/empty
Command: cat /etc/motd
Welcome to
          ____ _  _
         /  __| ||_|                 
    _   _| |  | | _ ____  _   _  _  _ 
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|

For further information check:
http://www.uclinux.org/

Command: ifconfig lo 192.168.1.8
Command: route add -net 192.168.1.1 netmask 255.255.255.0 lo
route: netmask and route address conflict
pid 15: failed 256
Execution Finished, Exiting
init: Booting to single user mode

Sash command shell (version 1.1.1)
/> ls
bin
dev
etc
home
lib
mnt
proc
sbin
tmp
usr
var
/> 

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

4

主题

27

帖子

1

粉丝