mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Martin Hollingsworth <Martin.Hollingsworth@itk-engineering.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: How to overwrite an ext partition on eMMC
Date: Tue, 5 Jul 2016 12:06:50 +0200	[thread overview]
Message-ID: <20160705100650.GQ20657@pengutronix.de> (raw)
In-Reply-To: <a8a601101c984586baf1df242e0eef5b@itk-engineering.de>

On Tue, Jul 05, 2016 at 09:32:30AM +0000, Martin Hollingsworth wrote:
> Hi Sascha,
> huge thanks, that was just the right push in the right direction. Both suggested methods - cp and memcpy - work fine. Problem solved.
> 
> > Why don't you use the partitions from the partition table on the device?
> > I would assume you use /dev/mmc3.2 for the rootfs.
> 
> I assume you are referring to using "detect -a" to find the device,
> which is then registered as mmc3.0 (for first partition). As I was
> struggling to write the root.ext2 onto that device I decided to try
> using the devfs_add_partition() method, as all nand flash based
> devices I have as reference use this approach. However I just
> verified, using the detected partition works as well and it is
> probably the better way of doing it, as the partitions can be moved
> around more easily.
> 
> In another side question you write: "I would assume you use
> /dev/mmc3.2 for the rootfs". As I currently only copy the Barebox raw
> onto the eMMC offset 0x400 for iMX6 it is not listed as partition
> under /dev/. What is the standard approach here, should the Barebox
> best be a FAT32 partition so it is listed?

For updating barebox you should use a barebox update handler. Register
it with imx6_bbu_internal_mmc_register_handler() and use the
barebox_update command to update barebox. This way you can be sure that
you only write suitable files on the device and also the partition table
is preserved properly.

eMMC devices also often have boot partitions which can be used to store
barebox. These allow to put barebox away from the regular storage where
it can't be overwritten that easily. You can copy barebox to
/dev/mmc3.boot0 (Or let the mentioned update handler point to that
place) and set mmc3.boot=boot0 to let the i.MX6 ROM know that it should
boot from there.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2016-07-05 10:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04 12:32 Martin Hollingsworth
2016-07-05  6:55 ` Sascha Hauer
2016-07-05  9:32   ` AW: " Martin Hollingsworth
2016-07-05 10:06     ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160705100650.GQ20657@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=Martin.Hollingsworth@itk-engineering.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox