Re: [poky] [question]: Creating tailored image without standard rootfs files?

Ross Burton <[email protected]>
Newsgroups org.yoctoproject.lists.poky
Message-ID <[email protected]>
On 13 Dec 2023, at 15:57, Einar Gunnarsson via lists.yoctoproject.org <[email protected]> wrote:
> 
> Hello,
> 
> I basically want to be able to build an ext4 image for an extra partition that is not a rootfs.
> 
> So I don't need the kernel, or /run /var /etc folders or anything like that.
> Just a few packages are needed, but with a QT app on that partition, loads of dependencies are pulled in and I end up with +80 entries in the manifest.
> 
> This was asked 10 years ago, but I still have the same issue now.
> https://docs.yoctoproject.org/pipermail/yocto/2013-March/012804.html
> 
> This image would then be used by wic as well as swupdate, as a non-root partition.
> Are there some tweaks to actually build an image without pulling in everything needed for a rootfs*?
> I tried making my own tweaked version of image.bbclass, but I got lost in the abstraction.
> 
> 
> *) Building a basic container-test-image with a linux-dummy still has all the folders /bin /boot /dev /etc /home /lib /media /mnt /proc /run /sbin /sys /tmp /usr /var
> and +20 entries in the manifest (17MB of stuff), just for a 12KB binary (/usr/bin/theapp).

If you set PACKAGE_INSTALL in your image then you override the implicit packages which can pull in dependencies.

Unsetting IMAGE_LINGUAS and IMAGE_FEATURES will ensure that you don’t get any surprising features or locales installed.

However, if you have a non-statically linked Qt app that will obviously depend on other pieces of the system (such as libqt, so libx11, etc etc).  This is a policy choice for you though: should apps in this partition be self-contained (so they either pull in their deps, or are statically linked), or depend on the contents of the main rootfs?

If the latter then you can either actually build one rootfs and use wic to split it into separate partitions, or define a dummy recipe that defines the “ABI” that your rootfs provides: this can RPROVIDES the names that you don’t want in the second partition (like libx11) and by installing that the dependencies will be satisfied.

Ross
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.