Discussion:
Migrate a SD card from olinuxino lime to lime2 ?
Dominique Dumont
2018-01-03 19:00:44 UTC
Permalink
Hello

I'm going to upgrade my trusty olinuxino A20 lime to a lime2 board. Both board
have to NAND or MMC memory and the kernel is installed on a SD card.

To avoid a re-install from scratch, I'd like to re-use Sd card of the lime
board in the new lime2 board.

Is is possible to use flash-kernel on the old board to setup the SD card for
the new board ?

I was thinking of:
- running the following command on the old lime card:
FK_MACHINE="Olimex A20-OLinuXino-LIME2" flash-kernel
- move the SD card in the lime2 board
- boot the lime2 board and voilà...

Did I miss something ?

All the best
--
https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org
Karsten Merker
2018-01-03 19:35:32 UTC
Permalink
Post by Dominique Dumont
I'm going to upgrade my trusty olinuxino A20 lime to a lime2
board. Both board have to NAND or MMC memory and the kernel is
installed on a SD card.
To avoid a re-install from scratch, I'd like to re-use Sd card
of the lime board in the new lime2 board.
Is is possible to use flash-kernel on the old board to setup
the SD card for the new board ?
FK_MACHINE="Olimex A20-OLinuXino-LIME2" flash-kernel
- move the SD card in the lime2 board
- boot the lime2 board and voilà...
Did I miss something ?
From the flash-kernel point of view this approach should work,
but in addition to that you would also need to replace the u-boot
on the SD card with a u-boot built for the LIME2 as the u-boot
binary is platform-specific. To write the new u-boot, perform
the following steps:

$ sudo apt-get install u-boot-sunxi
$ sudo dd if=/usr/lib/u-boot/A20-OLinuXino-Lime2/u-boot-sunxi-with-spl.bin bs=1k seek=8 of=/dev/mmcblk0

I'd recommend making an image backup of the SD card before
performing the steps outlined above, just in case something
goes wrong.

HTH,
Karsten
--
Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.
Dominique Dumont
2018-01-04 17:31:02 UTC
Permalink
Post by Dominique Dumont
From the flash-kernel point of view this approach should work,
but in addition to that you would also need to replace the u-boot
on the SD card with a u-boot built for the LIME2 as the u-boot
binary is platform-specific. To write the new u-boot, perform
$ sudo apt-get install u-boot-sunxi
$ sudo dd if=/usr/lib/u-boot/A20-OLinuXino-Lime2/u-boot-sunxi-with-spl.bin
bs=1k seek=8 of=/dev/mmcblk0
yes, that did the trick.

Curiously enough, I did forgot this step. The Lime2 board booted fine but only
500MB of RAM were seen by the kernel.. I guess that RAM setup is performed by
uboot and not by the firmware of the kernel.

Anyway, once uboot for lime2 is installed as you instructed, the card works
fine.
Post by Dominique Dumont
I'd recommend making an image backup of the SD card before
performing the steps outlined above, just in case something
goes wrong.
Good idea.

Thanks to Adam and Karsten for the help

All the best
--
https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org
Karsten Merker
2018-01-04 18:51:01 UTC
Permalink
Post by Dominique Dumont
Post by Dominique Dumont
From the flash-kernel point of view this approach should work,
but in addition to that you would also need to replace the u-boot
on the SD card with a u-boot built for the LIME2 as the u-boot
binary is platform-specific. To write the new u-boot, perform
$ sudo apt-get install u-boot-sunxi
$ sudo dd if=/usr/lib/u-boot/A20-OLinuXino-Lime2/u-boot-sunxi-with-spl.bin bs=1k seek=8 of=/dev/mmcblk0
yes, that did the trick.
Curiously enough, I did forgot this step. The Lime2 board
booted fine but only 500MB of RAM were seen by the kernel..
I guess that RAM setup is performed by uboot and not by the
firmware of the kernel.
Yes, the DRAM controller setup is handled by u-boot (to be exact:
by u-boot's SPL).

Regards,
Karsten
--
Gem. Par. 28 Abs. 4 Bundesdatenschutzgesetz widerspreche ich der Nutzung
sowie der Weitergabe meiner personenbezogenen Daten für Zwecke der
Werbung sowie der Markt- oder Meinungsforschung.
Adam Borowski
2018-01-03 20:03:34 UTC
Permalink
Post by Dominique Dumont
I'm going to upgrade my trusty olinuxino A20 lime to a lime2 board. Both board
have to NAND or MMC memory and the kernel is installed on a SD card.
To avoid a re-install from scratch, I'd like to re-use Sd card of the lime
board in the new lime2 board.
Is is possible to use flash-kernel on the old board to setup the SD card for
the new board ?
Yes, but I believe it's more convenient to do so from your big noisy box.
apt install qemu-user-static
cp -p /usr/bin/qemu-arm-static /mnt/.../usr/bin/
chroot /mnt/.../

This way you avoid editing the tree branch you're sitting on -- if anything
goes wrong, you can't boot the sd card on either the old or the new board to
fix the problem (unless you run entirely from eMMC).

In theory, you can put an USB sd reader into the old board, but it's not
much different from just doing this from the big box.
Post by Dominique Dumont
FK_MACHINE="Olimex A20-OLinuXino-LIME2" flash-kernel
- move the SD card in the lime2 board
- boot the lime2 board and voilà...
Should work, yeah.

I'd recommend making a copy of the card, though -- this way you'll have
_two_ functioning boards.

And, saving an image of the card on a nearby piece of spinning rust --
preferably both before and after the operation, is also a good idea.


Meow!
--
// If you believe in so-called "intellectual property", please immediately
// cease using counterfeit alphabets. Instead, contact the nearest temple
// of Amon, whose priests will provide you with scribal services for all
// your writing needs, for Reasonable And Non-Discriminatory prices.
Loading...