Backing up u-boot.img and MLO

499 views
Skip to first unread message

Mark A. Yoder

unread,
Oct 17, 2014, 11:51:52 AM10/17/14
to beagl...@googlegroups.com
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

Robert Nelson

unread,
Oct 17, 2014, 11:54:41 AM10/17/14
to Beagle Board
On Fri, Oct 17, 2014 at 10:51 AM, Mark A. Yoder <mark.a...@gmail.com> wrote:
> 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

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,

--
Robert Nelson
http://www.rcn-ee.com/

Robert Nelson

unread,
Oct 17, 2014, 11:56:12 AM10/17/14
to Beagle Board
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

Mark A. Yoder

unread,
Oct 17, 2014, 1:07:07 PM10/17/14
to beagl...@googlegroups.com
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

Robert Nelson

unread,
Oct 17, 2014, 1:13:53 PM10/17/14
to Beagle Board
On Fri, Oct 17, 2014 at 12:07 PM, Mark A. Yoder <mark.a...@gmail.com> wrote:
> 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.

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.

Mark A. Yoder

unread,
Oct 17, 2014, 2:37:43 PM10/17/14
to beagl...@googlegroups.com
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

Robert Nelson

unread,
Oct 17, 2014, 2:39:53 PM10/17/14
to Beagle Board
On Fri, Oct 17, 2014 at 1:37 PM, Mark A. Yoder <mark.a...@gmail.com> wrote:
> 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..

Mark A. Yoder

unread,
Oct 17, 2014, 3:00:43 PM10/17/14
to beagl...@googlegroups.com
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

Robert Nelson

unread,
Oct 17, 2014, 3:24:20 PM10/17/14
to Beagle Board
On Fri, Oct 17, 2014 at 2:00 PM, Mark A. Yoder <mark.a...@gmail.com> wrote:
> 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..

Mark A. Yoder

unread,
Oct 18, 2014, 12:23:09 PM10/18/14
to beagl...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages