S3C6410 烧写u-boot 内核 根文件系统 遇到的问题 及总结

烧写u-boot 内核 根文件系统遇到的问题。


1.

[root@uplooking /]# mount -t yaffs2 /dev/mtdblock2 /mnt/
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
block 417 is bad

yaffs_read_super: isCheckpointed 0


通过nfs进入linux体统加载根文件系统到/mnt下

没有挂载成功。

先卸载下,在挂载ok

umount /mnt

mount -t yaffs2 /dev/mtdblock2 /mnt


2.tar:/usr:Not found in archive

[root]#tar xf qt_rootfs.tar /mnt

tar: /usr: Not found in archive

tar: Exiting with failure status due to previous errors

原因分析:

         因为压缩文件使用的相对路径 在当前目录下找不到 /usr目录,通过使用-C指定解压目录可解决此问题

tar xf qt_rootfs.tar -C /mnt


3.

IP-Config: Complete:
     device=eth0, addr=192.168.1.253, mask=255.255.255.0, gw=255.255.255.255,
     host=192.168.1.253, domain=, nis-domain=(none),
     bootserver=255.255.255.255, rootserver=192.168.1.254, rootpath=
Looking up port of RPC 100003/2 on 192.168.1.254
Looking up port of RPC 100005/1 on 192.168.1.254
Root-NFS: Server returned error -13 while mounting /nfs_root
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00             256 mtdblock0 (driver?)
1f01            3840 mtdblock1 (driver?)
1f02           81920 mtdblock2 (driver?)
1f03          176128 mtdblock3 (driver?)
b300         1955840 mmcblk0 driver: mmcblk
  b301         1955775 mmcblk0p1
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)


原因

error when mounting /nfs_root

通过nandflash启动  但是没有把rootfs烧到nandflash里面

设置的环境变量 说明通过nfs加载根文件系统,但是没有找到。

原因有二:其一:环境变量设置错了,

setenv bootargs root=/dev/nfs rw nfsroot=192.168.1.254:/nfsroot ip=192.168.1.253 console=ttySAC0,115200

应该为

setenv bootargs "root=/dev/mtdblock2 rw console=ttySAC0,115200"


其二。主机的/nfsroot 没有根文件系统文件。


至于是原因一还是二,看下跳线,启动方式就了然了。


4.

[uplooking]# setenv bootcmd nand read 0x50008000 0x40000 0x3b0000\;bootm 0x50008000
[uplooking]# save
5w�]������K;ݵ7A���j�8���;�:��5����y��cw���qN��k�o���'�]�o/h���{��=�����?Y�c��Txc��}M�'�}g���=�q���j}�Q2�t>I�#8�ѽw7=m���=s�۫�a�w      o
                          g��տ
                                                        �5ݽ�s���{��=p��i8J57'U���x���m$��{�oum;w��mk��zcc<���S��msg���i��='��%^)=�<5J�%�

原因分析,出现这种问题,在nand上烧写内核 时区域烧错了】

0x00000000-0x00040000 : "Bootloader"
0x00040000-0x00400000 : "Kernel"
0x00400000-0x05400000 : "Rootfs"
0x05400000-0x10000000 : "File System"


写u-boot到nand flash:
    nand erase 0 0x40000            
    tftp 0x50000000 u-boot-nand.bin
    nand write 0x50000000 0 0x40000


写内核到nand flash:
    nand erase 0x40000 0x300000
    tftp 0x50000000 zImage
    nand write 0x50000000 0x40000 0x220000

根文件系统

    u-boot操作:
        nand erase 0x400000 0xfc00000



5.

[uplooking]# nand erase 0 0x10000000


NAND erase: device 0 whole chip
Skipping bad block at  0x03800000                                            
Skipping bad block at  0x05a60000                                            
Skipping bad block at  0x07cc0000                                            
Skipping bad block at  0x0ddc0000                                            
Erasing at 0xffe0000 -- 100% complete.
OK


这不是个错误,写出来,擦处个nandflash时,有些块坏掉。但这个不影响,系统会自动的跳过。

如果想擦掉这写坏的块。可以用     nand scrub      全擦。【但有时会有问题,慎用】


6.
[WM9713]Open speaker volume.
ALSA device list:
  #0: SMDK6400 (WM9713)
