Re: [yocto] Simple solution to create a non-root partition image?
Francesco Valla <[email protected]> Mon, 4 May 2026 19:58:13 +0200
| Newsgroups | org.yoctoproject.lists.yocto |
|---|---|
| Message-ID | <afjcHHSs2HjRvOrW@bywater> |
Hi Michael,
On Sun, May 03, 2026 at 10:40:02PM +0200, Michael Opdenacker wrote:
> Greetings,
>
> For an ongoing project with a read-only root filesystem, I'd like to create
> an image for a non-root partition.
>
> To give you some context, this partition would contain data and scripts to
> be used at first boot to do per device provisioning work. Some of these
> would be removed after provisioning, as they could tip attackers about how
> secrets are stored if they get their hands on devices that haven't been
> provisioned yet. Hence, these cannot be in the read-only root filesystem.
>
> To create such an image, I tried to create a new image recipe inheriting the
> "image" class, and then install some packages into the image with a "local"
> IMAGE_INSTALL list.
>
> This seems it could work, but I'm struggling with removing dependencies
> (bootloader, kernel, etc) that are only relevant for a root filesystem
> image.
>
in case you need to have a "full" filesystem, which not only includes
the provisioning tools but e.g. also their dependencies that you don't
want to include in the rootfs, an option might be mimic'ing what is done
for the initramfs [1]:
IMAGE_FEATURES = ""
IMAGE_LINGUAS = ""
PACKAGE_INSTALL = " \
foo \
bar \
baz \
"
PACKAGE_EXCLUDE = "kernel-image-*"
IMAGE_NAME_SUFFIX ?= ""
inherit image
Note there the usage of PACKAGE_INSTALL instead of IMAGE_INSTALL.
[1] https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/images/core-image-initramfs-boot.bb?h=styhead
> Would there be a simpler way to create a non root partition image?
>
> Thanks in advance
> Cheers
> Michael.
Regards,
Francesco