[yocto] System recovery

Martin Townsend mtownsend1973 at gmail.com
Thu May 10 06:47:13 PDT 2018


Hi Enrico,

Then I would use a tar.gz image type and then extract that onto the
formatted partition of the SD card or if the partition is ext then I
think you can generate an image type for this.

There is also wic for generating partitioned images, I've not used it
so can't really comment on it but is described in the Yocto manual.

-Martin

On Thu, May 10, 2018 at 7:14 AM, Enrico Bonomi
<enrico.bonomi92 at gmail.com> wrote:
> Hi Martin,
>
> I know that i can create multiple images types, but i don't want an sdcard
> bootable image. On my first try, the image on sdcard was ubi type because i
> want to obtain i kind of recovery partition directly on the sdcard. Do you
> suggest to put the recovery partition directly on the raw NAND? in that case
> how could i create a compressed image (because i don't have enough space on
> my device to keep 2 images)?
>
> thanks
>
> Enrico
>
> 2018-05-09 12:37 GMT+02:00 Martin Townsend <mtownsend1973 at gmail.com>:
>>
>> On Wed, May 9, 2018 at 11:21 AM, Enrico Bonomi
>> <enrico.bonomi92 at gmail.com> wrote:
>> > Hi Martin,
>> >
>> > I'm newbie in yocto, but i used IMAGE_FSTYPES ="sdcard" to boot the
>> > system
>> > from SD card. What i want to obtain is to replace the broken file system
>> > that is located on the NAND with another one that works. A kind of
>> > recovery
>> > partition. is it possible from SD or should i create a recovery
>> > partition
>> > over the NAND?
>> >
>> > thanks
>> >
>> > Enrico
>> >
>> > 2018-05-09 11:25 GMT+02:00 Martin Townsend <mtownsend1973 at gmail.com>:
>> >>
>> >> Hi Enrico,
>> >>
>> >> UBI is only designed to work on raw NAND using the MTD subsystem.  MMC
>> >> will be a standard block device as the SD card will have Flash
>> >> Translation layer. See the excellent MTD website for more info
>> >> http://www.linux-mtd.infradead.org/doc/ubi.html
>> >>
>> >> In Yocto I believe you can use "sdcard" in the IMAGE_FSTYPES for a
>> >> flashable image for SD cards that can be used with U-Boot.
>> >>
>> >> -Martin.
>> >>
>> >>
>> >> On Wed, May 9, 2018 at 9:31 AM, Enrico Bonomi
>> >> <enrico.bonomi92 at gmail.com>
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > I work with Yocto Poky 1.7.3 on an imx6 dual lite SOM. I recently
>> >> > came
>> >> > across a problem with a preexisting system. Infact in a couple of
>> >> > cases,
>> >> > after about one year of work with no problems, file system results
>> >> > corrupted
>> >> > and the machine can't work. So i decide to implement a recovery
>> >> > system
>> >> > that
>> >> > can intervene in theese cases. An sd card is mounted on my board, so
>> >> > i
>> >> > think
>> >> > that i can use it to act this process. Using gparted i create a
>> >> > partition on
>> >> > sd card that can store my recovery file system.
>> >> > This partition starts at block 1581056 (so 0x00182000), every block
>> >> > has
>> >> > a
>> >> > size of 512 bytes and the file system size is 370262016 bytes (so
>> >> > 0x1611c000) that are 723168 blocks (so 0x000b08e0).
>> >> > In the u-boot i do the following instructions:
>> >> >
>> >> > nand erase.part rootfs
>> >> > ubi part rootfs
>> >> > ubi create rootfs
>> >> > mmc dev 0
>> >> > mmc read 12000000 0x00182000  0x000b08e0
>> >> > ubi write 12000000 rootfs 0x1611c000
>> >> > ubifsmount ubi0:rootfs
>> >> >
>> >> > and this instruction results in the following errors:
>> >> >
>> >> > UBIFS error (pid 0): ubifs_read_node: bad node type (0 but expected
>> >> > 6)
>> >> > UBIFS error (pid 0): ubifs_read_node: bad node at LEB 0:0
>> >> > UBIFS error (pid 0): ubifs_mount: Error reading superblock on volume
>> >> > 'ubi0:rootfs' errno=-22!
>> >> >
>> >> > ubifsmount - mount UBIFS volume
>> >> >
>> >> > Usage:
>> >> > ubifsmount <volume-name>
>> >> >    - mount 'volume-name' volume
>> >> >
>> >> > the strange thing is that when i first program all new devices i use
>> >> > the
>> >> > following instruction:
>> >> >
>> >> > tftpboot prall
>> >> >
>> >> > and prall is the compiled of a txt file which, when programming file
>> >> > system
>> >> > use the same instructions, obviously except for
>> >> >
>> >> > tftp 12000000 rootfs.ubifs
>> >> >
>> >> > instead of my mmc instructions, and
>> >> >
>> >> > ubi write 12000000 rootfs ${filesize}
>> >> >
>> >> > but from what i understand the "filesize" variable is set from the
>> >> > tftp
>> >> > instruction
>> >> >
>> >> > Where do i fail?
>> >> >
>> >> > Thanks
>> >> >
>> >> > Enrico
>> >> >
>> >> > --
>> >> > _______________________________________________
>> >> > yocto mailing list
>> >> > yocto at yoctoproject.org
>> >> > https://lists.yoctoproject.org/listinfo/yocto
>> >> >
>> >
>> >
>>
>> You forgot to reply to all so added the Yocto mailing list back in again.
>>
>> You can create multiple images by specifying ubi and sdcard in
>> IMAGE_FSTYPES and then flash ubi to the raw NAND and then the sdcard
>> image to the SD then write the logic to perform the switch.
>>
>> -Martin.
>
>


More information about the yocto mailing list