All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] manipulating raw disk images as non-root user
Date: Wed, 6 Aug 2014 19:15:00 +0200	[thread overview]
Message-ID: <20140806171500.GC3891@free.fr> (raw)
In-Reply-To: <CAE9DZURSe+ZvKkQsnBLP6eHM7fvYhQypLDRa2Rm7rx6YMxthmg@mail.gmail.com>

Dallas, All,

On 2014-08-05 16:26 -0500, Dallas Clement spake thusly:
> > Also, if you want to have a look, I make use of those tools in my
> > Buildroot.config project:
> >    http://ymorin.is-a-geek.org/git/buildroot.config/
> 
> > You may want to have a look at:
> >
> http://ymorin.is-a-geek.org/git/buildroot.config/tree/scripts/genimages.d
> > and the subfolders for how to use those tools.
> 
> Thanks Yann.  This is good stuff!  The particular challenge I have is that
> I need to create and populate one vfat partition as well as one ext[2,3,4]
> partition, both within the same disk image file.

The easiest is to generate two different images, and then aggregate the
two to form the final image.

If you first create the final image, then create the two filesystems in
it, you have to provide the offsets to each filesystem when you want to
adress one or the other.

For ext2/3/4, I suggest you use genext2fs, which takes a directory and
its content (recursively), to create am ext2 filesystem, which you can
then convert to ext3 or ext4. We already have a script for that in
Buildroot, in fs/ext2/genext2fs.sh, which you can use as a source of
inspiration.

For vfat, I'm not aware of a tool similar to genext2fs, so you'd have to
create an empty file, then format it with nkfs.vfat, then use the mtools
to copy files into that filesystem image.

Finaly, create a partition table, and append the vfat and ext2
filesystem, to get the final image.

That's not trivial, mind you. And that's the reason I've been working on
this in my little buildroot.config project.

I tried to include this into Buildroot itself, but it is far from being
obvious (to say the least), for a lot of reasons I won't enumerate here.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

      reply	other threads:[~2014-08-06 17:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-02 16:45 [Buildroot] manipulating raw disk images as non-root user Dallas Clement
2014-08-02 16:54 ` Thomas Petazzoni
2014-08-04  7:05 ` Waldemar Brodkorb
2014-08-04 17:56   ` Dallas Clement
2014-08-04 18:10     ` Thomas Petazzoni
2014-08-04 18:10     ` Austin S Hemmelgarn
2014-08-04 19:22       ` Dallas Clement
2014-08-04 21:04 ` Yann E. MORIN
2014-08-05 21:26   ` Dallas Clement
2014-08-06 17:15     ` Yann E. MORIN [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=20140806171500.GC3891@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.