Hi Francesco,
On 25/05/2018 10:59, Francesco wrote:
> Hello Stefano,
> I was wondering if you could help me with this problem.
> I'm trying out swupdate and I would like to upgrade the whole rootfs on
> an mtd partition. In order to do this,I would like to flash into mtd7
> my current ubi.img.
> The ubi.img works fine when it is flashed using this command (this means
> that the image should work):
> /ubiformat -f ubi.img /dev/mtd7
ubiformat saves a UBI image, while SWUpdate is able to set and store
volumes.
If you want to let SWUpdate to set Volumes, you have to add a partitions
section in sw-description. The file in the image section belongs to a
volume, that is it is a UBIFS.
>
> /I then tried to do the same thing using swupdate, my sw-description
> file look like this:
> root@isar:~/swupdate-test# cat sw-description
> /software =//
> //{//
> // version = "0.1.0";//
> // description = "Firmware update for lynx Project";//
> // hardware-compatibility: [ "1.0", "1.2", "1.3"];//
> // images: (//
> // {//
> // filename = "ubi.img";//
> // type = "ubivol";//
If destination is a UBI volume, it cannot be a UBI (generated by
ubinize). It does not work.
Add partitions (volumes) and put your ubifs into the image section.
> // volume = "rootfs";//
> // }//
> // );//
> //}/
> (I'm not entirely sure if this is 100% correct. I also tried using
> device = /dev/mtd7, but it gave me the same sort of error)
> my swupdate.cfg is this:
> /globals ://
> //{//
> //
> // verbose = true;//
> // loglevel = 5;//
> // mtd-blacklist = "0 1 2 3 4 5 6 8 9 10 11 12 13 14";//
> //
> //};/
> As you can see I left out 7, since that is the destination of my mtd
> partition.
>
> Then I tried to update the rootfs while the system is running on mmc in
> this way:
> /swupdate -v -f swupdate.cfg -i lynx-image-test_1.0.swu
>
> /Here is the output:/
You pushed a UBI inside a ubivol, of course it crashes...
>
> Software updated successfully
> Please reboot the device to start the new software
> [INFO ] : SWUPDATE successful !
>
> /The output of dmesg is the following:
>
> /[ 100.402772] ubi0: attaching mtd7//
> //[ 112.417938] ubi0: scanning is finished//
> //[ 112.471207] ubi0 warning: print_rsvd_warning: cannot reserve enough
> PEBs for bad PEB handling, reserved 2, need 160//
> //[ 112.498256] ubi0: attached mtd7 (name "nand-ubi", size 1000 MiB)//
> //[ 112.512657] ubi0: PEB size: 131072 bytes (128 KiB), LEB size:
> 126976 bytes//
> //[ 112.519570] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page
> size 2048//
> //[ 112.527582] ubi0: VID header offset: 2048 (aligned 2048), data
> offset: 4096//
> //[ 112.535304] ubi0: good PEBs: 8000, bad PEBs: 0, corrupted PEBs: 0//
> //[ 112.542174] ubi0: user volume: 1, internal volumes: 1, max. volumes
> count: 128//
> //[ 112.549546] ubi0: max/mean erase counter: 21/18, WL threshold:
> 4096, image sequence number: 1454903147//
> //[ 112.560044] ubi0: available PEBs: 0, total reserved PEBs: 8000,
> PEBs reserved for bad PEB handling: 2//
> //[ 112.569328] ubi0: background thread "ubi_bgt0d" started, PID 378//
> //
> /Booting the board with rootfs in mtds ends up in a kernel panic, here
No.
> I hope you could give me some tips about these warnings/errors.
>
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone:
+49-8142-66989-53 Fax:
+49-8142-66989-80 Email:
sba...@denx.de
=====================================================================