主题 : jffs2文件系统问题,请指教 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 2497
精华: 0
发帖: 30
金钱: 300 两
威望: 300 点
综合积分: 60 分
注册时间: 2008-11-20
最后登录: 2009-12-24
楼主  发表于: 2009-05-15 22:44

 jffs2文件系统问题,请指教

之前完成了U-BOOT linux基础内核的移植,现在想用busybox作jffs2根文件系统,但出现了问题,两天了,还没有什么进展,还请老大们帮忙分析,指点指点,先谢过了。

采用busyBox V1。70 版本,host机采用ubuntu开发环境,内核版本:2.6.22,现在内核启动并挂载jffs2后,无法运行/linuxrc,并停止了。
过程:
[code]U-Boot 1.1.6 (May  3 2009 - 14:04:48)                                                                
                                                                                                      
DRAM:  64 MB                                                                                          
Flash:  1 MB                                                                                          
NAND:  64 MB                                                                                          
In:    serial                                                                                        
Out:   serial                                                                                        
Err:   serial                                                                                        
set GPBCON : 55555                                                                                    
Hit any key to stop autoboot:  0                                                                      
MY2440# tftp 0x33000000 uImage                                                                        
dm9000 i/o: 0x20000300, id: 0x90000a46                                                                
MAC: 08:00:3e:06:0a:8b                                                                                
TFTP from server 192.168.1.102; our IP address is 192.168.1.110                                      
Filename 'uImage'.                                                                                    
Load address: 0x33000000                                                                              
Loading: checksum bad                                                                                
T #################################################################                                  
         #################################################################                            
         #################################################################                            
         #################################################################                            
         ###################                                                                          
done                                                                                                  
Bytes transferred = 1425396 (15bff4 hex)                                                              
MY2440# bootm                                                                                        
## Booting image at 33000000 ...                                                                      
   Image Name:   Linux-2.6.22.6                                                                      
   Created:      2009-05-15  13:46:02 UTC                                                            
   Image Type:   ARM Linux Kernel Image (uncompressed)                                                
   Data Size:    1425332 Bytes =  1.4 MB                                                              
   Load Address: 30008000                                                                            
   Entry Point:  30008000                                                                            
   Verifying Checksum ... OK                                                                          
OK                                                                                                    
                                                                                                      
Starting kernel ...                                                                                  
                                                                                                      
Uncompressing Linux...................................................................................
.......... done, booting the kernel.                                                                  
Linux version 2.6.22.6 (renyucjs@renyucjs-laptop) (gcc version 3.4.1) #9 Fri May 15 21:45:47 CST 2009
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177                                              
Machine: SMDK2440                                                                                    
Memory policy: ECC disabled, Data cache writeback                                                    
CPU S3C2440A (id 0x32440001)                                                                          
S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz                                  
S3C24XX Clocks, (c) 2004 Simtec Electronics                                                          
CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on                                                  
CPU0: D VIVT write-back cache                                                                        
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets                                  
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets                                  
Built 1 zonelists.  Total pages: 16256                                                                
Kernel command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0,115200 rootfstype=jffs
2                                                                                                    
irq: clearing subpending status 00000003                                                              
irq: clearing subpending status 00000002                                                              
PID hash table entries: 256 (order: 8, 1024 bytes)                                                    
timer tcon=00500000, tcnt a4ca, tcfg 00000200,00000000, usec 00001e57                                
Console: colour dummy device 80x30                                                                    
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)                                        
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)                                          
Memory: 64MB = 64MB total                                                                            
Memory: 61824KB available (2632K code, 293K data, 112K init)                                          
Mount-cache hash table entries: 512                                                                  
CPU: Testing write buffer coherency: ok                                                              
NET: Registered protocol family 16                                                                    
S3C2410 Power Management, (c) 2004 Simtec Electronics                                                
S3C2440: Initialising architecture                                                                    
S3C2440: IRQ Support                                                                                  
S3C2440: Clock Support, DVS off                                                                      
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics                                            
DMA channel 0 at c4800000, irq 33                                                                    
DMA channel 1 at c4800040, irq 34                                                                    
DMA channel 2 at c4800080, irq 35                                                                    
DMA channel 3 at c48000c0, irq 36                                                                    
usbcore: registered new interface driver usbfs                                                        
usbcore: registered new interface driver hub                                                          
usbcore: registered new device driver usb                                                            
NET: Registered protocol family 2                                                                    
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)                                        
TCP established hash table entries: 2048 (order: 2, 16384 bytes)                                      
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)                                              
TCP: Hash tables configured (established 2048 bind 2048)                                              
TCP reno registered                                                                                  
NetWinder Floating Point Emulator V0.97 (double precision)                                            
JFFS2 version 2.2. (NAND) (SUMMARY)  
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-05-16 09:31
现在内核启动并挂载jffs2后,无法运行/linuxrc,并停止了。

