[yocto] Create uncompressed rootfs

Andre McCurdy armccurdy at gmail.com
Tue Nov 3 02:33:18 PST 2015


On Mon, Nov 2, 2015 at 11:05 PM, Anders Darander <anders at chargestorm.se> wrote:
> * Andre McCurdy <armccurdy at gmail.com> [151102 20:35]:
>
>> See the "IMAGE_TYPES" variable for a list of rootfs types which are
>> supported. There's support for creating an uncompressed .tar file, but
>> I don't see any support for creating a rootfs directory under
>> tmp/deploy.
>
> No, the usual workflow here is to unpack the tar'ed rootfs at a suitable
> location.

Indeed. I don't think it's what Roberto was asking for though...

>> Depending on your work flow there are a few different solutions
>> though. You could extend
>> openembedded-core/meta/classes/image_types.bbclass to do what you want
>> (e.g. define a new image type or hack "IMAGE_CMD_tar" so that it also
>> untars rootfs.tar right after creating it).
>
> Well, there's some issues with this approach. In order to uncompress the
> tarball and be able to set owner, group, and permissions on all files,
> you need to untar the rootfs with root privileges. The same is true when
> it comes to creating device nodes.

Enabling CONFIG_DEVTMPFS in the kernel is pretty standard, so for most
people there are no device nodes in the rootfs tarfile and /dev is an
empty directory.

Extracting rootfs tarfiles as an unprivileged user has always worked
fine for me. Do you have a specific example where root privileges are
required?

> Thus, I think it really do make a lot more sense to untar the rootfs in
> an external step, which very well could be scripted.
>
>> Or you could ignore OE's
>> image creation and manually copy or rsync your image's rootfs ( under
>> tmp/work/<MACHINE>.../<IMAGE>/.../rootfs ) to the directory exported
>> by your NFS server. Note that you probably shouldn't export
>> tmp/work/.../rootfs directly since when the target boots it will
>> create files owned by root, which will cause problems later if you try
>> to rebuild or modify the rootfs.
>
> No, avoid doing this. The reasons are the same as why you shouldn't
> unpack the tarball using a new image type; you're not allowed to set the
> correct owner, group, and permissions on files, nor are you allowed to
> create device nodes.
>
> Cheers,
> Anders
>
> --
> Anders Darander
> ChargeStorm AB / eStorm AB
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list