把/ubifs_ipnc.bin 考到/var目录下,用utils目录下filesys_update的升级文件
#/opt/ipnc/filesys_update /dev/mtd4 /var/ubifs_ipnc.bin
出现Fail to create file,调试发现CreateFile(pFileName, fd, buf, sizeof(buf), &tFile)里
const char target[]="\r\n—————————–";
相应的target长度一直检测不出来
请高手帮忙一下这是原因?根文件升级分布在两个不同块/dev/mtd4 ,/dev/mtd6是如何升级?
能否用nandwrite 命令分次写
如:
#nandwrite -p /dev/mtd4 /var/ubifs_ipnc.bin +长度?
#nandwrite -p /dev/mtd6 /var/ubifs_ipnc.bin+长度?
试了不行。
Chris Meng:
Xinjian,
请参考下面论坛讨论:
http://www.deyisupport.com/question_answer/dsp_arm/davinci_digital_media_processors/f/39/p/9679/191227.aspx#191227
lu xinjian:
回复 Chris Meng:
出现类似错误,还是没有找到答案
lu xinjian:
#/usr/sbin/flash_eraseall /dev/mtd4 > /tmp/tmpfile.txt#ubiformat /dev/mtd4 -f /mnt/mmc/ubifs_ipnc.bin -s 512 -O 2048
提示
ubiformat: error!: please, first detach mtd4 (/dev/mtd4) from ubi0
#ubidetach /dev/ubi_ctrl -m 4
出现:
ubidetach: error!: cannot detach mtd4 error 16 (Device or resource busy)
用如下:
#/usr/sbin/nandwrite /dev/mtd4 /mnt/mmc/ubifs_ipnc.bin
也升级不成功
应该是mtd4系统里有运行情况
在nfs下是可以在linux下升级根文件成功,这种情况/dev/mtd4里没有动作
lu xinjian:
回复 lu xinjian:
好象是linux2.6.37 的ubifs mtd block有问题是否有补丁?还是其他引起?
Chris Meng:
回复 lu xinjian:
Xinjian,
你看看下面的两种流程是否可行?
第一种:
1. 擦除MTD6. DD命令把更新的文件系统的大小写入MTD6。然后把更新根系的bin文件写入/dev/mtd6
2. reboot系统,在uboot里面添加代码判断mtd6是否有数据,如果有,说明需要更新软件。对mtd4区域nand进行擦除,然后把在mtd6区域内的新的文件系统烧写到mtd4的区域范围内。
3. 重启系统,或者启动Linux。启动Linux后需要擦除mtd6。
第二种:
类似http://blog.csdn.net/fulinus/article/details/9033147里面的做法。把新的文件系统放在mtd6,修改uboot参数使其使用mtd6作为文件系统的位置,重启系统。如果需要多次升级,需要写段代码来判断当前使用的分区的是哪一个,新的文件系统能放在个分区,uboot参数应该如何修改。
lu xinjian:
回复 Chris Meng:
#/usr/sbin/flash_eraseall /dev/mtd6
#/usr/sbin/nandwrite /dev/mtd6 /mnt/mmc/ubifs_ipnc.bin
可以烧定到mtd6
在uboot重设参数
setenv bootargs 'console=ttyO0,115200n8 rootwait=1 rw ubi.mtd=6,2048 rootfstype=ubifs root=ubi0:rootfs init=/init mem=80M vram=4M notifyk.vpssm3_sva=0xBFD00000 ip=192.168.1.224 eth=00:0C:0C:A0:07:66 cmemk.phys_start=0x85000000 cmemk.phys_end=0x89000000 cmemk.allowOverlap=1 earlyprintk';saveenv
重启后不正常
nf_conntrack version 0.5.0 (1104 buckets, 4416 max)ip_tables: (C) 2000-2006 Netfilter Core TeamTCP cubic registeredNET: Registered protocol family 17Bridge firewalling registeredlib80211: common routines for IEEE802.11 driversRegistering the dns_resolver key typeVFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3omap_voltage_late_init: Voltage driver support not addedPower Management for TI81XX.Detected MACID=0:c:c:a0:7:66tps65911-rtc tps65911-rtc: setting system clock to 2012-11-10 01:37:12 UTC (1352511432)mmc1: new high speed SDHC card at address 1234mmcblk0: mmc1:1234 SA04G 3.63 GiB mmcblk0: p1 p2
CPSW phy found : id is : 0x4dd074PHY 0:01 not foundIP-Config: Guessing netmask 255.255.255.0IP-Config: Complete: device=eth0, addr=192.168.1.224, mask=255.255.255.0, gw=255.255.255.255, host=192.168.1.224, domain=, nis-domain=(none), bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)Please append a correct "root=" boot option; here are the available partitions:1f00 128 mtdblock0 (driver?)1f01 2304 mtdblock1 (driver?)1f02 128 mtdblock2 (driver?)1f03 4352 mtdblock3 (driver?)1f04 107520 mtdblock4 (driver?)1f05 12288 mtdblock5 (driver?)1f06 54272 mtdblock6 (driver?)1f07 81152 mtdblock7 (driver?)b300 3813376 mmcblk0 driver: mmcblk b301 72261 mmcblk0p1 00000000-0000-0000-0000-000000000mmcblk0p1 b302 3727080 mmcblk0p2 00000000-0000-0000-0000-000000000mmcblk0p2Kernel panic – not syncing: VFS: Unable to mount root fs on unknown-block(0,0)Backtrace:[<c004bf70>] (dump_backtrace+0x0/0x110) from [<c038e664>] (dump_stack+0x18/0x1c) r6:00008000 r5:c4414000 r4:c0501158 r3:60000013[<c038e64c>] (dump_stack+0x0/0x1c) from [<c038e6c4>] (panic+0x5c/0x178)[<c038e668>] (panic+0x0/0x178) from [<c0009184>] (mount_block_root+0x1c4/0x204) r3:00000000 r2:00000000 r1:c4425f78 r0:c0447dd5 r7:c002db7c[<c0008fc0>] (mount_block_root+0x0/0x204) from [<c000940c>] (prepare_namespace+0x94/0x1cc)[<c0009378>] (prepare_namespace+0x0/0x1cc) from [<c0008d70>] (kernel_init+0x114/0x154) r5:c002d144 r4:c002d144[<c0008c5c>] (kernel_init+0x0/0x154) from [<c00730fc>] (do_exit+0x0/0x5d0) r5:c0008c5c r4:00000000
lu xinjian:
回复 lu xinjian:
http://blog.chinaunix.net/uid-20506382-id-3022800.html
Nand要使用UBI作为文件系统,但是在mount 和 ubidetach时,出现Device or resource busy 错误解决办法:1.内核配置中取消CONFIG_MTD_BLOCK可能正常使用mount/ubiattach2.网上说用2.6.36就不会有此问题,至于怎么改代码没时间看了
我把.config里的
#CONFIG_MTD_BLOCK=y注解,
make -s lspmenu后还是恢复到
CONFIG_MTD_BLOCK=y
这个主法是否对?
Chris Meng:
回复 lu xinjian:
lu xinjian1f04 107520 mtdblock4 (driver?)1f05 12288 mtdblock5 (driver?)1f06 54272 mtdblock6 (driver?)
你的文件系统有多大?mtd4和mtd6的大小不同。
lu xinjian:
回复 Chris Meng:
50944 ubifs_ipnc.bin 差不多50多M ,uboot下烧写大小是52166656(31c0000)
mtd4 0x6900000
mtd6 0x3500000
TI中文支持网