从你贴出的信息看,文件系统还没有被挂载,更别提运行/linuxrc了。
在你看到类似"VFS: Mounted root (jffs2 filesystem)." 这样的信息之前,先检查一下内核是不是挂在其它地方了
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 2497
精华: 0
发帖: 30
金钱: 300 两
威望: 300 点
综合积分: 60 分
注册时间: 2008-11-20
最后登录: 2009-12-24
2楼  发表于: 2009-05-16 10:29
哦,是我拷漏了,后面还有信息:
JFFS2: default compression mode: priority                                      
io scheduler noop registered                                                    
io scheduler anticipatory registered (default)                                  
io scheduler deadline registered                                                
io scheduler cfq registered                                                    
s3c2410-lcd s3c2410-lcd: invalid bpp 16                                        
Console: switching to colour frame buffer device 30x40                          
fb0: s3c2410fb frame buffer device                                              
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics                            
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled        
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440      
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440      
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440      
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize          
loop: module loaded                                                            
dm9000 Ethernet Driver                                                          
eth0: dm9000 at c485e300,c4860304 IRQ 51 MAC: 08:00:3e:06:0a:8b                
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2                        
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx    
S3C24XX NAND Driver, (c) 2004 Simtec Electronics                                
s3c2440-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns          
NAND device: Manufacturer ID: 0xec, Chip ID: 0x76 (Samsung NAND 64MiB 3,3V 8-bi)
Scanning device for bad blocks                                                  
Creating 5 MTD partitions on "NAND 64MiB 3,3V 8-bit":                          
0x00000000-0x00040000 : "uboot"                                                
0x00040000-0x00050000 : "param"                                                
0x00050000-0x00250000 : "kernel"                                                
0x00250000-0x02250000 : "jffs2"                                                
0x02250000-0x04000000 : "other"                                                
usbmon: debugfs is not available                                                
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI                                        
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1        
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000                            
usb usb1: configuration #1 chosen from 1 choice                                
hub 1-0:1.0: USB hub found                                                      
hub 1-0:1.0: 2 ports detected                                                  
mice: PS/2 mouse device common for all mice                                    
s3c2440-i2c s3c2440-i2c: slave address 0x10                                    
s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHz                            
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter                                
TCP cubic registered                                                            
NET: Registered protocol family 1                                              
JFFS2 notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsyste.
VFS: Mounted root (jffs2 filesystem).                                          
Freeing init memory: 112K          
//在此等待约5S后,提示。。。                                            
Failed to execute /linuxrc.  Attempting defaults...                            
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2009-05-16 16:37
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 2497
精华: 0
发帖: 30
金钱: 300 两
威望: 300 点
综合积分: 60 分
注册时间: 2008-11-20
最后登录: 2009-12-24
4楼  发表于: 2009-05-17 22:38
问题已经跳过了,重新作了个文件系统,采用手动建立设备文件,能正常进入了。

说明还是根文件系统制作的问题,估计是因为使用了mdev,但shell设置不对引起的。

但现在又有一个新的问题:
   内核成功调用run_init_process("/linuxrc");到出现busyBox的提示信息:
JFFS2 notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 112K
now we are trying init: /linuxrc.
。。。。。。。。。。。。。这个过程
init started: BusyBox v1.7.0 (2009-05-09 19:58:07 CST)
过程居然要将近8分钟?实在不解!是有听说jffs2加载慢的,但也不至于这么慢呀?原来怀凝是因为jffs2分区过大引起的(32M),但现在改为8M了,还是一样,会是什么原因呀?
# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/mtdblock3            8.0M      2.8M      5.2M  35% /
tmpfs                    30.2M         0     30.2M   0% /tmp
mdev                     30.2M         0     30.2M   0% /dev
   我用NFS测试过了,一切正常,所以应当就是JFFS2问题。跟mkfs.jffs2工具版本之类的是否相关?我用的是UBUNTU 直接用apt-get 来安装的mtd_util工具。
急需指点,先谢过了。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
5楼  发表于: 2009-05-18 07:52
我试过近60M的jffs2分区,不会这么慢的.你是怎么制作文件系镜像的?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 2497
精华: 0
发帖: 30
金钱: 300 两
威望: 300 点
综合积分: 60 分
注册时间: 2008-11-20
最后登录: 2009-12-24
6楼  发表于: 2009-05-18 21:39
使用:
mkfs.jffs2 -n -s 512 -e 16KiB -d myfs --pad=0x800000 -o myfs.jffs2

然后再烧入jffs2分区。。。

现在真有点搞不懂了,是不是我内核问题?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
7楼  发表于: 2009-05-18 22:58
试试用
mkfs.jffs2 -n -e 16KiB -d myfs --pad -o myfs.jffs2 --little-endian --faketime
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 2497
精华: 0
发帖: 30
金钱: 300 两
威望: 300 点
综合积分: 60 分
注册时间: 2008-11-20
最后登录: 2009-12-24
8楼  发表于: 2009-05-21 22:00
找到原因了,谢谢版主!!
是我对mkfs.jffs2的-s 选项理解错误,我以为是--pagesize 指的是NAND的一页大小(实际是指:max data node size,即jffs节点页大小),所以把他设为512了,在造成节点过多,加载变慢了。
希望大家也别犯我这错。。。