0

I have an embedded Linux environment working well and want save the rootfs part, then to flash others new board with empty nand.

So, what I tried. From barebox (before boot of the kernell), I put /dev/nand0.root.bb to the tftp server of my PC.

Then I tried rename it in rootfs.ubifs and at the good place to call the "update -t rootfs" script from an other (and a new one) board.

Size are different : 17301504 original rootfs.ubifs 264630784 /dev/nand0.root.bb

Problem is system not booting correctly.

Is there someone here who works in this way ? I need help...

Rikesh
  • 26,156
  • 14
  • 79
  • 87
vincenet
  • 41
  • 6

1 Answers1

0

vicenet,

You should do this differently. A UBI filesystem is not like the other images (MLO, barebox, kernel) on your nand flash, or even a hard disk image. So it can't be just copied by using cp on the nand0.root.bb partition. That's the reason, why your new system doesn't boot correctly.

Unfortunately I am also looking for a solution to do this, but I only know that the other direction (copying from an ubifs image to flash) can't be done like this either.

I think you should first have the UBI tools (ubimkvol, ubiattach, ubiformat) inside your barebox. If you don't, maybe look for a barebox version for your system that does, and flash this (of course BEFORE making a backup of the old one). This was one of my issues previously. If you know, how to compile one exactly fitting for your system, then go into the menuconfig and you should find the proper ubi commands.

However, when having this commands, I think the way could be to attach the /dev/nand0.root.bb to the system as a new character device like this:

ubiattach /dev/nand0.root
UBI: attaching mtd0 to ubi0
...
...

This is at least the way it goes when you want to flash a new image to nand. It creates a /dev/ubi0 node. Unfortunately, I tried this and failed on a following mount command, just to test if it had been created correctly:

mount /dev/ubi0 /mnt/rootfs
mount: bad file number

So, if even mounting fails, I think it isn't the correct way either to create the image, but maybe the correct direction to it. Maybe someone other knows the complete solution?

Zoli

  • @Zoli : I have no idea of the solution since now I prefer work on the yocto build to integrate the application and any configuration directly in the rootfs image. – vincenet Sep 07 '15 at 07:31