<div>>>2) I executed the below commands from barebox</div><div>>>#erase /dev/<a href="http://nand0.rootfs.bb/" target="_blank">nand0.rootfs.bb</a></div><div>>>#ubiattach /dev/nand0.rootfs</div><div>>> After this command it created the /dev/ubi0</div>
<div>>>#ubimkvol /dev/ubi0 rootfs 0</div><div>>> After this command it created the /dev/ubi0.rootfs</div><div>>>After these commands I copied the ubifs image on to the /dev/ubi0.rootfs.</div><div>>> #tftp root.ubifs /dev/ubi0.rootfs</div>
<div>>>Now I booted the kernel, in this method, I am getting the error like the volume layout not found.</div><div>VID headers are empty they are not updated, only the volume table 1 and 2 VID headers are updated and in which LEB the data is written those VID headers are updated. Rest of the PEB VID headers are empty. Volume rb tree is empty. Because of this I am getting the error "the layout volume was not found".</div>
<br><div class="gmail_quote">On Wed, Oct 17, 2012 at 4:41 PM, Madhu koriginja <span dir="ltr"><<a href="mailto:madhava.koriginja@gmail.com" target="_blank">madhava.koriginja@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi All,<div> Please help me how to flash the ubi image from barebox.</div><div>I generated the ubifs image using the mkfs.jffs2, then I created the ubi image using the ubinize. I am trying to flash this ubi image on NAND.</div>
<div><br></div><div>I tried in two ways</div><div>1) I flashed the UBI image directly on /dev/<a href="http://nand0.rootfs.bb" target="_blank">nand0.rootfs.bb</a>(erased the partition before flash). </div><div>In this method I am getting the errors like below</div>
<div><br></div><div><div>Freeing init memory: 152K</div><div>[ 15.420000] UBI warning: ubi_io_read_vid_hdr: bad magic number at PEB 255: 7d6be97d instead of 55424921</div><div>[ 15.430000] UBI warning: ubi_eba_copy_leb: error 3 while reading VID header back from PEB 255</div>
<div>[ 15.510000] UBI: run torture test for PEB 255</div><div>[ 19.430000] UBI error: torture_peb: read problems on freshly erased PEB 255, must be bad</div><div>[ 19.440000] UBI error: erase_worker: failed to erase PEB 255, error -5</div>
<div>[ 19.440000] UBI: mark PEB 255 as bad</div><div>[ 19.450000] UBI: 1 PEBs left in the reserve</div><div>[ 20.690000] UBI warning: ubi_io_read_vid_hdr: bad magic number at PEB 254: 7d6be97d instead of 55424921</div>
<div>[ 20.700000] UBI warning: ubi_eba_copy_leb: error 3 while reading VID header back from PEB 254</div><div>[ 20.710000] UBI: run torture test for PEB 254</div><div>[ 24.630000] UBI error: torture_peb: read problems on freshly erased PEB 254, must be bad</div>
<div>[ 24.640000] UBI error: erase_worker: failed to erase PEB 254, error -5</div><div>[ 24.640000] UBI: mark PEB 254 as bad</div><div>[ 24.650000] UBI warning: erase_worker: last PEB from the reserved pool was used</div>
<div>[ 26.030000] UBI warning: ubi_io_read_vid_hdr: bad magic number at PEB 253: 7d6be97d instead of 55424921</div><div>[ 26.040000] UBI warning: ubi_eba_copy_leb: error 3 while reading VID header back from PEB 253</div>
<div>[ 26.050000] UBI: run torture test for PEB 253</div><div>[ 29.980000] UBI error: torture_peb: read problems on freshly erased PEB 253, must be bad</div><div>[ 29.990000] UBI error: erase_worker: failed to erase PEB 253, error -5</div>
<div>[ 30.000000] UBI error: erase_worker: no reserved physical eraseblocks</div><div>[ 30.010000] UBI warning: ubi_ro_mode: switch to read-only mode</div><div>[ 30.010000] Backtrace:</div><div>[ 30.010000] [<c000c528>] (dump_backtrace+0x0/0x110) from [<c038df94>] (dump_stack+0x18/0x1c)</div>
<div>[ 30.020000] r6:dfac2b30 r5:dfac2800 r4:fffffffb r3:c04d93dc</div><div>[ 30.030000] [<c038df7c>] (dump_stack+0x0/0x1c) from [<c023f05c>] (erase_worker+0x55c/0x5c8)</div><div>[ 30.040000] [<c023eb00>] (erase_worker+0x0/0x5c8) from [<c023f858>] (do_work+0xd8/0x114)</div>
<div>[ 30.040000] [<c023f780>] (do_work+0x0/0x114) from [<c02400dc>] (ubi_thread+0x10c/0x19c)</div><div>[ 30.050000] r7:00000000 r6:00000000 r5:dfb84000 r4:dfac2800</div><div>[ 30.060000] [<c023ffd0>] (ubi_thread+0x0/0x19c) from [<c0049f18>] (kthread+0x90/0x98)</div>
<div>[ 30.070000] [<c0049e88>] (kthread+0x0/0x98) from [<c002f654>] (do_exit+0x0/0x69c)</div><div>[ 30.070000] r6:c002f654 r5:c0049e88 r4:df82ded4</div><div>[ 30.080000] UBI error: do_work: work failed with error code -5</div>
<div>[ 30.080000] UBI error: ubi_thread: ubi_bgt0d: work failed with error code -5</div></div><div><br></div><div>2) I executed the below commands from barebox</div><div>#erase /dev/<a href="http://nand0.rootfs.bb" target="_blank">nand0.rootfs.bb</a></div>
<div>#ubiattach /dev/nand0.rootfs</div><div> After this command it created the /dev/ubi0</div><div>#ubimkvol /dev/ubi0 rootfs 0</div><div> After this command it created the /dev/ubi0.rootfs</div><div>After these commands I copied the ubifs image on to the /dev/ubi0.rootfs.</div>
<div> #tftp root.ubifs /dev/ubi0.rootfs</div><div>Now I booted the kernel, in this method, I am getting the error like the volume layout not found.</div><div><br></div><div>Please tell me which method is correct. If the above two methods are not correct, please suggest me the correct method.</div>
<div><br></div><div>Thanks</div><div><br></div>
</blockquote></div><br>