From: Enrico Joerns <ejo@pengutronix.de>
To: "Maciej Borzęcki" <maciej.borzecki@rndity.com>
Cc: Eduard Bartosh <eduard.bartosh@intel.com>,
Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: Contents of non-rootfs partitions
Date: Wed, 23 Nov 2016 11:12:35 +0100 [thread overview]
Message-ID: <71ba6b2a-4a87-9544-d249-c3fccc48a9f5@pengutronix.de> (raw)
In-Reply-To: <CAD4b0_LrF=sQMV3r+3Kb8hqxcqD9U_LBMesxCyby+FGS7YssFQ@mail.gmail.com>
On 11/23/2016 10:24 AM, Maciej Borzęcki wrote:
> On Wed, Nov 23, 2016 at 9:40 AM, Enrico Joerns <ejo@pengutronix.de> wrote:
>> On 11/22/2016 12:54 PM, Kristian Amlie wrote:
>>>
>>> On 22/11/16 12:10, Patrick Ohly wrote:
>>>>>
>>>>> ...
>>>>
>>>>
>>>> All of these introduce some special mechanism. Let me propose something
>>>> that might integrate better with the existing tooling:
>>>>
>>>> The "rootfs" directory gets redefined as representing the entire virtual
>>>> file system. When creating a disk image, it gets split up into different
>>>> partitions based on the image configuration.
>>>>
>>>> For example, the /home or /data directories in the rootfs could hold the
>>>> content that in some image configurations goes into separate partitions.
>>>>
>>>> The advantage of this approach is that the tooling for staging content
>>>> for image creation does not need to be changed. The same staged content
>>>> then can be used to create different images, potentially even using
>>>> different partition layouts.
>>>
>>>
>>> That's a very good idea. I think it beats all of my suggestions!
>>
>>
>> I totally agree with this solution, because it is the same approach we are
>> already using for several years.
>>
>> Instead of wic we are using the genimage tool
>> (http://public.pengutronix.de/software/genimage/) together with a Yocto
>> class for easing image creation, but its pretty much the same concerning its
>> base purpose.
>>
>> We called the option to split up 'mountpoint' while assuming that the
>> splitted partition will be mounted to the same location in the file system
>> it was taken from.
>>
>> An example configuration would look like this (stripped down to the
>> essential parts):
>>
>> image my-disk-image {
>> [...]
>> partition root {
>> image = "rootfs.ext4"
>> [...]
>> }
>>
>> partition home {
>> image = "home.ext4"
>> [...]
>> }
>> }
>>
>> image rootfs.ext4 {
>> [...]
>> mountpoint = "/"
>> }
>>
>> image home.ext4 {
>> [...]
>> mountpoint = "/home"
>> }
>>
>> Maybe a similar approach could be used in wic, too.
>
> I went through the README from genimage repo
> https://git.pengutronix.de/cgit/genimage/tree/README. Definitely looks
> interesting and covers storage medias that are not supported by wic
> right now. The split option does not seem to be documented though. If I
> understood you correctly, the partition is seeded with data from
> location specified by `mountpoint` inside IMAGE_ROOTFS. Is that correct?
Yes, what the genimage class (see below) does, is unpacking the final
rootfs.tar.xz inside a fakeroot environment and call the genimage tool
with the --rootpath argument set to this path.
The mountpoint="/home" tells genimage to pack all content in directory
/home into a separate data ext4 image (temporary named 'home.ext4') and
all other content in a rootfs ext4 image (temporary named 'rootfs.ext4').
The `image` section then specifies how to construct the final disk image
using the referenced generated rootfs and datafs images (and optionally
some bootloader, non-partition-data, etc.).
Note that this is only one way to use genimage. Another common way to
use it is to simply construct complex disk images out of different
filesystem images, e.g. with
partition barebox {
image = "barebox-any-platform.img"
size = 1M
in-partition-table = false
}
> I see there's a large overlap in functionality with wic (at least for
> block devices), so perhaps the best way would be introduce genimage as
> another IMAGE_CMD.
>
> I've quickly checked at https://layers.openembedded.org and there are no
> recipes for genimage/libconfuse listed there. Do happen to have done
> integration with OE in some private repo already? Would it be possible
> for you to post the relevant patches?
>
We have a layer for this, which is potentially publicly available but
not advertised as the general plan was to move some of its content to
upstream (oe-core, meta-oe) and split up other content (e.g. the rauc
update tool stuff) to separate layers that will be made publicly
available. But, as always, there are more plans than time left ;)
Well, to make a long story short, the path to the git repository is:
https://git.pengutronix.de/cgit/meta-ptx
The genimage class I mentioned above you can find in it, too:
https://git.pengutronix.de/cgit/meta-ptx/tree/classes/genimage.bbclass
When starting with Yocto I thought about changing from genimage to wic
for disk image creation as wic already seemed to become the standard
solution for building disk images. But back in these days it was a very
separate tool and there was no integration with the BSP itself (which is
crucial when having to reproduce builds). But the main reason why I
decided to stay with genimage was that wic simply did not cover most of
the use cases I required for building complex disk images for different
embedded platforms. I'm pretty sure that this has changed in some
points, but had no time to get deeper into this topic again, yet.
Hope that helps, best regards
Enrico
--
Pengutronix e.K. | Enrico Jörns |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5080 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2016-11-23 10:12 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-22 9:05 Contents of non-rootfs partitions Kristian Amlie
[not found] ` <CA+4=imZLMh7di712mejxQ6qgsDSXiCOJJDbUY99YC9DoCrqrmQ@mail.gmail.com>
2016-11-22 9:54 ` Kristian Amlie
2016-11-22 11:10 ` Patrick Ohly
2016-11-22 11:54 ` Kristian Amlie
2016-11-23 8:40 ` Enrico Joerns
2016-11-23 9:04 ` Kristian Amlie
2016-11-23 9:24 ` Maciej Borzęcki
2016-11-23 10:12 ` Enrico Joerns [this message]
2016-11-23 11:03 ` Maciej Borzęcki
2016-11-23 12:08 ` Ed Bartosh
2016-11-23 13:08 ` Kristian Amlie
2016-11-23 13:22 ` Ed Bartosh
2016-11-23 13:51 ` Maciej Borzęcki
2016-11-23 14:10 ` Ed Bartosh
2016-11-23 15:56 ` Patrick Ohly
2016-11-24 6:15 ` Ulrich Ölmann
2016-11-24 7:38 ` Patrick Ohly
2016-11-24 7:38 ` Kristian Amlie
2016-11-24 13:23 ` Ed Bartosh
2016-11-24 14:43 ` Kristian Amlie
2016-11-24 14:51 ` Ed Bartosh
2016-11-24 15:24 ` Patrick Ohly
2016-11-24 15:52 ` Kristian Amlie
2016-11-24 15:28 ` Andreas Oberritter
2016-11-24 15:51 ` Kristian Amlie
2016-11-24 16:21 ` Patrick Ohly
2016-11-24 16:40 ` Kristian Amlie
2016-11-23 13:44 ` Ed Bartosh
2016-11-23 14:20 ` Kristian Amlie
2016-11-22 23:45 ` Khem Raj
2016-11-23 7:13 ` Kristian Amlie
2016-11-23 7:26 ` Khem Raj
2016-11-23 9:01 ` Kristian Amlie
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=71ba6b2a-4a87-9544-d249-c3fccc48a9f5@pengutronix.de \
--to=ejo@pengutronix.de \
--cc=eduard.bartosh@intel.com \
--cc=maciej.borzecki@rndity.com \
--cc=openembedded-core@lists.openembedded.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 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.