TCP cubic registered
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
s3c2410-rtc s3c2410-rtc: setting system clock to 2000-07-20 12:33:36 UTC (964096416)
yaffs: dev is 32505858 name is "mtdblock2"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.2, "mtdblock2"
yaffs: auto selecting yaffs2
block 417 is bad
yaffs_read_super: isCheckpointed 0
VFS: Mounted root (yaffs filesystem).
Freeing init memory: 140K
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.

原因分析,这个和第三个问题原因类似,都是没有设置对。


7.通过板子ping主机无法ping通

[uplooking]# ping 192.168.1.254                                                 
dm9000 i/o: 0x18000300, id: 0x90000a46                                          
MAC: 64:31:50:a3:41:b5                                                          
operating at 100M full duplex mode                                              
ping failed; host 192.168.1.254 is not alive


原因分析。
检查
    ip地址   192.168.1.254
     子网掩码  255.255.255.0
是否设置正确


=========================================================================================================
总结。

   两种常用的引导u-boot,启动内核和加载根文件系统的方式。

s3c6410,  如果nandflash里面没有u-boot kenel rootfsj   通过sd引导 u-boot      通过 tftp传输kernel到板子的ram,从对应的地址启动。bootm。通过nfs加载根文件系统。

注意两点    1.环境的设置。2.跳线。

参考环境设置
bootdelay=3
baudrate=115200
gatewayip=192.168.1.1
netmask=255.255.255.0
ethaddr=64:31:50:a3:41:b5
ipaddr=192.168.1.253
serverip=192.168.1.254
bootargs_nfs=root=/dev/nfs rw nfsroot=192.168.1.254:/nfsroot ip=192.168.1.253 console=ttySAC0,115200
bootargs_nand=root=/dev/mtdblock2 rw console=ttySAC0,115200
bootcmd=nand read 0x50008000 0x40000 0x220000; bootm 0x50008000
bootargs=root=/dev/mtdblock2 rw console=ttySAC0,115200
stdin=serial
stdout=serial
stderr=serial


         通过sd卡引导 tftp传输kernel 。bootm启动内核  nfs加载根文件系统后,

第二种引导方式 :
         就要把u-boot  kernel  rootfs 烧写到nandflash里面。设置从nandflash引导u-boot的环境变量。

至于如何烧写,请参考第四个问题。

环境变量参考如下。

bootdelay=3                                                                     
baudrate=115200                                                                 
gatewayip=192.168.1.1                                                           
netmask=255.255.255.0                                                           
ethaddr=64:31:50:a3:41:b5                                                       
ipaddr=192.168.1.253                                                            
serverip=192.168.1.254                                                          
bootargs_nfs=root=/dev/nfs rw nfsroot=192.168.1.254:/nfsroot ip=192.168.1.253 console=ttySAC0,115200
bootargs_nand=root=/dev/mtdblock2 rw console=ttySAC0,115200                     
bootcmd=nand read 0x50008000 0x40000 0x220000; bootm 0x50008000                 
bootargs=root=/dev/mtdblock2 rw console=ttySAC0,115200                          
stdin=serial                                                                    
stdout=serial                                                                   
stderr=serial



烧写好之后,就可以上帆起航了。




=========================================================================================================


下面是从别处转载的。
http://blog.csdn.net/do2jiang/article/details/4195077

1.Bad Magic Number
## Booting image at 33000000 ...
Bad Magic Number
OMAP5912 OSK #(tftp下载好kernel的uImage后就停止在这,不能启动kernel)
 
问题原因:启动参数设置错误,0x30000000处不可以执行。
有的开发板sdram不是在0x33000000,所以不能把kernel uImage下载到0x33000000中运行。如我之前的bootcmd参数为:setenv bootcmd tftpboot 33000000 uImage/; bootm 33000000。但板子Omap5912的sdram地址在0x100000000,将参数改为setenv bootcmd tftpboot 10000000 uImage/; bootm 10000000后便可以启动kernel了。
 
2.启动停止在"Starting kernel ..."
TFTP from server 192.168.167.170; our IP address is 192.168.167.15
Filename 'uImage'
Load address: 0x10000000
Loading: #################################################################
         #################################################################
done
Bytes transferred = 2025908 (1ee9b4 hex)
## Booting image at 10000000 ...
   Image Name:   Linux-2.6.18-mh8_pro500-versatil
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2025844 Bytes =  1.9 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
OK
Starting kernel ...  (卡在这里)
 
问题原因:多半是kernel没编译成功。
确认configure参数是否配置正确,是否选择了正确的目标编译平台,如smdk2410等。
 
