Backing up u-boot.img and MLO

I see on the recent test images[1] that u-boot and MLO are handled differently than before[2]. You copy u-boot.img and MLO using:

dd if=MLO of=/dev/sdX count=1 seek=1 conv=notrunc bs=128k
dd if=u-boot.img of=/dev/sdX count=2 seek=1 conv=notrunc bs=384k

I want to try my own u-boot, but before overwriting working copy I’d like to back it up. Does this work?

bone$ dd if=/dev/mmcblk1boot1 of=u-boot.img.bak count=2 seek=1 bs=384k

bone$ dd if=/dev/mmcblk1boot0 of=MLO.bak count=1 seek=1 bs=128k

When updating u-boot, do I also need to update MLO?

Can I update a running Bone with?

dd if=MLO of=/dev/__*mmcblk1boot0*__ count=1 seek=1 conv=notrunc bs=128k
dd if=u-boot.img of=/dev/__*mmcblk1boot1*__ count=2 seek=1 conv=notrunc bs=384k

Thanks…

–Mark

[1] http://rcn-ee.net/deb/testing/
[2] http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0#Boot_Partition_.28omap4.2B_.28am335x.29.29

Oh, we don't use the eMMC "boot" aka: "/dev/mmcblkXbootY" locations. I
don't think ti's bootrom on even the newest cortex parts support that
partition either...

Regards,

btw, there should be backup version located here:

/opt/backup/uboot/

https://github.com/RobertCNelson/omap-image-builder/blob/master/tools/setup_sdcard.sh#L997

Regards,

Thanks for the quick backup tip.

What command do I run if I want to install a new u-boot while the Bone is running? I don’t see it on either the FAT or ext4 partition.

–Mark

Either:

sudo dd if=MLO of=/dev/mmcblk0p0 count=1 seek=1 conv=notrunc bs=128k
sudo dd if=u-boot.img of=/dev/mmcblk0p0 count=2 seek=1 conv=notrunc bs=384k

or

sudo dd if=MLO of=/dev/mmcblk1p0 count=1 seek=1 conv=notrunc bs=128k
sudo dd if=u-boot.img of=/dev/mmcblk1p0 count=2 seek=1 conv=notrunc bs=384k

It's just stored in the mbr section, in the 1Mb hole at the start of the drive.

Regards,

Well, I must be doing something wrong. I’ve runn your suggested dd commands and I’ve try shutting the Bone down and dd’ing straight to the SD card, but it appears I’m always running the same u-boot.

Do you have any ideas what might keep u-boot from updating?

–Mark

Well, I must be doing something wrong. I've runn your suggested dd commands
and I've try shutting the Bone down and dd'ing straight to the SD card, but
it appears I'm always running the same u-boot.

Remember there's two media devices..

microSD & eMMC

So if you only update the microSD, the eMMC's mlo/u-boot.img still get priority

Do you have any ideas what might keep u-boot from updating?

PS, you can dd it to the partition while the system is active, I've
been doing that for awhile with i.mx5/6 boards with no issues..

Regards,

I think I’ve updated both. Since I’m booting off the SD card, doesn’t /dev/mmcblk0p0 refer to the SD card and /dev/mmcblk1p0 refer to the eMMc?

I’ve even tried holding down the S2 button to force it to boot off of the SD card and I’m still getting the original u-boot.

I thought I had a nice exercise for my students, but it has me stumped.

–Mark

I think I've updated both. Since I'm booting off the SD card, doesn't
/dev/mmcblk0p0 refer to the SD card and /dev/mmcblk1p0 refer to the eMMc?

Yeap..

I've even tried holding down the S2 button to force it to boot off of the SD
card and I'm still getting the original u-boot.

odd.. works here.

Maybe power off and let the cap's discharge..

Regards,

Well… I’ve installed the 8-Oct-2014 Debian test image on both the eMMc and an SD card and boot from either, but no luck on installing MLO and u-boot. The same u-boot runs no matter what dd I run.

Is there a way of verifying the the dd really worked?

–Mark

bone# dd if=MLO of=/dev/mmcblk0p0 count=1 seek=1 conv=notrunc bs=128k
0+1 records in
0+1 records out
83564 bytes (84 kB) copied, 0.008099 s, 10.3 MB/s
bone# dd if=u-boot.img of=/dev/mmcblk0p0 count=2 seek=1 conv=notrunc bs=384k
1+1 records in
1+1 records out
456460 bytes (456 kB) copied, 2.13407 s, 214 kB/s