[yocto] Create uncompressed rootfs

Anders Darander anders at chargestorm.se
Mon Nov 2 23:05:38 PST 2015


* 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.

> 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.

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



More information about the yocto mailing list