3.不能启动kernel
Starting kernel ...
Uncompressing Linux.........................................................
.................... done, booting the kernel.
 
问题原因:可能是Bootargs参数设置错误,确认bootargs设置是否正确。
 
4.不能挂载nfs
eth0: link up
IP-Config: Complete:
     device=eth0, addr=192.168.167.15, mask=255.255.255.0, gw=192.168.167.254,
     host=192.168.167.15, domain=, nis-domain=(none),
     bootserver=192.168.167.170, rootserver=192.168.167.170, rootpath=
Looking up port of RPC 100003/2 on 192.168.167.170
Root-NFS: Unable to get nfsd port number from server, using default
Looking up port of RPC 100005/1 on 192.168.167.170
Root-NFS: Unable to get mountd port number from server, using default
mount: server 192.168.167.170 not responding, timed out
Root-NFS: Server returned error -5 while mounting /work/nfs/rootfs_bluetooth_omap
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
 
问题原因:这种情况通常是nfs配置问题。
确认uboot的bootargs参数里和nfs相关的ip地址信息设置是否正确,以及Host机/etc/exports配置无误,重起nfs服务,重新尝试连接。另外还需要注意bootargs内console和mem两个参数的设置。kernel2.6后console最好设置为ttySAC0,mem也要根据开发板实际情况设置正确。
 
5.文件系统不能启动问题
eth0: link up
IP-Config: Complete:
      device=eth0, addr=192.168.167.15, mask=255.255.255.0, gw=192.168.167.254,
     host=192.168.167.15, domain=, nis-domain=(none),
     bootserver=192.168.167.170, rootserver=192.168.167.170, rootpath=
Looking up port of RPC 100003/2 on 192.168.167.170
Looking up port of RPC 100005/1 on 192.168.167.170
VFS: Mounted root (nfs filesystem).
Freeing init memory: 128K
/sbin/initKernel panic - not syncing: Attempted to kill init!
 
问题原因:制作的文件系统缺少运行busybox所需的libcrypt.so库,新版本会有缺库提示,老版本(1.60)没有。
注:运行一个busybox文件系统至少需要如下几个库:
ld-linux.so.x
libc.so.6
libcrypt.so.x
较新版本的busybox可能还需要
libm.so.6
libgcc_s.so.x (x为版本号)
6.文件系统不能启动问题2
eth0: link up
IP-Config: Complete:
      device=eth0, addr=192.168.167.15, mask=255.255.255.0, gw=192.168.167.254,
     host=192.168.167.15, domain=, nis-domain=(none),
     bootserver=192.168.167.170, rootserver=192.168.167.170, rootpath=
Looking up port of RPC 100003/2 on 192.168.167.170
Looking up port of RPC 100005/1 on 192.168.167.170
VFS: Mounted root (nfs filesystem).
Freeing init memory: 128K
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
 
问题原因:对比一个可用的文件系统后发现,缺少了ld-linux.so.x库,文件系统里只有ld-linux.so.x的连接文件,少拷了库文件。
 
8.不能获得帐户UID信息
Could not get password database information for UID of current process: User "???" unknown or no memory to allocate password entry
Unknown username "root" in message bus configuration file
Could not get password database information for UID of current process: User "???" unknown or no memory to allocate password entry
Failed to start message bus: Could not get UID and GID for username "root"
 
问题原因:
情况一:系统帐户验证出现问题.怀疑是调用getuid、getguid时并没有返回正确值,可能是缺少帐户验证相关库,实际排查后发现,缺少libnss_files库。拷贝交叉编译器的libnss_files库到文件系统后,启动文件系统成功。
情况二:系统没有root帐号。可以由whoami命令看出。
手动创建帐号。
#vi /etc/passwd
root:x:0:0:root:/root:/bin/sh
kyo:x:500:500:kyo:/home/kyo:/bin/bash
添加组
#vi group
root:x:0:root
 
9.
Freeing init memory: 128K
init started: BusyBox v1.6.1 (2007-08-27 14:33:15 CST) multi-call binary
starting pid 834, tty '': '/etc/init.d/rcS'
Cannot run '/etc/init.d/rcS': No such file or directory
Please press Enter to activate this console.
发现没有/etc/init.d/rcS文件系统一样能正常启动。看来rcS只是用来设置一些随机启动的参数,对文件能否正常运行关系不大。 注:这个不是错误,是偶然发现! :)

你可能感兴趣的:(tiny4412)