u-boot、kernel、root系統燒寫和掛載命令命令


一、uboot 環境變量:

1. 打印環境變量:# print

2. 設置啟動參數
# set bootargs noinitrd init=/linuxrc console=ttySAC0,115200 root=/dev/nfs nfsroot=192.168.1.103:/work/nfs_root/1.20_fs ip=192.168.1.105:192.168.1.103:192.168.1.1:255.255.255.0::eth0:off
# set bootargs console=ttySAC0,115200 root=/dev/nfs nfsroot=192.168.1.113:/work/nfs_root/1.20_fs ip=192.168.1.105:192.168.1.113:192.168.1.1:255.255.255.0::eth0:off

設置jffs2 文件啟動:

#set bootargs console=ttySAC0 root=/dev/mtdblock3 rootfstype=jffs2  // jffs2 

########啟動文件系統時亂碼問題解決:

# set bootargs console=ttySAC0,115200 root=/dev/mtdblock3     // yaffs  出現亂碼時可用

# set bootcmd 'nand read 30000000 kernel;bootm 30000000'

// 設置機器ID: 

# set machid 16a    //亂碼方法

3. 配置本機/服務器ip:

# set ipaddr 10.70.12.155
# set serverip 10.70.12.103;
# set ethaddr 00:0c:29:4d:e4:f4;

4. 查看Nandflash的分區: # mtdpart
  回顯:
  device nand0 <nandflash0>, # parts = 4
  #: name                        size            offset          mask_flags
  0: bootloader          0x00040000      0x00000000      0
  1: params               0x00020000      0x00040000      0
  2: kernel                 0x00200000      0x00060000      0
  3: root                     0x0fda0000       0x00260000      0
5. 保存
# save;
二、 燒寫命令:
1. -->tftp命令
1)uboot
# tftp 32000000 u-boot.bin
# nand erase 0 40000                 //擦除 偏移地址:0x00000000 大小:0x00040000字節
# nand write 32000000 0 40000  //從內存0x32000000為開始地址的 大小:0x00040000字節  寫入 nandflash 偏移地址:0x00000000
2)uImage
# tftp 30000000 uImage_digitpic
# nand erase 0x00060000 0x00200000      
# nand write 30000000 0x00060000 0x00200000         
啟動內核:
# boot;
# bootm 30000000
3)yaffs2燒寫:
# tftp 32000000 fs_mini_mdev_new_digitpic.yaffs2
//# nand erase 0x00260000 0xfda0000    //直接寫地址
# nand erase root;   //看分區寫名稱代替地址
//# nand write.yaffs 32000000 0x00260000 0x0fda0000 
# nand write.yaffs 30000000 0x00260000  $(filesize);  //實際大小$(filesize);
2. -->nfs命令
1)// 下載u-boot u-boot_2012_org.bin 
nfs 32000000 10.70.12.103:/work/nfs_root/u-boot_2012_k4.bin;  
nand erase bootloader;
nand write 32000000 bootloader;
2)uImage
# nfs 30000000 10.70.12.103:/work/nfs_root/uImage_nolcd  
# bootm 30000000
3.-->掛載命令
(# ifconfig eth0 10.70.12.168 配置網卡eth0的ip)
mount -t nfs -o nolock,vers=2 10.70.12.103:/work/nfs_root/ /mnt
 
 
 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM